Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(814)

Unified Diff: build/go/go.py

Issue 871863005: Remove //build/go, this is not used in chromium (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | build/go/rules.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/go/go.py
diff --git a/build/go/go.py b/build/go/go.py
deleted file mode 100755
index 4d355111ba2fcde291120154968230e3c0c14fbc..0000000000000000000000000000000000000000
--- a/build/go/go.py
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""
-This script invokes the go build tool.
-Must be called as follows:
-python go.py <go-binary> <build directory> <output file> <src directory>
-<CGO_CFLAGS> <CGO_LDFLAGS> <go-binary options>
-eg.
-python go.py /usr/lib/google-golang/bin/go out/build out/a.out .. "-I."
-"-L. -ltest" test -c test/test.go
-"""
-
-import argparse
-import os
-import shutil
-import sys
-
-def main():
- parser = argparse.ArgumentParser()
- parser.add_argument('go_binary')
- parser.add_argument('build_directory')
- parser.add_argument('output_file')
- parser.add_argument('src_root')
- parser.add_argument('cgo_cflags')
- parser.add_argument('cgo_ldflags')
- parser.add_argument('go_option', nargs='*')
- args = parser.parse_args()
- go_binary = args.go_binary
- build_dir = args.build_directory
- out_file = os.path.abspath(args.output_file)
- # The src directory specified is relative. We need this as an absolute path.
- src_root = os.path.abspath(args.src_root)
- # GOPATH must be absolute, and point to one directory up from |src_Root|
- go_path = os.path.abspath(os.path.join(src_root, ".."))
- # GOPATH also includes any third_party/go libraries that have been imported
- go_path += ":" + os.path.abspath(os.path.join(src_root, "third_party/go"))
- go_options = args.go_option
- try:
- shutil.rmtree(build_dir, True)
- os.mkdir(build_dir)
- except:
- pass
- old_directory = os.getcwd()
- os.chdir(build_dir)
- os.environ["GOPATH"] = go_path
- os.environ["CGO_CFLAGS"] = args.cgo_cflags
- os.environ["CGO_LDFLAGS"] = args.cgo_ldflags
- os.system("%s %s" % (go_binary, " ".join(go_options)))
- out_files = [ f for f in os.listdir(".") if os.path.isfile(f)]
- if (len(out_files) > 0):
- shutil.move(out_files[0], out_file)
- os.chdir(old_directory)
- try:
- shutil.rmtree(build_dir, True)
- except:
- pass
-
-if __name__ == '__main__':
- sys.exit(main())
« no previous file with comments | « no previous file | build/go/rules.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698