Skip to content

Commit

Permalink
add scala stdlib to java compile classpath, relates to #526 (#558)
Browse files Browse the repository at this point in the history
* add scala stdlib to java compile classpath, relates to #526

* linting
  • Loading branch information
ittaiz authored and johnynek committed Jul 16, 2018
1 parent ea4b294 commit 329543d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions scala/private/rule_impls.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ def try_to_compile_java_jar(ctx, scala_output, all_srcjars, java_srcs,
providers_of_dependencies = collect_java_providers_of(ctx.attr.deps)
providers_of_dependencies += collect_java_providers_of(
implicit_junit_deps_needed_for_java_compilation)
providers_of_dependencies += collect_java_providers_of([ctx.attr._scalalib])
scala_sources_java_provider = _interim_java_provider_for_java_compilation(
scala_output)
providers_of_dependencies += [scala_sources_java_provider]
Expand Down
5 changes: 5 additions & 0 deletions test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,11 @@ scalapb_proto_library(
],
)

scala_library(
name = "java_uses_scala_std_lib",
srcs = ["JavaUsesScalaStdLib.java"],
)

load(":check_statsfile.bzl", "check_statsfile")

check_statsfile("ScalaBinary")
Expand Down
8 changes: 8 additions & 0 deletions test/JavaUsesScalaStdLib.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package scalarules.test;

public class JavaUsesScalaStdLib {

public static <A, B> scala.collection.immutable.Map<A, B> scalaMap(java.util.Map<A, B> javaMap) {
return null;
}
}

0 comments on commit 329543d

Please sign in to comment.