Skip to content

Commit

Permalink
Remove implicit_deps from twitter_scrooge
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Coveney committed Apr 27, 2016
1 parent c0d3d02 commit 9b7dc21
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
31 changes: 15 additions & 16 deletions scala/scala.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -325,18 +325,17 @@ def _scala_test_impl(ctx):
_write_test_launcher(ctx, rjars)
return _scala_binary_common(ctx, cjars, rjars)

def implicit_deps():
return {
"_ijar": attr.label(executable=True, default=Label("@bazel_tools//tools/jdk:ijar"), single_file=True, allow_files=True),
"_scalac": attr.label(executable=True, default=Label("@scala//:bin/scalac"), single_file=True, allow_files=True),
"_scalalib": attr.label(default=Label("@scala//:lib/scala-library.jar"), single_file=True, allow_files=True),
"_scalaxml": attr.label(default=Label("@scala//:lib/scala-xml_2.11-1.0.4.jar"), single_file=True, allow_files=True),
"_scalasdk": attr.label(default=Label("@scala//:sdk"), allow_files=True),
"_scalareflect": attr.label(default=Label("@scala//:lib/scala-reflect.jar"), single_file=True, allow_files=True),
"_java": attr.label(executable=True, default=Label("@bazel_tools//tools/jdk:java"), single_file=True, allow_files=True),
"_jar": attr.label(executable=True, default=Label("@bazel_tools//tools/jdk:jar"), single_file=True, allow_files=True),
"_jdk": attr.label(default=Label("//tools/defaults:jdk"), allow_files=True),
}
_implicit_deps = {
"_ijar": attr.label(executable=True, default=Label("@bazel_tools//tools/jdk:ijar"), single_file=True, allow_files=True),
"_scalac": attr.label(executable=True, default=Label("@scala//:bin/scalac"), single_file=True, allow_files=True),
"_scalalib": attr.label(default=Label("@scala//:lib/scala-library.jar"), single_file=True, allow_files=True),
"_scalaxml": attr.label(default=Label("@scala//:lib/scala-xml_2.11-1.0.4.jar"), single_file=True, allow_files=True),
"_scalasdk": attr.label(default=Label("@scala//:sdk"), allow_files=True),
"_scalareflect": attr.label(default=Label("@scala//:lib/scala-reflect.jar"), single_file=True, allow_files=True),
"_java": attr.label(executable=True, default=Label("@bazel_tools//tools/jdk:java"), single_file=True, allow_files=True),
"_jar": attr.label(executable=True, default=Label("@bazel_tools//tools/jdk:jar"), single_file=True, allow_files=True),
"_jdk": attr.label(default=Label("//tools/defaults:jdk"), allow_files=True),
}

# Common attributes reused across multiple rules.
_common_attrs = {
Expand All @@ -355,7 +354,7 @@ scala_library = rule(
attrs={
"main_class": attr.string(),
"exports": attr.label_list(allow_files=False),
} + implicit_deps() + _common_attrs,
} + _implicit_deps + _common_attrs,
outputs={
"jar": "%{name}_deploy.jar",
"ijar": "%{name}_ijar.jar",
Expand All @@ -368,7 +367,7 @@ scala_macro_library = rule(
attrs={
"main_class": attr.string(),
"exports": attr.label_list(allow_files=False),
} + implicit_deps() + _common_attrs,
} + _implicit_deps + _common_attrs,
outputs={
"jar": "%{name}_deploy.jar",
"manifest": "%{name}_MANIFEST.MF",
Expand All @@ -379,7 +378,7 @@ scala_binary = rule(
implementation=_scala_binary_impl,
attrs={
"main_class": attr.string(mandatory=True),
} + implicit_deps() + _common_attrs,
} + _implicit_deps + _common_attrs,
outputs={
"jar": "%{name}_deploy.jar",
"manifest": "%{name}_MANIFEST.MF",
Expand All @@ -394,7 +393,7 @@ scala_test = rule(
"suites": attr.string_list(),
"_scalatest": attr.label(executable=True, default=Label("@scalatest//file"), single_file=True, allow_files=True),
"_scalatest_reporter": attr.label(default=Label("//scala/support:test_reporter")),
} + implicit_deps() + _common_attrs,
} + _implicit_deps + _common_attrs,
outputs={
"jar": "%{name}_deploy.jar",
"manifest": "%{name}_MANIFEST.MF",
Expand Down
3 changes: 1 addition & 2 deletions twitter_scrooge/twitter_scrooge.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ load("//scala:scala.bzl",
"scala_mvn_artifact",
"scala_library",
"write_manifest",
"implicit_deps",
"collect_srcjars")

def twitter_scrooge():
Expand Down Expand Up @@ -195,7 +194,7 @@ scrooge_scala_srcjar = rule(
executable=True,
default=Label("//src/scala/scripts:generator"),
allow_files=True),
} + implicit_deps(),
},
outputs={
"srcjar": "lib%{name}.srcjar",
},
Expand Down

0 comments on commit 9b7dc21

Please sign in to comment.