aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Kristina Chodorow <kchodorow@google.com>2016-01-26 18:00:14 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2016-01-27 15:09:25 +0000
commit88821141d6812bbde64f0d49087533f87ca6f331 (patch)
tree79d343b613d67307c419dee5f6afdfa67b9b4eae /tools
parentf948e83629f677633e3f61fb49b2937de891b378 (diff)
Make local-jdk conform to workspace name rules
RELNOTES: JDK-related targets are now available via @local_jdk (instead of @local-jdk). -- MOS_MIGRATED_REVID=113067049
Diffstat (limited to 'tools')
-rw-r--r--tools/build_defs/groovy/groovy.bzl64
1 files changed, 36 insertions, 28 deletions
diff --git a/tools/build_defs/groovy/groovy.bzl b/tools/build_defs/groovy/groovy.bzl
index e085b4de3c..653ec748ff 100644
--- a/tools/build_defs/groovy/groovy.bzl
+++ b/tools/build_defs/groovy/groovy.bzl
@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-
def _groovy_jar_impl(ctx):
"""Creates a .jar file from Groovy sources. Users should rely on
groovy_library instead of using this rule directly.
@@ -30,7 +29,7 @@ def _groovy_jar_impl(ctx):
# Set up the output directory and set JAVA_HOME
cmd = "rm -rf %s\n" % build_output
cmd += "mkdir -p %s\n" % build_output
- cmd += "export JAVA_HOME=external/local-jdk\n"
+ cmd += "export JAVA_HOME=external/local_jdk\n"
# Set GROOVY_HOME by scanning through the groovy SDK to find the license file,
# which should be at the root of the SDK.
@@ -76,26 +75,31 @@ def _groovy_jar_impl(ctx):
)
_groovy_jar = rule(
- implementation = _groovy_jar_impl,
attrs = {
"srcs": attr.label_list(
- non_empty=True,
- allow_files=FileType([".groovy"])),
+ non_empty = True,
+ allow_files = FileType([".groovy"]),
+ ),
"deps": attr.label_list(
- mandatory=False,
- allow_files=FileType([".jar"])),
+ mandatory = False,
+ allow_files = FileType([".jar"]),
+ ),
"_groovysdk": attr.label(
- default=Label("//external:groovy-sdk")),
+ default = Label("//external:groovy-sdk"),
+ ),
"_jdk": attr.label(
- default=Label("//tools/defaults:jdk")),
+ default = Label("//tools/defaults:jdk"),
+ ),
"_zipper": attr.label(
- default=Label("//third_party/ijar:zipper"),
- executable=True,
- single_file=True),
+ default = Label("//third_party/ijar:zipper"),
+ executable = True,
+ single_file = True,
+ ),
},
outputs = {
"class_jar": "lib%{name}.jar",
},
+ implementation = _groovy_jar_impl,
)
def groovy_library(name, srcs=[], deps=[], **kwargs):
@@ -114,7 +118,6 @@ def groovy_library(name, srcs=[], deps=[], **kwargs):
**kwargs
)
-
def groovy_and_java_library(name, srcs=[], deps=[], **kwargs):
"""Accepts .groovy and .java srcs to create a groovy_library and a
java_library. The groovy_library will depend on the java_library, so the
@@ -212,21 +215,26 @@ def _groovy_test_impl(ctx):
)
_groovy_test = rule(
- implementation = _groovy_test_impl,
- attrs = {
- "srcs": attr.label_list(mandatory=True, allow_files=FileType([".groovy"])),
- "deps": attr.label_list(allow_files=FileType([".jar"])),
- "data": attr.label_list(allow_files=True),
- "jvm_flags": attr.string_list(),
- "_groovysdk": attr.label(
- default=Label("//external:groovy-sdk")),
- "_jdk": attr.label(
- default=Label("//tools/defaults:jdk")),
- "_implicit_deps": attr.label_list(default=[
- Label("//external:junit"),
- ]),
- },
- test = True,
+ attrs = {
+ "srcs": attr.label_list(
+ mandatory = True,
+ allow_files = FileType([".groovy"]),
+ ),
+ "deps": attr.label_list(allow_files = FileType([".jar"])),
+ "data": attr.label_list(allow_files = True),
+ "jvm_flags": attr.string_list(),
+ "_groovysdk": attr.label(
+ default = Label("//external:groovy-sdk"),
+ ),
+ "_jdk": attr.label(
+ default = Label("//tools/defaults:jdk"),
+ ),
+ "_implicit_deps": attr.label_list(default = [
+ Label("//external:junit"),
+ ]),
+ },
+ test = True,
+ implementation = _groovy_test_impl,
)
def groovy_test(