@@ -358,13 +358,9 @@ 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
369
365
else :
370
366
# support http_file pointed at a jar. http_jar uses ijar,
@@ -432,10 +428,9 @@ def _lib(ctx, non_macro_lib):
432
428
compile_jars = next_cjars ,
433
429
transitive_runtime_jars = transitive_rjars ,
434
430
)
435
- # TODO(twigg): Linearization is concerning here.
436
431
java_provider = java_common .create_provider (
437
- compile_time_jars = scalaattr .compile_jars . to_list () ,
438
- runtime_jars = scalaattr .transitive_runtime_jars . to_list () ,
432
+ compile_time_jars = scalaattr .compile_jars ,
433
+ runtime_jars = scalaattr .transitive_runtime_jars ,
439
434
)
440
435
441
436
return struct (
@@ -802,20 +797,6 @@ def scala_repositories():
802
797
803
798
native .bind (name = "io_bazel_rules_scala/dependency/scalatest/scalatest" , actual = "@scalatest//jar" )
804
799
805
- # With providers changes, this is completely deprecatable once bazel release includes
806
- # fixes to java rules using JavaProvider
807
- def scala_export_to_java (name , exports , runtime_deps ):
808
- jars = []
809
- for target in exports :
810
- jars .append ("{}_deploy.jar" .format (target ))
811
-
812
- native .java_import (
813
- name = name ,
814
- # these are the outputs of the scala_library targets
815
- jars = jars ,
816
- runtime_deps = ["//external:io_bazel_rules_scala/dependency/scala/scala_library" ] + runtime_deps
817
- )
818
-
819
800
def _sanitize_string_for_usage (s ):
820
801
res_array = []
821
802
for c in s :
0 commit comments