diff options
author | David Ostrovsky <david@ostrovsky.org> | 2019-06-09 09:03:25 +0200 |
---|---|---|
committer | David Ostrovsky <david@ostrovsky.org> | 2019-06-09 09:03:25 +0200 |
commit | 6804566a022844e66ed1b93e3eba3a898a90ed6f (patch) | |
tree | dcc635da62e3f928a1a7c23bdad254159c68053d | |
parent | 2ca54d91e11c809b663613eb1f518d5087472115 (diff) |
project.py: Add support for bazel wrapper bazelisk
Add --bazel option to allow to pass bazelisk. The default value for
bazel executable is not changed and is still bazel.
Change-Id: I1bc744b741d04f609c2e8b1c3d9144f820cd4f17
-rwxr-xr-x | tools/eclipse/project.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/eclipse/project.py b/tools/eclipse/project.py index af36a3f7d6..97008e2fe4 100755 --- a/tools/eclipse/project.py +++ b/tools/eclipse/project.py @@ -51,13 +51,16 @@ opts.add_option('--plugins', help='create eclipse projects for plugins', action='store_true') opts.add_option('--name', help='name of the generated project', action='store', default='gerrit', dest='project_name') +opts.add_option('--bazel', help='name of the bazel executable', + action='store', default='bazel', dest='bazel_exe') + args, _ = opts.parse_args() def retrieve_ext_location(): - return check_output(['bazel', 'info', 'output_base']).strip() + return check_output([args.bazel_exe, 'info', 'output_base']).strip() def gen_bazel_path(): - bazel = check_output(['which', 'bazel']).strip().decode('UTF-8') + bazel = check_output(['which', args.bazel_exe]).strip().decode('UTF-8') with open(path.join(ROOT, ".bazel_path"), 'w') as fd: fd.write("bazel=%s\n" % bazel) fd.write("PATH=%s\n" % environ["PATH"]) @@ -66,7 +69,7 @@ def _query_classpath(target): deps = [] t = cp_targets[target] try: - check_call(['bazel', 'build', t]) + check_call([args.bazel_exe, 'build', t]) except CalledProcessError: exit(1) name = 'bazel-bin/tools/eclipse/' + t.split(':')[1] + '.runtime_classpath' @@ -276,7 +279,7 @@ try: makedirs(path.join(ROOT, gwt_working_dir)) try: - check_call(['bazel', 'build', MAIN, GWT, '//gerrit-patch-jgit:libEdit-src.jar']) + check_call([args.bazel_exe, 'build', MAIN, GWT, '//gerrit-patch-jgit:libEdit-src.jar']) except CalledProcessError: exit(1) except KeyboardInterrupt: |