Collect transitive sources ourselves to avoid sources from j2wasm_import.
Some annotations that are imported may depend on packages that are not emulated.
@@ -37,12 +37,15 @@ def _impl_j2wasm_library_rule(ctx):
return [J2wasmInfo(
_private_ = struct(
- transitive_srcs = java_provider.transitive_source_jars,
+ transitive_srcs = _get_transitive_sources(java_provider, all_deps),
transitive_classpath = _get_transitive_classpath(all_deps),
java_info = java_provider,
),
)]
+def _get_transitive_sources(java_provider, deps):
+ return depset(java_provider.source_jars, transitive = [d[J2wasmInfo]._private_.transitive_srcs for d in deps])
+
def _get_transitive_classpath(deps):
return depset(transitive = [d[J2wasmInfo]._private_.transitive_classpath for d in deps])
