From 274c3f4dd98aad2d4c233830f83f77f6e4d5954f Mon Sep 17 00:00:00 2001 From: ilist Date: Tue, 13 Apr 2021 01:10:19 -0700 Subject: [PATCH] Propagate JavaInfo.compile_jdeps argument to JavaCompilationArgsProvider. JavaInfo.compile_jdeps parameter is a substitution for java_common.add_compile_time_jdeps. The latter is going to be removed from the Bazel, so the tests are updated to use the new APIs. Problem with propagation is fixed. Design doc: https://docs.google.com/document/d/10isTEK5W9iCPp4BIyGBrLY5iti3Waaam6EeGVSjq3r8/edit#bookmark=id.vta5s12rfsxt PiperOrigin-RevId: 368167400 --- .../devtools/build/lib/rules/java/JavaInfoBuildHelper.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaInfoBuildHelper.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaInfoBuildHelper.java index 43a92cc0766ccd..a258f5eaa50371 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaInfoBuildHelper.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaInfoBuildHelper.java @@ -96,6 +96,10 @@ JavaInfo createJavaInfo( javaCompilationArgsBuilder.addDirectCompileTimeJar( /* interfaceJar= */ javaOutput.getCompileJar(), /* fullJar= */ javaOutput.getClassJar()); } + if (javaOutput.getCompileJdeps() != null) { + javaCompilationArgsBuilder.addCompileTimeJavaDependencyArtifacts( + NestedSetBuilder.create(Order.STABLE_ORDER, javaOutput.getCompileJdeps())); + } JavaRuleOutputJarsProvider javaRuleOutputJarsProvider = JavaRuleOutputJarsProvider.builder().addJavaOutput(javaOutput).build();