-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't rely on global
SCALA_VERSION
in BUILD files, use select inste…
…ad (#1564)
- Loading branch information
Showing
7 changed files
with
112 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 6 additions & 8 deletions
14
src/java/io/bazel/rulesscala/scalac/deps_tracking_reporter/BUILD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
load("@io_bazel_rules_scala_config//:config.bzl", "SCALA_MAJOR_VERSION", "SCALA_MINOR_VERSION") | ||
load("//scala:scala_cross_version_select.bzl", "select_for_scala_version") | ||
|
||
filegroup( | ||
name = "deps_tracking_reporter", | ||
srcs = [ | ||
"before_2_12_13/DepsTrackingReporter.java", | ||
] if (SCALA_MAJOR_VERSION == "2.11") or ((SCALA_MAJOR_VERSION == "2.12") and int(SCALA_MINOR_VERSION) < 13) else [ | ||
"after_2_12_13_and_before_2_13_12/DepsTrackingReporter.java", | ||
] if ((SCALA_MAJOR_VERSION == "2.12") and int(SCALA_MINOR_VERSION) >= 13) or ((SCALA_MAJOR_VERSION == "2.13") and int(SCALA_MINOR_VERSION) < 12) else [ | ||
"after_2_13_12/DepsTrackingReporter.java", | ||
], | ||
srcs = select_for_scala_version( | ||
before_2_12_13 = ["before_2_12_13/DepsTrackingReporter.java"], | ||
between_2_12_13_and_2_13_12 = ["after_2_12_13_and_before_2_13_12/DepsTrackingReporter.java"], | ||
since_2_13_12 = ["after_2_13_12/DepsTrackingReporter.java"], | ||
), | ||
visibility = ["//visibility:public"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,51 @@ | ||
load(":analyzer.bzl", "analyzer") | ||
load("//scala:scala.bzl", "scala_library_for_plugin_bootstrapping") | ||
load("//scala:scala_cross_version_select.bzl", "select_for_scala_version") | ||
|
||
analyzer() | ||
scala_library_for_plugin_bootstrapping( | ||
name = "dependency_analyzer", | ||
srcs = select_for_scala_version( | ||
any_2 = [ | ||
"io/bazel/rulesscala/dependencyanalyzer/AstUsedJarFinder.scala", | ||
"io/bazel/rulesscala/dependencyanalyzer/DependencyAnalyzer.scala", | ||
"io/bazel/rulesscala/dependencyanalyzer/DependencyAnalyzerSettings.scala", | ||
"io/bazel/rulesscala/dependencyanalyzer/HighLevelCrawlUsedJarFinder.scala", | ||
"io/bazel/rulesscala/dependencyanalyzer/OptionsParser.scala", | ||
], | ||
before_2_12_13 = [ | ||
"io/bazel/rulesscala/dependencyanalyzer/Reporter.scala", | ||
], | ||
between_2_12_13_and_3 = [ | ||
"io/bazel/rulesscala/dependencyanalyzer/Reporter213.scala", | ||
], | ||
since_3 = [ | ||
"io/bazel/rulesscala/dependencyanalyzer3/DependencyAnalyzer.scala", | ||
], | ||
), | ||
resources = select_for_scala_version( | ||
any_2 = ["resources/scalac-plugin.xml"], | ||
any_3 = ["resources/plugin.properties"], | ||
), | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"//scala/private/toolchain_deps:scala_compile_classpath", | ||
] + select_for_scala_version( | ||
any_2 = [ | ||
":scala_version", | ||
"//src/java/io/bazel/rulesscala/scalac/reporter", | ||
], | ||
), | ||
) | ||
|
||
scala_library_for_plugin_bootstrapping( | ||
name = "scala_version", | ||
srcs = [ | ||
"io/bazel/rulesscala/dependencyanalyzer/ScalaVersion.scala", | ||
], | ||
# As this contains macros we shouldn't make an ijar | ||
build_ijar = False, | ||
resources = ["resources/scalac-plugin.xml"], | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"//scala/private/toolchain_deps:scala_compile_classpath", | ||
], | ||
) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters