-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for selecting scala version #544
Changes from 32 commits
d27e73f
abae2b2
f670436
50deaf3
b9f1b22
2aa315c
27d3af0
0e5c5dd
72aba58
25132c9
d8edfb6
cf37e0f
5b2a053
2dc260f
94d0ab1
a47af87
52bdef1
a125428
dd28058
e6aff25
e600177
927e5f8
22f216f
87dad40
d45943d
990cb9d
57449bb
adeff15
2bd3825
e1846f5
5d67d4d
0dc4361
a66d27a
8b48a1e
1648bd4
e1e7cfb
b819162
b6c5806
ed646b4
bc36a86
ae407ac
f5e5ff6
5f26b2b
8a7b120
7b36b2d
dc9eb43
a72372c
260fd7f
829705d
8abd79f
2252748
b43be39
2db2ada
f0c262c
78cb80e
6c05916
50cbd54
e1b12ba
4774178
4661265
a834ba5
e518edc
16767e3
25db5f6
20ee544
c9dffbf
b131900
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,21 +29,21 @@ load("//scala:scala_cross_version.bzl", "scala_mvn_artifact") | |
# test adding a scala jar: | ||
maven_jar( | ||
name = "com_twitter__scalding_date", | ||
artifact = scala_mvn_artifact("com.twitter:scalding-date:0.17.0"), | ||
artifact = scala_mvn_artifact("com.twitter:scalding-date:0.17.0", "2.11"), | ||
sha1 = "420fb0c4f737a24b851c4316ee0362095710caa5", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like the shas need to become a map of scala version -> artifact -> sha. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My understanding is that these maven_jars are just for tests and as they always use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, we should refactor these into a bzl function |
||
) | ||
|
||
# For testing that we don't include sources jars to the classpath | ||
maven_jar( | ||
name = "org_typelevel__cats_core", | ||
artifact = scala_mvn_artifact("org.typelevel:cats-core:0.9.0"), | ||
artifact = scala_mvn_artifact("org.typelevel:cats-core:0.9.0", "2.11"), | ||
sha1 = "b2f8629c6ec834d8b6321288c9fe77823f1e1314", | ||
) | ||
|
||
# test of a plugin | ||
maven_jar( | ||
name = "org_psywerx_hairyfotr__linter", | ||
artifact = scala_mvn_artifact("org.psywerx.hairyfotr:linter:0.1.13"), | ||
artifact = scala_mvn_artifact("org.psywerx.hairyfotr:linter:0.1.13", "2.11"), | ||
sha1 = "e5b3e2753d0817b622c32aedcb888bcf39e275b4", | ||
) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,10 @@ | |
# limitations under the License. | ||
"""Rules for supporting the Scala language.""" | ||
load("@io_bazel_rules_scala//scala:scala_toolchain.bzl", "scala_toolchain") | ||
load("@io_bazel_rules_scala//scala:providers.bzl", "create_scala_provider") | ||
load( | ||
"@io_bazel_rules_scala//scala:providers.bzl", | ||
"create_scala_provider", | ||
_ScalacProvider = "ScalacProvider") | ||
load( | ||
":common.bzl", | ||
"add_labels_of_jars_to", | ||
|
@@ -240,18 +243,25 @@ StatsfileOutput: {statsfile_output} | |
ctx.actions.write( | ||
output = argfile, content = scalac_args + optional_scalac_args) | ||
|
||
scalac_provider = ctx.attr._scalac[_ScalacProvider] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @johnynek given your work trying to make There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I’d prefer a parameter right keep function cleaner. Eventually I’d like to not accept ctx and instead only actions. |
||
scalac_inputs, _, scalac_input_manifests = ctx.resolve_command( | ||
tools = [scalac_provider.scalac]) | ||
|
||
outs = [ctx.outputs.jar, ctx.outputs.statsfile] | ||
if buildijar: | ||
outs.extend([ctx.outputs.ijar]) | ||
ins = (compiler_classpath_jars.to_list() + dep_srcjars.to_list() + | ||
list(srcjars) + list(sources) + ctx.files.srcs + ctx.files.plugins + | ||
dependency_analyzer_plugin_jars + classpath_resources + | ||
ctx.files.resources + ctx.files.resource_jars + ctx.files._java_runtime | ||
+ [ctx.outputs.manifest, ctx.executable._ijar, argfile]) | ||
ins = ( | ||
compiler_classpath_jars.to_list() + dep_srcjars.to_list() + | ||
list(srcjars) + list(sources) + ctx.files.srcs + ctx.files.plugins + | ||
dependency_analyzer_plugin_jars + classpath_resources + | ||
ctx.files.resources + ctx.files.resource_jars + ctx.files._java_runtime + | ||
[ctx.outputs.manifest, ctx.executable._ijar, argfile] + scalac_inputs) | ||
|
||
ctx.actions.run( | ||
inputs = ins, | ||
outputs = outs, | ||
executable = ctx.executable._scalac, | ||
executable = scalac_provider.scalac.files_to_run.executable, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you take this from the tuple output ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn't work, command is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @laurentlb is this the expected behavior? Sounds strange we can get the inputs and manifests from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ping @laurentlb @c-parsons |
||
input_manifests = scalac_input_manifests, | ||
mnemonic = "Scalac", | ||
progress_message = "scala %s" % ctx.label, | ||
execution_requirements = {"supports-workers": "1"}, | ||
|
@@ -486,7 +496,8 @@ def _collect_jars_from_common_ctx(ctx, extra_deps = [], | |
dependency_analyzer_is_off = is_dependency_analyzer_off(ctx) | ||
|
||
# Get jars from deps | ||
auto_deps = [ctx.attr._scalalib, ctx.attr._scalareflect] | ||
scalac_provider = ctx.attr._scalac[_ScalacProvider] | ||
auto_deps = [scalac_provider.scalalib, scalac_provider.scalareflect] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could directly be given in the toolchain/provider. |
||
deps_jars = collect_jars(ctx.attr.deps + auto_deps + extra_deps, | ||
dependency_analyzer_is_off) | ||
(cjars, transitive_rjars, jars2labels, | ||
|
@@ -641,7 +652,8 @@ def scala_binary_impl(ctx): | |
def scala_repl_impl(ctx): | ||
# need scala-compiler for MainGenericRunner below | ||
jars = _collect_jars_from_common_ctx( | ||
ctx, extra_runtime_deps = [ctx.attr._scalacompiler]) | ||
ctx, | ||
extra_runtime_deps = [ctx.attr._scalac[_ScalacProvider].scalacompiler]) | ||
(cjars, transitive_rjars) = (jars.compile_jars, jars.transitive_runtime_jars) | ||
|
||
args = " ".join(ctx.attr.scalacopts) | ||
|
@@ -689,6 +701,7 @@ def _scala_test_flags(ctx): | |
def scala_test_impl(ctx): | ||
if len(ctx.attr.suites) != 0: | ||
print("suites attribute is deprecated. All scalatest test suites are run") | ||
|
||
jars = _collect_jars_from_common_ctx( | ||
ctx, | ||
extra_runtime_deps = [ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,36 @@ def create_scala_provider(ijar, class_jar, compile_jars, | |
transitive_runtime_jars = transitive_runtime_jars, | ||
transitive_exports = [] #needed by intellij plugin | ||
) | ||
|
||
ScalacProvider = provider( | ||
doc = "ScalaProvider", | ||
fields = [ | ||
"scalac", | ||
"scalalib", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should consider instead There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In Would the idea be to have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think attr.label_list is convenient. |
||
"scalareflect", | ||
"scalacompiler", | ||
]) | ||
|
||
def _declare_scalac_provider(ctx): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is an interesting approach. |
||
return [ | ||
ScalacProvider( | ||
scalac = ctx.attr.scalac, | ||
scalalib = ctx.attr.scalalib, | ||
scalareflect = ctx.attr.scalareflect, | ||
scalacompiler = ctx.attr.scalacompiler, | ||
) | ||
] | ||
|
||
declare_scalac_provider = rule( | ||
implementation = _declare_scalac_provider, | ||
attrs = { | ||
"scalac": attr.label( | ||
executable = True, | ||
cfg = "host", | ||
allow_files = True, | ||
mandatory = True), | ||
"scalalib": attr.label(mandatory = True, allow_files = True), | ||
"scalareflect": attr.label(mandatory = True, allow_files = True), | ||
"scalacompiler": attr.label(mandatory = True, allow_files = True), | ||
"scalaxml": attr.label(mandatory = True, allow_files = True) | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,17 @@ load( | |
_scala_junit_test_impl = "scala_junit_test_impl", | ||
) | ||
|
||
load( | ||
"@io_bazel_rules_scala//scala:providers.bzl", | ||
_ScalacProvider = "ScalacProvider", | ||
) | ||
|
||
load( | ||
"@io_bazel_rules_scala//scala:scala_cross_version.bzl", | ||
_new_scala_repository = "new_scala_repository", | ||
_extract_major_version_underscore = "extract_major_version_underscore", | ||
_default_scala_version = "default_scala_version") | ||
|
||
load( | ||
"@io_bazel_rules_scala//specs2:specs2_junit.bzl", | ||
_specs2_junit_dependencies = "specs2_junit_dependencies") | ||
|
@@ -28,23 +39,6 @@ _implicit_deps = { | |
cfg = "host", | ||
default = Label("@bazel_tools//tools/jdk:ijar"), | ||
allow_files = True), | ||
"_scalac": attr.label( | ||
executable = True, | ||
cfg = "host", | ||
default = Label("//src/java/io/bazel/rulesscala/scalac"), | ||
allow_files = True), | ||
"_scalalib": attr.label( | ||
default = Label( | ||
"//external:io_bazel_rules_scala/dependency/scala/scala_library"), | ||
allow_files = True), | ||
"_scalacompiler": attr.label( | ||
default = Label( | ||
"//external:io_bazel_rules_scala/dependency/scala/scala_compiler"), | ||
allow_files = True), | ||
"_scalareflect": attr.label( | ||
default = Label( | ||
"//external:io_bazel_rules_scala/dependency/scala/scala_reflect"), | ||
allow_files = True), | ||
"_zipper": attr.label( | ||
executable = True, | ||
cfg = "host", | ||
|
@@ -56,7 +50,9 @@ _implicit_deps = { | |
default = Label("@bazel_tools//tools/jdk:current_java_runtime"), | ||
cfg = "host"), | ||
"_java_runtime": attr.label( | ||
default = Label("@bazel_tools//tools/jdk:current_java_runtime")) | ||
default = Label("@bazel_tools//tools/jdk:current_java_runtime")), | ||
"_scalac": attr.label( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Also, if we make this public, e.g. use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Currently there's no point in making it public as we can only have one version of I'll change the name to |
||
default = Label("@scala_default"), providers = [_ScalacProvider]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I’d like to namespace this io_bazel_rules_scala... |
||
} | ||
|
||
# Single dep to allow IDEs to pickup all the implicit dependencies. | ||
|
@@ -219,12 +215,11 @@ _scala_test_attrs = { | |
"full_stacktraces": attr.bool(default = True), | ||
"_scalatest": attr.label( | ||
default = Label( | ||
"//external:io_bazel_rules_scala/dependency/scalatest/scalatest"), | ||
allow_files = True), | ||
"//external:io_bazel_rules_scala/dependency/scalatest/scalatest")), | ||
"_scalatest_runner": attr.label( | ||
executable = True, | ||
cfg = "host", | ||
default = Label("//src/java/io/bazel/rulesscala/scala_test:runner.jar"), | ||
executable = True, | ||
allow_files = True), | ||
"_scalatest_reporter": attr.label( | ||
default = Label("//scala/support:test_reporter")), | ||
|
@@ -257,56 +252,60 @@ scala_repl = rule( | |
toolchains = ['@io_bazel_rules_scala//scala:toolchain_type'], | ||
) | ||
|
||
_SCALA_BUILD_FILE = """ | ||
# scala.BUILD | ||
java_import( | ||
name = "scala-xml", | ||
jars = ["lib/scala-xml_2.11-1.0.5.jar"], | ||
visibility = ["//visibility:public"], | ||
) | ||
def scala_repositories(scala_version = _default_scala_version()): | ||
major_version_underscore = _extract_major_version_underscore(scala_version) | ||
|
||
java_import( | ||
name = "scala-parser-combinators", | ||
jars = ["lib/scala-parser-combinators_2.11-1.0.4.jar"], | ||
visibility = ["//visibility:public"], | ||
) | ||
_new_scala_repository("scala_default", scala_version) | ||
|
||
java_import( | ||
name = "scala-library", | ||
jars = ["lib/scala-library.jar"], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
java_import( | ||
name = "scala-compiler", | ||
jars = ["lib/scala-compiler.jar"], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
java_import( | ||
name = "scala-reflect", | ||
jars = ["lib/scala-reflect.jar"], | ||
visibility = ["//visibility:public"], | ||
) | ||
""" | ||
|
||
def scala_repositories(): | ||
native.new_http_archive( | ||
name = "scala", | ||
strip_prefix = "scala-2.11.11", | ||
sha256 = | ||
"12037ca64c68468e717e950f47fc77d5ceae5e74e3bdca56f6d02fd5bfd6900b", | ||
url = "https://downloads.lightbend.com/scala/2.11.11/scala-2.11.11.tgz", | ||
build_file_content = _SCALA_BUILD_FILE, | ||
# scalatest has macros, note http_jar is invoking ijar | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @johnynek should I open an issue about changing these http_jar to use |
||
native.http_jar( | ||
name = "scalatest_2_11", | ||
url = | ||
"http://central.maven.org/maven2/org/scalatest/scalatest_2.11/3.0.5/scalatest_2.11-3.0.5.jar", | ||
sha256 = "2aafeb41257912cbba95f9d747df9ecdc7ff43f039d35014b4c2a8eb7ed9ba2f" | ||
) | ||
native.http_jar( | ||
name = "scalactic_2_11", | ||
url = | ||
"http://central.maven.org/maven2/org/scalactic/scalactic_2.11/3.0.5/scalactic_2.11-3.0.5.jar", | ||
sha256 = "84723064f5716f38990fe6e65468aa39700c725484efceef015771d267341cf2" | ||
) | ||
|
||
# scalatest has macros, note http_jar is invoking ijar | ||
native.http_jar( | ||
name = "scalatest", | ||
name = "scalatest_2_12", | ||
url = | ||
"https://mirror.bazel.build/oss.sonatype.org/content/groups/public/org/scalatest/scalatest_2.11/2.2.6/scalatest_2.11-2.2.6.jar", | ||
sha256 = | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's make sure we find a solution to lock these back down with shas. Maybe a dict for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another possible motivation for the dict is that if someone wants to use 2.13 they can't because the versions (2.11/2.12) are hardcoded here, right? Am I missing something? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this case it's possible to just add the shas, just haven't done that. As we only need one scalatest version for 2.11 and one for 2.12 we can hardcode it, could ofc also be done programmatically with something like that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Didn't actually think about 2.13. Makes sense to use a dict, to make it easier to add versions / allow the user to add a version without requiring changes in rules_scala |
||
"f198967436a5e7a69cfd182902adcfbcb9f2e41b349e1a5c8881a2407f615962", | ||
"http://central.maven.org/maven2/org/scalatest/scalatest_2.12/3.0.5/scalatest_2.12-3.0.5.jar", | ||
sha256 = "b416b5bcef6720da469a8d8a5726e457fc2d1cd5d316e1bc283aa75a2ae005e5" | ||
) | ||
native.http_jar( | ||
name = "scalactic_2_12", | ||
url = | ||
"http://central.maven.org/maven2/org/scalactic/scalactic_2.12/3.0.5/scalactic_2.12-3.0.5.jar", | ||
sha256 = "57e25b4fd969b1758fe042595112c874dfea99dca5cc48eebe07ac38772a0c41" | ||
) | ||
native.http_jar( | ||
name = "scala_xml_2_11", | ||
url = | ||
"http://central.maven.org/maven2/org/scala-lang/modules/scala-xml_2.11/1.0.5/scala-xml_2.11-1.0.5.jar", | ||
sha256 = "767e11f33eddcd506980f0ff213f9d553a6a21802e3be1330345f62f7ee3d50f" | ||
) | ||
native.http_jar( | ||
name = "scala_xml_2_12", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this changes using the sdk single jar approach to using individual jars. It's not a bad change, but maybe we should make that in the mainline and keep it separate from this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can make a pr for that 👍 The reasoning for the change was mainly that I wasn't sure whether the versions for the xml + parser-combinators jars found in |
||
url = | ||
"http://central.maven.org/maven2/org/scala-lang/modules/scala-xml_2.12/1.0.5/scala-xml_2.12-1.0.5.jar", | ||
sha256 = "035015366f54f403d076d95f4529ce9eeaf544064dbc17c2d10e4f5908ef4256" | ||
) | ||
native.http_jar( | ||
name = "scala_parser_combinators_2_11", | ||
url = | ||
"http://central.maven.org/maven2/org/scala-lang/modules/scala-parser-combinators_2.11/1.0.4/scala-parser-combinators_2.11-1.0.4.jar", | ||
sha256 = "0dfaafce29a9a245b0a9180ec2c1073d2bd8f0330f03a9f1f6a74d1bc83f62d6" | ||
) | ||
native.http_jar( | ||
name = "scala_parser_combinators_2_12", | ||
url = | ||
"http://central.maven.org/maven2/org/scala-lang/modules/scala-parser-combinators_2.12/1.0.4/scala-parser-combinators_2.12-1.0.4.jar", | ||
sha256 = "282c78d064d3e8f09b3663190d9494b85e0bb7d96b0da05994fe994384d96111" | ||
) | ||
|
||
native.maven_server( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if we don't use maven_jar then we don't need maven_server anymore There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That
Could remove it if we're happy just using maven central instead of the bazel mirror There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let’s keep it. Maybe we should drop the maven jar entirely but that’s a different story There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let’s keep it. Maybe we should drop the maven jar entirely but that’s a different story |
||
|
@@ -356,28 +355,37 @@ def scala_repositories(): | |
actual = "@scalac_rules_commons_io//jar") | ||
|
||
native.bind( | ||
name = "io_bazel_rules_scala/dependency/scala/parser_combinators", | ||
actual = "@scala//:scala-parser-combinators") | ||
name = "io_bazel_rules_scala/dependency/scalatest/scalatest_library", | ||
actual = "@scalatest_{}//jar".format(major_version_underscore)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we want a utility for this? something like scala_external("scalatest", provider) => "@$repo_name_$ver//jar".format(...) Maybe not, not sure There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this way of selecting the dependencies sound reasonable to you I can definitely add some kind of utility to make it simpler There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To me this sounds reasonable. what do you think? ;) @johnynek wdyt? |
||
|
||
native.bind( | ||
name = "io_bazel_rules_scala/dependency/scala/scala_compiler", | ||
actual = "@scala//:scala-compiler") | ||
name = "io_bazel_rules_scala/dependency/scalactic/scalactic", | ||
actual = "@scalactic_{}//jar".format(major_version_underscore)) | ||
|
||
native.bind( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you only need this bind. Why do you need to bind scalactic and scalatest_library as well? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
name = "io_bazel_rules_scala/dependency/scala/scala_library", | ||
actual = "@scala//:scala-library") | ||
name = "io_bazel_rules_scala/dependency/scalatest/scalatest", | ||
actual = "@io_bazel_rules_scala//scala/scalatest:scalatest") | ||
|
||
native.bind( | ||
name = "io_bazel_rules_scala/dependency/scala/scala_reflect", | ||
actual = "@scala//:scala-reflect") | ||
name = "io_bazel_rules_scala/dependency/scala/scala_xml", | ||
actual = "@scala_xml_{}//jar".format(major_version_underscore)) | ||
|
||
native.bind( | ||
name = "io_bazel_rules_scala/dependency/scala/scala_xml", | ||
actual = "@scala//:scala-xml") | ||
name = "io_bazel_rules_scala/dependency/scala/parser_combinators", | ||
actual = "@scala_parser_combinators_{}//jar".format( | ||
major_version_underscore)) | ||
|
||
native.bind( | ||
name = "io_bazel_rules_scala/dependency/scalatest/scalatest", | ||
actual = "@scalatest//jar") | ||
name = "io_bazel_rules_scala/dependency/scala/scala_compiler", | ||
actual = "@scala_default_imports//:scala-compiler") | ||
|
||
native.bind( | ||
name = "io_bazel_rules_scala/dependency/scala/scala_library", | ||
actual = "@scala_default_imports//:scala-library") | ||
|
||
native.bind( | ||
name = "io_bazel_rules_scala/dependency/scala/scala_reflect", | ||
actual = "@scala_default_imports//:scala-reflect") | ||
|
||
def _sanitize_string_for_usage(s): | ||
res_array = [] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thought (which can be deferred to later PR):
WDYT about:
artifact = scala_mvn_artifact("com.twitter:scalding-date:0.17.0", default_scala_major_version),
where
default_scala_major_version
is defined asextract_major_version_underscore(default_scala_version())
Will ease changing the default version for rules_scala when we'll need it