Skip to content

Commit

Permalink
Remove jvm_flags debug print for scala_library (#840)
Browse files Browse the repository at this point in the history
* remove jvm_flags debug print for scala_library

* hard fail for jvm_flags in scala_library, re-add jvm_flags attr for other rules

* remove fail, not needed if attr isn't supported
  • Loading branch information
long-stripe authored and johnynek committed Sep 3, 2019
1 parent 3edf15d commit f1e689c
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 12 deletions.
1 change: 0 additions & 1 deletion scala/private/common_attributes.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ common_attrs_for_plugin_bootstrapping = {
"resource_jars": attr.label_list(allow_files = True),
"scalacopts": attr.string_list(),
"javacopts": attr.string_list(),
"jvm_flags": attr.string_list(),
"scalac_jvm_flags": attr.string_list(),
"javac_jvm_flags": attr.string_list(),
"expect_java_output": attr.bool(
Expand Down
1 change: 1 addition & 0 deletions scala/private/rules/scala_binary.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def _scala_binary_impl(ctx):
_scala_binary_attrs = {
"main_class": attr.string(mandatory = True),
"classpath_resources": attr.label_list(allow_files = True),
"jvm_flags": attr.string_list(),
}

_scala_binary_attrs.update(launcher_template)
Expand Down
1 change: 1 addition & 0 deletions scala/private/rules/scala_junit_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ _scala_junit_test_attrs = {
default = False,
mandatory = False,
),
"jvm_flags": attr.string_list(),
"_junit": attr.label(
default = Label(
"//external:io_bazel_rules_scala/dependency/junit/junit",
Expand Down
2 changes: 0 additions & 2 deletions scala/private/rules/scala_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ def _lib(
##

def _scala_library_impl(ctx):
if ctx.attr.jvm_flags:
print("'jvm_flags' for scala_library is deprecated. It does nothing today and will be removed from scala_library to avoid confusion.")
scalac_provider = get_scalac_provider(ctx)
unused_dependency_checker_mode = get_unused_dependency_checker_mode(ctx)
return _lib(
Expand Down
4 changes: 3 additions & 1 deletion scala/private/rules/scala_repl.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ trap finish EXIT

return out

_scala_repl_attrs = {}
_scala_repl_attrs = {
"jvm_flags": attr.string_list(),
}

_scala_repl_attrs.update(launcher_template)

Expand Down
1 change: 1 addition & 0 deletions scala/private/rules/scala_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ _scala_test_attrs = {
),
"colors": attr.bool(default = True),
"full_stacktraces": attr.bool(default = True),
"jvm_flags": attr.string_list(),
"_scalatest": attr.label(
default = Label(
"//external:io_bazel_rules_scala/dependency/scalatest/scalatest",
Expand Down
8 changes: 0 additions & 8 deletions test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,6 @@ scala_library(
srcs = glob(["src/main/scala/scalarules/test/mix_java_scala/*.scala"]) + glob([
"src/main/scala/scalarules/test/mix_java_scala/*.java",
]),
jvm_flags = [
"-Xms1G",
"-Xmx4G",
],
)

genrule(
Expand Down Expand Up @@ -323,10 +319,6 @@ scala_library(
# srcjar created with `jar -cfM Baz.srcjar Baz.java`
"src/main/scala/scalarules/test/mix_java_scala/*.srcjar",
]),
jvm_flags = [
"-Xms1G",
"-Xmx4G",
],
)

#needed to test java sources are compiled
Expand Down

0 comments on commit f1e689c

Please sign in to comment.