@@ -358,14 +358,13 @@ def _collect_jars(targets):
358
358
compile_jars = depset ()
359
359
runtime_jars = depset ()
360
360
for target in targets :
361
- if hasattr (target , "scala" ):
362
- compile_jars += target .scala .compile_jars
363
- runtime_jars += target .scala .transitive_runtime_jars
364
- elif java_common .provider in target :
361
+ if java_common .provider in target :
365
362
java_provider = target [java_common .provider ]
366
- # TODO(twigg): Use compile_jars when released (narrowly missed 0.5.0 :( )
367
- compile_jars += target .java .transitive_deps # java_provider.compile_jars
363
+ compile_jars += java_provider .compile_jars
368
364
runtime_jars += java_provider .transitive_runtime_jars
365
+ elif hasattr (target , "scala" ):
366
+ compile_jars += target .scala .compile_jars
367
+ runtime_jars += target .scala .transitive_runtime_jars
369
368
else :
370
369
# support http_file pointed at a jar. http_jar uses ijar,
371
370
# which breaks scala macros
@@ -432,10 +431,9 @@ def _lib(ctx, non_macro_lib):
432
431
compile_jars = next_cjars ,
433
432
transitive_runtime_jars = transitive_rjars ,
434
433
)
435
- # TODO(twigg): Linearization is concerning here.
436
434
java_provider = java_common .create_provider (
437
- compile_time_jars = scalaattr .compile_jars . to_list () ,
438
- runtime_jars = scalaattr .transitive_runtime_jars . to_list () ,
435
+ compile_time_jars = scalaattr .compile_jars ,
436
+ runtime_jars = scalaattr .transitive_runtime_jars ,
439
437
)
440
438
441
439
return struct (
@@ -803,20 +801,6 @@ def scala_repositories():
803
801
804
802
native .bind (name = "io_bazel_rules_scala/dependency/scalatest/scalatest" , actual = "@scalatest//jar" )
805
803
806
- # With providers changes, this is completely deprecatable once bazel release includes
807
- # fixes to java rules using JavaProvider
808
- def scala_export_to_java (name , exports , runtime_deps ):
809
- jars = []
810
- for target in exports :
811
- jars .append ("{}_deploy.jar" .format (target ))
812
-
813
- native .java_import (
814
- name = name ,
815
- # these are the outputs of the scala_library targets
816
- jars = jars ,
817
- runtime_deps = ["//external:io_bazel_rules_scala/dependency/scala/scala_library" ] + runtime_deps
818
- )
819
-
820
804
def _sanitize_string_for_usage (s ):
821
805
res_array = []
822
806
for c in s :
0 commit comments