Merge branch 'stable-2.16' into stable-3.0 * stable-2.16: Update Gerrit API to 2.16.23 Change-Id: Ibff210ae0616cd63a74ece2f541d9d93d29c9f69
diff --git a/README.md b/README.md index 25fd058..3f0d7de 100644 --- a/README.md +++ b/README.md
@@ -22,22 +22,32 @@ ```python git_repository( - name = "com_github_davido_bazlets", - remote = "https://github.com/davido/bazlets.git", - commit = "2ede19cb2d2dd9d04bcb70ffc896439a27e5d50d", + name = "com_googlesource_gerrit_bazlets", + remote = "https://gerrit.googlesource.com/bazlets", + commit = "928c928345646ae958b946e9bbdb462f58dd1384", ) -load("@com_github_davido_bazlets//:gerrit_api.bzl", - "gerrit_api") +load("@com_googlesource_gerrit_bazlets//:gerrit_api.bzl", "gerrit_api") +gerrit_api() ``` -Another option is to consume snapshot version of gerrit plugin API from local -Maven repository (`~/.m2`). To use the snapshot version special method is -provided: +The `version` parameter allows to override the default API. For release version +numbers, make sure to also provide artifacts' SHA1 sums via the +`plugin_api_sha1` and `acceptance_framework_sha1` parameters: ```python -load("@com_googlesource_gerrit_bazlets//:gerrit_api_maven_local.bzl", - "gerrit_api_maven_local") -gerrit_api_maven_local() +load("@com_googlesource_gerrit_bazlets//:gerrit_api.bzl", "gerrit_api") +gerrit_api(version = "3.0.9", + plugin_api_sha1 = "dbcadf2c198b1ee1b74678855e8e10b2c403de1f", + acceptance_framework_sha1 = "799cb104f2c0de4394528e38ad487557dd69bb49") +``` + +If the version ends in `-SNAPSHOT`, the jars are consumed from the local +Maven repository (`~/.m2`) per default assumed to be and the SHA1 sums can be +omitted: + +```python +load("@com_googlesource_gerrit_bazlets//:gerrit_api.bzl", "gerrit_api") +gerrit_api(version = "3.0.10-SNAPSHOT") ``` <a name="basic-example"></a> @@ -47,11 +57,12 @@ ``` [workspace]/ - WORKSPACE - BUILD - src/main/java/ - src/main/resources/ - [...] +├── src +│ └── main +│ ├── java +│ └── resources +├── BUILD +└── WORKSPACE ``` To build this plugin, your `BUILD` can look like this: @@ -62,7 +73,6 @@ gerrit_plugin( name = "reviewers", srcs = glob(["src/main/java/**/*.java"]), - gwt_module = "com.googlesource.gerrit.plugins.reviewers.ReviewersForm", manifest_entries = [ "Gerrit-PluginName: reviewers", "Gerrit-Module: com.googlesource.gerrit.plugins.reviewers.Module", @@ -81,7 +91,7 @@ ## gerrit_plugin ```python -gerrit_plugin(name, srcs, resources, gwt_module, deps, manifest_entries): +gerrit_plugin(name, srcs, resources, deps, manifest_entries): ``` ### Implicit output target @@ -126,15 +136,6 @@ </td> </tr> <tr> - <td><code>gwt_module</code></td> - <td> - <code>String, optional</code> - <p> - Name of GWT UI module. - </p> - </td> - </tr> - <tr> <td><code>deps</code></td> <td> <code>List of labels, optional</code>
diff --git a/gerrit_api.bzl b/gerrit_api.bzl index b18a066..2f856b2 100644 --- a/gerrit_api.bzl +++ b/gerrit_api.bzl
@@ -1,48 +1,42 @@ load("//:bouncycastle.bzl", "bouncycastle_repos") load("//:gerrit_api_version.bzl", "gerrit_api_version") load("//:rules_python.bzl", "rules_python_repos") -load("//tools:maven_jar.bzl", "maven_jar") +load("//tools:maven_jar.bzl", "MAVEN_LOCAL", "MAVEN_CENTRAL", "maven_jar") """Bazel rule for building [Gerrit Code Review](https://www.gerritcodereview.com/) gerrit_api is rule for fetching Gerrit plugin API using Bazel. """ -VER = "2.16.23" - -def gerrit_api(): +def gerrit_api(version = "3.0.13", + plugin_api_sha1 = "fe1f0d3240a0b4d142c7de66730ad708debb9cd1", + acceptance_framework_sha1 = "cfbb9a315334d07fa9a120ee3dbfab0ceaf19265"): gerrit_api_version( name = "gerrit_api_version", - version = VER, + version = version, ) bouncycastle_repos() rules_python_repos() + local_repository = version.endswith("-SNAPSHOT") + maven_jar( name = "gerrit_plugin_api", - artifact = "com.google.gerrit:gerrit-plugin-api:" + VER, - sha1 = "cc373a9cfa7cb8ce6ed582a91a3af3d5167a048f", - ) - maven_jar( - name = "gerrit_plugin_gwtui", - artifact = "com.google.gerrit:gerrit-plugin-gwtui:" + VER, - sha1 = "b57b4c1daf1ea2764aec5780719f3540e1e4d68b", - exclude = ["com/google/gwt/*"], + artifact = "com.google.gerrit:gerrit-plugin-api:" + version, + sha1 = "" if local_repository else plugin_api_sha1, + repository = MAVEN_LOCAL if local_repository else MAVEN_CENTRAL, ) maven_jar( name = "gerrit_acceptance_framework", - artifact = "com.google.gerrit:gerrit-acceptance-framework:" + VER, - sha1 = "4606a628c35e0fa9ccc449d1b4617d26c4a22dad", + artifact = "com.google.gerrit:gerrit-acceptance-framework:" + version, + sha1 = "" if local_repository else acceptance_framework_sha1, + repository = MAVEN_LOCAL if local_repository else MAVEN_CENTRAL, ) native.bind( name = "gerrit-plugin-api", actual = "@gerrit_plugin_api//jar", ) native.bind( - name = "gerrit-plugin-gwtui", - actual = "@gerrit_plugin_gwtui//jar", - ) - native.bind( name = "gerrit-acceptance-framework", actual = "@gerrit_acceptance_framework//jar", ) @@ -51,10 +45,6 @@ actual = "@gerrit_plugin_api//jar:neverlink", ) native.bind( - name = "gerrit-plugin-gwtui-neverlink", - actual = "@gerrit_plugin_gwtui//jar:neverlink", - ) - native.bind( name = "gerrit-acceptance-framework-neverlink", actual = "@gerrit_acceptance_framework//jar:neverlink", )
diff --git a/gerrit_api_maven_local.bzl b/gerrit_api_maven_local.bzl deleted file mode 100644 index 1926649..0000000 --- a/gerrit_api_maven_local.bzl +++ /dev/null
@@ -1,59 +0,0 @@ -load("//:bouncycastle.bzl", "bouncycastle_repos") -load("//:gerrit_api_version.bzl", "gerrit_api_version") -load("//:rules_python.bzl", "rules_python_repos") -load("//tools:maven_jar.bzl", "MAVEN_LOCAL", "maven_jar") - -"""Bazel rule for building [Gerrit Code Review](https://www.gerritcodereview.com/) -gerrit_api is rule for fetching Gerrit plugin API using Bazel. -""" - -VER = "2.16.22-SNAPSHOT" - -def gerrit_api_maven_local(): - gerrit_api_version( - name = "gerrit_api_version", - version = VER, - ) - - bouncycastle_repos() - rules_python_repos() - - maven_jar( - name = "gerrit_plugin_api", - artifact = "com.google.gerrit:gerrit-plugin-api:" + VER, - repository = MAVEN_LOCAL, - ) - maven_jar( - name = "gerrit_plugin_gwtui", - artifact = "com.google.gerrit:gerrit-plugin-gwtui:" + VER, - repository = MAVEN_LOCAL, - ) - maven_jar( - name = "gerrit_acceptance_framework", - artifact = "com.google.gerrit:gerrit-acceptance-framework:" + VER, - repository = MAVEN_LOCAL, - ) - native.bind( - name = "gerrit-plugin-api", - actual = "@gerrit_plugin_api//jar", - ) - native.bind( - name = "gerrit-plugin-gwtui", - actual = "@gerrit_plugin_gwtui//jar", - ) - native.bind( - name = "gerrit-acceptance-framework", - actual = "@gerrit_acceptance_framework//jar", - ) - native.bind( - name = "gerrit-plugin-api-neverlink", - actual = "@gerrit_plugin_api//jar:neverlink", - ) - native.bind( - name = "gerrit-plugin-gwtui-neverlink", - actual = "@gerrit_plugin_gwtui//jar:neverlink", - ) - native.bind( - name = "gerrit-acceptance-framework-neverlink", - actual = "@gerrit_acceptance_framework//jar:neverlink", - )
diff --git a/gerrit_gwt.bzl b/gerrit_gwt.bzl deleted file mode 100644 index c1980cf..0000000 --- a/gerrit_gwt.bzl +++ /dev/null
@@ -1,158 +0,0 @@ -load("//tools:maven_jar.bzl", "maven_jar") - -GWT_VER = "2.8.2" - -OW2_VER = "5.1" - -def gerrit_gwt(): - maven_jar( - name = "gwt_user", - artifact = "com.google.gwt:gwt-user:" + GWT_VER, - sha1 = "a2b9be2c996a658c4e009ba652a9c6a81c88a797", - attach_source = False, - ) - maven_jar( - name = "gwt_dev", - artifact = "com.google.gwt:gwt-dev:" + GWT_VER, - sha1 = "7a87e060bbf129386b7ae772459fb9f87297c332", - attach_source = False, - ) - maven_jar( - name = "javax_validation", - artifact = "javax.validation:validation-api:1.0.0.GA", - sha1 = "b6bd7f9d78f6fdaa3c37dae18a4bd298915f328e", - src_sha1 = "7a561191db2203550fbfa40d534d4997624cd369", - ) - maven_jar( - name = "jsinterop_annotations", - artifact = "com.google.jsinterop:jsinterop-annotations:1.0.2", - sha1 = "abd7319f53d018e11108a88f599bd16492448dd2", - src_sha1 = "33716f8aef043f2f02b78ab4a1acda6cd90a7602", - ) - maven_jar( - name = "findbugs_jsr305", - artifact = "com.google.code.findbugs:jsr305:3.0.1", - sha1 = "f7be08ec23c21485b9b5a1cf1654c2ec8c58168d", - attach_source = False, - ) - maven_jar( - name = "ant_artifact", - artifact = "ant:ant:1.6.5", - sha1 = "7d18faf23df1a5c3a43613952e0e8a182664564b", - src_sha1 = "9e0a847494563f35f9b02846a1c1eb4aa2ee5a9a", - ) - maven_jar( - name = "colt_artifact", - artifact = "colt:colt:1.2.0", - attach_source = False, - sha1 = "0abc984f3adc760684d49e0f11ddf167ba516d4f", - ) - maven_jar( - name = "tapestry_artifact", - artifact = "tapestry:tapestry:4.0.2", - attach_source = False, - sha1 = "e855a807425d522e958cbce8697f21e9d679b1f7", - ) - maven_jar( - name = "w3c_css_sac", - artifact = "org.w3c.css:sac:1.3", - attach_source = False, - sha1 = "cdb2dcb4e22b83d6b32b93095f644c3462739e82", - ) - maven_jar( - name = "ow2_asm", - artifact = "org.ow2.asm:asm:" + OW2_VER, - sha1 = "5ef31c4fe953b1fd00b8a88fa1d6820e8785bb45", - ) - maven_jar( - name = "ow2_asm_analysis", - artifact = "org.ow2.asm:asm-analysis:" + OW2_VER, - sha1 = "6d1bf8989fc7901f868bee3863c44f21aa63d110", - ) - maven_jar( - name = "ow2_asm_commons", - artifact = "org.ow2.asm:asm-commons:" + OW2_VER, - sha1 = "25d8a575034dd9cfcb375a39b5334f0ba9c8474e", - ) - maven_jar( - name = "ow2_asm_tree", - artifact = "org.ow2.asm:asm-tree:" + OW2_VER, - sha1 = "87b38c12a0ea645791ead9d3e74ae5268d1d6c34", - ) - maven_jar( - name = "ow2_asm_util", - artifact = "org.ow2.asm:asm-util:" + OW2_VER, - sha1 = "b60e33a6bd0d71831e0c249816d01e6c1dd90a47", - ) - native.bind( - name = "gwt-user", - actual = "@gwt_user//jar", - ) - native.bind( - name = "gwt-dev", - actual = "@gwt_dev//jar", - ) - native.bind( - name = "gwt-user-neverlink", - actual = "@gwt_user//jar:neverlink", - ) - native.bind( - name = "gwt-dev-neverlink", - actual = "@gwt_dev//jar:neverlink", - ) - native.bind( - name = "javax-validation", - actual = "@javax_validation//jar", - ) - native.bind( - name = "javax-validation-src", - actual = "@javax_validation//src", - ) - native.bind( - name = "jsinterop-annotations", - actual = "@jsinterop_annotations//jar", - ) - native.bind( - name = "jsinterop-annotations-src", - actual = "@jsinterop_annotations//src", - ) - native.bind( - name = "jsr305", - actual = "@findbugs_jsr305//jar", - ) - native.bind( - name = "ant", - actual = "@ant_artifact//jar", - ) - native.bind( - name = "colt", - actual = "@colt_artifact//jar", - ) - native.bind( - name = "tapestry", - actual = "@tapestry_artifact//jar", - ) - native.bind( - name = "w3c-css-sac", - actual = "@w3c_css_sac//jar", - ) - native.bind( - name = "ow2-asm", - actual = "@ow2_asm//jar", - ) - native.bind( - name = "ow2-asm-analysis", - actual = "@ow2_asm_analysis//jar", - ) - native.bind( - name = "ow2-asm-commons", - actual = "@ow2_asm_commons//jar", - ) - native.bind( - name = "ow2-asm-tree", - actual = "@ow2_asm_tree//jar", - ) - native.bind( - name = "ow2-asm-util", - actual = "@ow2_asm_util//jar", - )
diff --git a/gerrit_plugin.bzl b/gerrit_plugin.bzl index e5b1f43..4021733 100644 --- a/gerrit_plugin.bzl +++ b/gerrit_plugin.bzl
@@ -6,21 +6,11 @@ _plugin_test_deps = "PLUGIN_TEST_DEPS", ) load("//tools:genrule2.bzl", "genrule2") -load( - "//tools:gwt.bzl", - "GWT_COMPILER_ARGS", - "GWT_JVM_ARGS", - "GWT_PLUGIN_DEPS_NEVERLINK", - "GWT_TRANSITIVE_DEPS", - "gwt_binary", - _gwt_plugin_deps = "GWT_PLUGIN_DEPS", -) """Bazel rule for building [Gerrit Code Review](https://www.gerritcodereview.com/) gerrit_plugin is rule for building Gerrit plugins using Bazel. """ -GWT_PLUGIN_DEPS = _gwt_plugin_deps PLUGIN_DEPS = _plugin_deps PLUGIN_DEPS_NEVERLINK = _plugin_deps_neverlink PLUGIN_TEST_DEPS = _plugin_test_deps @@ -30,17 +20,12 @@ deps = [], provided_deps = [], srcs = [], - gwt_module = [], resources = [], manifest_entries = [], dir_name = None, target_suffix = "", **kwargs): - gwt_deps = [] static_jars = [] - if gwt_module: - static_jars = [":%s-static" % name] - gwt_deps = GWT_PLUGIN_DEPS_NEVERLINK if not dir_name: dir_name = name @@ -49,7 +34,7 @@ name = name + "__plugin", srcs = srcs, resources = resources, - deps = provided_deps + deps + gwt_deps + PLUGIN_DEPS_NEVERLINK, + deps = provided_deps + deps + PLUGIN_DEPS_NEVERLINK, visibility = ["//visibility:public"], **kwargs ) @@ -63,36 +48,6 @@ visibility = ["//visibility:public"], ) - if gwt_module: - java_library( - name = name + "__gwt_module", - resources = depset(srcs + resources).to_list(), - runtime_deps = deps + GWT_PLUGIN_DEPS, - visibility = ["//visibility:public"], - ) - genrule2( - name = "%s-static" % name, - cmd = " && ".join([ - "mkdir -p $$TMP/static", - "unzip -qd $$TMP/static $(location %s__gwt_application)" % name, - "cd $$TMP", - "zip -qr $$ROOT/$@ .", - ]), - tools = [":%s__gwt_application" % name], - outs = ["%s-static.jar" % name], - ) - gwt_binary( - name = name + "__gwt_application", - module = [gwt_module], - deps = GWT_PLUGIN_DEPS + GWT_TRANSITIVE_DEPS + [ - "//external:gwt-dev", - "//external:gwt-user", - ], - module_deps = [":%s__gwt_module" % name], - compiler_args = GWT_COMPILER_ARGS, - jvm_args = GWT_JVM_ARGS, - ) - native.genrule( name = name + "__gen_stamp_info", stamp = 1,
diff --git a/tools/download_file.py b/tools/download_file.py index 8f790be..f62a43c 100755 --- a/tools/download_file.py +++ b/tools/download_file.py
@@ -80,7 +80,6 @@ opts.add_option('-v', help='expected content SHA-1') opts.add_option('-x', action='append', help='file to delete from ZIP') opts.add_option('--exclude_java_sources', action='store_true') -opts.add_option('--unsign', action='store_true') args, _ = opts.parse_args() root_dir = args.o @@ -138,18 +137,6 @@ print('error opening %s: %s' % (cache_ent, err), file=stderr) exit(1) -if args.unsign: - try: - with ZipFile(cache_ent, 'r') as zf: - for n in zf.namelist(): - if (n.endswith('.RSA') - or n.endswith('.SF') - or n.endswith('.LIST')): - exclude.append(n) - except (BadZipfile, LargeZipFile) as err: - print('error opening %s: %s' % (cache_ent, err), file=stderr) - exit(1) - safe_mkdirs(path.dirname(args.o)) if exclude: try:
diff --git a/tools/gwt.bzl b/tools/gwt.bzl deleted file mode 100644 index aada689..0000000 --- a/tools/gwt.bzl +++ /dev/null
@@ -1,287 +0,0 @@ -# Copyright (C) 2016 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Port of Buck native gwt_binary() rule. See discussion in context of -# https://github.com/facebook/buck/issues/109 -load("//tools:genrule2.bzl", "genrule2") -load("//tools:java.bzl", "java_library2") - -BROWSERS = [ - "chrome", - "firefox", - "gecko1_8", - "safari", - "msie", - "ie8", - "ie9", - "ie10", - "edge", -] - -ALIASES = { - "chrome": "safari", - "edge": "gecko1_8", - "firefox": "gecko1_8", - "msie": "ie10", -} - -MODULE = "com.google.gerrit.GerritGwtUI" - -GWT_COMPILER = "com.google.gwt.dev.Compiler" - -GWT_JVM_ARGS = ["-Xmx512m"] - -GWT_COMPILER_ARGS = [ - "-XdisableClassMetadata", -] - -GWT_COMPILER_ARGS_RELEASE_MODE = GWT_COMPILER_ARGS + [ - "-XdisableCastChecking", -] - -GWT_PLUGIN_DEPS_NEVERLINK = [ - "//external:gerrit-plugin-gwtui-neverlink", - "//external:gwt-user-neverlink", -] - -GWT_PLUGIN_DEPS = [ - "//external:gerrit-plugin-gwtui", -] - -GWT_TRANSITIVE_DEPS = [ - "//external:ant", - "//external:colt", - "//external:javax-validation", - "//external:javax-validation-src", - "//external:jsinterop-annotations", - "//external:jsinterop-annotations-src", - "//external:jsr305", - "//external:tapestry", - "//external:w3c-css-sac", - "//external:ow2-asm", - "//external:ow2-asm-analysis", - "//external:ow2-asm-commons", - "//external:ow2-asm-tree", - "//external:ow2-asm-util", -] - -DEPS = GWT_TRANSITIVE_DEPS + [ - "//:gwt-dev", -] - -USER_AGENT_XML = """<module rename-to='gerrit_ui'> -<inherits name='%s'/> -<set-property name='user.agent' value='%s'/> -<set-property name='locale' value='default'/> -</module> -""" - -def gwt_module(gwt_xml = None, resources = [], srcs = [], **kwargs): - if gwt_xml: - resources = resources + [gwt_xml] - - java_library2( - srcs = srcs, - resources = resources, - **kwargs - ) - -def _gwt_user_agent_module(ctx): - """Generate user agent specific GWT module.""" - if not ctx.attr.user_agent: - return None - - ua = ctx.attr.user_agent - impl = ua - if ua in ALIASES: - impl = ALIASES[ua] - - # intermediate artifact: user agent speific GWT xml file - gwt_user_agent_xml = ctx.actions.declare_file(ctx.label.name + "_gwt.xml") - ctx.actions.write( - output = gwt_user_agent_xml, - content = USER_AGENT_XML % (MODULE, impl), - ) - - # intermediate artifact: user agent specific zip with GWT module - gwt_user_agent_zip = ctx.actions.declare_file(ctx.label.name + "_gwt.zip") - gwt = "%s_%s.gwt.xml" % (MODULE.replace(".", "/"), ua) - dir = gwt_user_agent_zip.path + ".dir" - cmd = " && ".join([ - "p=$PWD", - "mkdir -p %s" % dir, - "cd %s" % dir, - "mkdir -p $(dirname %s)" % gwt, - "cp $p/%s %s" % (gwt_user_agent_xml.path, gwt), - "$p/%s cC $p/%s $(find . | sed 's|^./||')" % (ctx.executable._zip.path, gwt_user_agent_zip.path), - ]) - ctx.actions.run_shell( - inputs = [gwt_user_agent_xml] + ctx.files._zip, - outputs = [gwt_user_agent_zip], - command = cmd, - mnemonic = "GenerateUserAgentGWTModule", - ) - - return struct( - zip = gwt_user_agent_zip, - module = MODULE + "_" + ua, - ) - -def _gwt_binary_impl(ctx): - module = ctx.attr.module[0] - output_zip = ctx.outputs.output - output_dir = output_zip.path + ".gwt_output" - deploy_dir = output_zip.path + ".gwt_deploy" - - deps = _get_transitive_closure(ctx) - - paths = [dep.path for dep in deps.to_list()] - - gwt_user_agent_modules = [] - ua = _gwt_user_agent_module(ctx) - if ua: - paths.append(ua.zip.path) - gwt_user_agent_modules.append(ua.zip) - module = ua.module - - cmd = "%s %s -Dgwt.normalizeTimestamps=true -cp %s %s -war %s -deploy %s " % ( - ctx.attr._jdk[java_common.JavaRuntimeInfo].java_executable_exec_path, - " ".join(ctx.attr.jvm_args), - ":".join(paths), - GWT_COMPILER, - output_dir, - deploy_dir, - ) - - # TODO(davido): clean up command concatenation - cmd = cmd + " ".join([ - "-style %s" % ctx.attr.style, - "-optimize %s" % ctx.attr.optimize, - "-strict", - " ".join(ctx.attr.compiler_args), - module + "\n", - "rm -rf %s/gwt-unitCache\n" % output_dir, - "root=`pwd`\n", - "cd %s; $root/%s Cc ../%s $(find .)\n" % ( - output_dir, - ctx.executable._zip.path, - output_zip.basename, - ), - ]) - - ctx.actions.run_shell( - inputs = depset(direct = gwt_user_agent_modules, transitive = [deps]), - outputs = [output_zip], - tools = ctx.files._jdk + ctx.files._zip, - mnemonic = "GwtBinary", - progress_message = "GWT compiling " + output_zip.short_path, - command = "set -e\n" + cmd, - ) - -def _get_transitive_closure(ctx): - deps = [] - for dep in ctx.attr.module_deps: - deps.append(dep[JavaInfo].transitive_runtime_deps) - deps.append(dep[JavaInfo].transitive_source_jars) - for dep in ctx.attr.deps: - if JavaInfo in dep: - deps.append(dep[JavaInfo].transitive_runtime_deps) - elif hasattr(dep, "files"): - deps.append(dep.files) - - return depset(transitive = deps) - -gwt_binary = rule( - attrs = { - "compiler_args": attr.string_list(), - "jvm_args": attr.string_list(), - "module": attr.string_list(default = [MODULE]), - "module_deps": attr.label_list(allow_files = [".jar"]), - "optimize": attr.string(default = "9"), - "style": attr.string(default = "OBF"), - "user_agent": attr.string(), - "deps": attr.label_list(allow_files = [".jar"]), - "_jdk": attr.label( - default = Label("@bazel_tools//tools/jdk:current_java_runtime"), - cfg = "host", - ), - "_zip": attr.label( - default = Label("@bazel_tools//tools/zip:zipper"), - cfg = "host", - executable = True, - allow_single_file = True, - ), - }, - outputs = { - "output": "%{name}.zip", - }, - implementation = _gwt_binary_impl, -) - -def gwt_genrule(suffix = ""): - dbg = "ui_dbg" + suffix - opt = "ui_opt" + suffix - module_dep = ":ui_module" + suffix - args = GWT_COMPILER_ARGS_RELEASE_MODE if suffix == "_r" else GWT_COMPILER_ARGS - - genrule2( - name = "ui_optdbg" + suffix, - srcs = [ - ":" + dbg, - ":" + opt, - ], - cmd = "cd $$TMP;" + - "unzip -q $$ROOT/$(location :%s);" % dbg + - "mv" + - " gerrit_ui/gerrit_ui.nocache.js" + - " gerrit_ui/dbg_gerrit_ui.nocache.js;" + - "unzip -qo $$ROOT/$(location :%s);" % opt + - "mkdir -p $$(dirname $@);" + - "zip -qr $$ROOT/$@ .", - outs = ["ui_optdbg" + suffix + ".zip"], - visibility = ["//visibility:public"], - ) - - gwt_binary( - name = opt, - module = [MODULE], - module_deps = [module_dep], - deps = DEPS, - compiler_args = args, - jvm_args = GWT_JVM_ARGS, - ) - - gwt_binary( - name = dbg, - style = "PRETTY", - optimize = "0", - module_deps = [module_dep], - deps = DEPS, - compiler_args = GWT_COMPILER_ARGS, - jvm_args = GWT_JVM_ARGS, - ) - -def gwt_user_agent_permutations(): - for ua in BROWSERS: - gwt_binary( - name = "ui_%s" % ua, - user_agent = ua, - style = "PRETTY", - optimize = "0", - module = [MODULE], - module_deps = [":ui_module"], - deps = DEPS, - compiler_args = GWT_COMPILER_ARGS, - jvm_args = GWT_JVM_ARGS, - )
diff --git a/tools/maven_jar.bzl b/tools/maven_jar.bzl index c4cae43..46aa4c1 100644 --- a/tools/maven_jar.bzl +++ b/tools/maven_jar.bzl
@@ -140,8 +140,6 @@ args = [python, script, "-o", binjar_path, "-u", binurl] if ctx.attr.sha1: args.extend(["-v", ctx.attr.sha1]) - if ctx.attr.unsign: - args.append("--unsign") for x in ctx.attr.exclude: args.extend(["-x", x]) @@ -168,7 +166,6 @@ "repository": attr.string(default = MAVEN_CENTRAL), "sha1": attr.string(mandatory = False), "src_sha1": attr.string(), - "unsign": attr.bool(default = False), "exports": attr.string_list(), "deps": attr.string_list(), "_download_script": attr.label(default = Label("//tools:download_file.py")),