Skip to content

Commit

Permalink
add scala stdlib to java compile classpath, relates to #526
Browse files Browse the repository at this point in the history
  • Loading branch information
ittaiz committed Jul 14, 2018
1 parent ea4b294 commit 263284b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scala/private/rule_impls.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,8 @@ 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
9 changes: 9 additions & 0 deletions test/JavaUsesScalaStdLib.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
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 263284b

Please sign in to comment.