Skip to content

Commit

Permalink
Remove depencency on Java 11, fixes #8
Browse files Browse the repository at this point in the history
  • Loading branch information
marcohu committed Jan 17, 2020
1 parent 7e395a5 commit 3452604
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
1 change: 1 addition & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build --javacopt="--release 8"
19 changes: 14 additions & 5 deletions src/it/java/org/antlr/bazel/BUILD
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
load("@rules_java//java:defs.bzl", "java_library")
load("//tools:gen_test_rules.bzl", "java_tests")

filegroup(
java_library(
name = "support",
srcs = glob(
["*.java"],
exclude = ["*Test.java"],
),
javacopts = ["--release 11"],
deps = [
"//src/test/java/org/antlr/bazel:tests",
"@junit//jar",
],
)

java_library(
name = "antlr2_tests",
testonly = True,
srcs = glob(["Antlr2Test.java"]) + [":support"],
srcs = glob(["Antlr2Test.java"]),
data = [
"//:srcs",
"//antlr:srcs",
Expand All @@ -22,6 +27,7 @@ java_library(
"@examples//antlr2:srcs",
],
deps = [
":support",
"//src/main/java/org/antlr/bazel",
"//src/test/java/org/antlr/bazel:tests",
"@antlr2//jar",
Expand All @@ -41,7 +47,7 @@ java_tests(
java_library(
name = "antlr3_tests",
testonly = True,
srcs = glob(["Antlr3Test.java"]) + [":support"],
srcs = glob(["Antlr3Test.java"]),
data = [
"//:srcs",
"//antlr:srcs",
Expand All @@ -50,6 +56,7 @@ java_library(
"@examples//antlr3:srcs",
],
deps = [
":support",
"//src/main/java/org/antlr/bazel",
"//src/test/java/org/antlr/bazel:tests",
"@antlr3_runtime//jar",
Expand All @@ -71,7 +78,7 @@ java_tests(
java_library(
name = "antlr4_tests",
testonly = True,
srcs = glob(["Antlr4Test.java"]) + [":support"],
srcs = glob(["Antlr4Test.java"]),
data = [
"//:srcs",
"//antlr:srcs",
Expand All @@ -80,6 +87,7 @@ java_library(
"@examples//antlr4:srcs",
],
deps = [
":support",
"//src/main/java/org/antlr/bazel",
"//src/test/java/org/antlr/bazel:tests",
"@antlr3_runtime//jar",
Expand All @@ -103,7 +111,7 @@ java_tests(
java_library(
name = "repository_tests",
testonly = True,
srcs = glob(["RepositoriesTest.java"]) + [":support"],
srcs = glob(["RepositoriesTest.java"]),
data = [
"//:srcs",
"//antlr:srcs",
Expand All @@ -113,6 +121,7 @@ java_library(
"@examples//antlr2:srcs",
],
deps = [
":support",
"//src/main/java/org/antlr/bazel",
"//src/test/java/org/antlr/bazel:tests",
"@antlr2//jar",
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/antlr/bazel/AntlrRules.java
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ AntlrRules outputDirectory(String directory)
AntlrRules srcjar(String srcjar)
{
this.srcjar = sandbox.resolve(srcjar);
this.output = srcjar.isBlank() ? Output.FOLDER : Output.SRCJAR;
this.output = srcjar.trim().isEmpty() ? Output.FOLDER : Output.SRCJAR;

return this;
}
Expand Down

0 comments on commit 3452604

Please sign in to comment.