From ba4435cc81baee8621b75337b33986cc4fa13731 Mon Sep 17 00:00:00 2001 From: ilist Date: Tue, 11 May 2021 22:38:48 -0700 Subject: [PATCH] Accept JavaPluginInfo as plugins and exported_plugins parameter of java_common.compile and add exported_plugins parameter to JavaInfo constructor java_common.compile now accepts either a list of JavaInfo or a list of JavaPluginInfo. A flag --incompatible_require_javaplugininfo_in_javacommon is added that disables supports for lists of JavaInfo, and at the same time also stops returning it from java_plugin rule. JavaInfo constructor was missing exported_plugins parameter and it is added for consistency. Because it's new there is no support for a list of JavaInfo. PiperOrigin-RevId: 373301285 --- .../lib/rules/java/JavaConfiguration.java | 6 +++ .../build/lib/rules/java/JavaInfo.java | 3 +- .../lib/rules/java/JavaInfoBuildHelper.java | 25 ++++++---- .../build/lib/rules/java/JavaLibrary.java | 5 +- .../build/lib/rules/java/JavaOptions.java | 13 +++++ .../lib/rules/java/JavaStarlarkCommon.java | 44 ++++++++++++++-- .../starlarkbuildapi/java/JavaCommonApi.java | 10 +++- .../starlarkbuildapi/java/JavaInfoApi.java | 9 ++++ .../rules/java/JavaInfoStarlarkApiTest.java | 35 +++++++++---- .../lib/rules/java/JavaStarlarkApiTest.java | 50 ++++++++++++++++++- 10 files changed, 172 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaConfiguration.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaConfiguration.java index 2f8a9b1d1f252e..5010ee0fe4caca 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaConfiguration.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaConfiguration.java @@ -107,6 +107,7 @@ public enum ImportDepsCheckingLevel { private final boolean experimentalTurbineAnnotationProcessing; private final boolean experimentalEnableJspecify; private final boolean dontCollectDataLibraries; + private final boolean requireJavaPluginInfo; // TODO(dmarting): remove once we have a proper solution for #2539 private final boolean useLegacyBazelJavaTest; @@ -145,6 +146,7 @@ public JavaConfiguration(BuildOptions buildOptions) throws InvalidConfigurationE this.runAndroidLint = javaOptions.runAndroidLint; this.limitAndroidLintToAndroidCompatible = javaOptions.limitAndroidLintToAndroidCompatible; this.dontCollectDataLibraries = javaOptions.dontCollectDataLibraries; + this.requireJavaPluginInfo = javaOptions.requireJavaPluginInfo; Map optimizers = javaOptions.bytecodeOptimizers; if (optimizers.size() > 1) { @@ -399,4 +401,8 @@ public boolean experimentalEnableJspecify() { public boolean dontCollectDataLibraries() { return dontCollectDataLibraries; } + + public boolean requireJavaPluginInfo() { + return requireJavaPluginInfo; + } } diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaInfo.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaInfo.java index ac3f2a79e89aac..697a0ccd30a6b1 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaInfo.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaInfo.java @@ -486,6 +486,7 @@ public JavaInfo javaInfo( Sequence deps, Sequence runtimeDeps, Sequence exports, + Sequence exportedPlugins, Object jdepsApi, Sequence nativeLibraries, StarlarkThread thread) @@ -499,7 +500,6 @@ public JavaInfo javaInfo( @Nullable Artifact nativeHeadersJar = nullIfNone(nativeHeadersJarApi, Artifact.class); @Nullable Artifact manifestProto = nullIfNone(manifestProtoApi, Artifact.class); @Nullable Artifact jdeps = nullIfNone(jdepsApi, Artifact.class); - return JavaInfoBuildHelper.getInstance() .createJavaInfo( JavaOutput.builder() @@ -517,6 +517,7 @@ public JavaInfo javaInfo( Sequence.cast(deps, JavaInfo.class, "deps"), Sequence.cast(runtimeDeps, JavaInfo.class, "runtime_deps"), Sequence.cast(exports, JavaInfo.class, "exports"), + Sequence.cast(exportedPlugins, JavaPluginInfo.class, "exported_plugins"), Sequence.cast(nativeLibraries, CcInfo.class, "native_libraries"), thread.getCallerLocation(), thread.getSemantics().getBool(INCOMPATIBLE_ENABLE_EXPORTS_PROVIDER)); 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 a4dd0f59ef6875..fec255fb3e216a 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 @@ -75,6 +75,7 @@ public static JavaInfoBuildHelper getInstance() { * @param exports libraries to make available for users of this library. java_library.exports + * @param exportedPlugins A list of exported plugins. * @param nativeLibraries CC library dependencies that are needed for this library * @return new created JavaInfo instance */ @@ -84,6 +85,7 @@ JavaInfo createJavaInfo( Sequence compileTimeDeps, Sequence runtimeDeps, Sequence exports, + Sequence exportedPlugins, Sequence nativeLibraries, Location location, boolean withExportsProvider) { @@ -126,7 +128,7 @@ JavaInfo createJavaInfo( javaInfoBuilder.addProvider(JavaExportsProvider.class, createJavaExportsProvider(exports)); } - javaInfoBuilder.javaPluginInfo(mergeExportedJavaPluginInfo(exports)); + javaInfoBuilder.javaPluginInfo(mergeExportedJavaPluginInfo(exportedPlugins, exports)); javaInfoBuilder.addProvider( JavaSourceJarsProvider.class, @@ -230,12 +232,15 @@ private JavaExportsProvider createJavaExportsProvider(Iterable exports JavaInfo.fetchProvidersFromList(exports, JavaExportsProvider.class)); } - private JavaPluginInfo mergeExportedJavaPluginInfo(Iterable javaInfos) { + private JavaPluginInfo mergeExportedJavaPluginInfo( + Iterable plugins, Iterable javaInfos) { return JavaPluginInfo.merge( - stream(javaInfos) - .map(JavaInfo::getJavaPluginInfo) - .filter(Objects::nonNull) - .collect(toImmutableList())); + concat( + plugins, + stream(javaInfos) + .map(JavaInfo::getJavaPluginInfo) + .filter(Objects::nonNull) + .collect(toImmutableList()))); } public JavaInfo createJavaCompileAction( @@ -249,8 +254,8 @@ public JavaInfo createJavaCompileAction( List runtimeDeps, List experimentalLocalCompileTimeDeps, List exports, - List plugins, - List exportedPlugins, + List plugins, + List exportedPlugins, List nativeLibraries, List annotationProcessorAdditionalInputs, List annotationProcessorAdditionalOutputs, @@ -289,7 +294,7 @@ public JavaInfo createJavaCompileAction( streamProviders(deps, JavaCompilationArgsProvider.class).forEach(helper::addDep); streamProviders(exports, JavaCompilationArgsProvider.class).forEach(helper::addExport); helper.setCompilationStrictDepsMode(getStrictDepsMode(Ascii.toUpperCase(strictDepsMode))); - helper.setPlugins(mergeExportedJavaPluginInfo(concat(plugins, deps))); + helper.setPlugins(mergeExportedJavaPluginInfo(plugins, deps)); helper.setNeverlink(neverlink); NestedSet localCompileTimeDeps = @@ -344,7 +349,7 @@ public JavaInfo createJavaCompileAction( JavaSourceJarsProvider.class, createJavaSourceJarsProvider(outputSourceJars, concat(runtimeDeps, exports, deps))) .addProvider(JavaRuleOutputJarsProvider.class, outputJarsBuilder.build()) - .javaPluginInfo(mergeExportedJavaPluginInfo(concat(exportedPlugins, exports))) + .javaPluginInfo(mergeExportedJavaPluginInfo(exportedPlugins, exports)) .addProvider(JavaExportsProvider.class, createJavaExportsProvider(exports)) .addProvider(JavaCcInfoProvider.class, JavaCcInfoProvider.merge(transitiveNativeLibraries)) .addTransitiveOnlyRuntimeJarsToJavaInfo(deps) diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaLibrary.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaLibrary.java index 26e70cd6d595d1..4e36b332eccab2 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaLibrary.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaLibrary.java @@ -197,7 +197,6 @@ final ConfiguredTarget init( JavaCommon.getRunfiles(ruleContext, semantics, javaArtifacts, neverLink))) .setFilesToBuild(filesToBuild) .addNativeDeclaredProvider(new ProguardSpecProvider(proguardSpecs)) - .addNativeDeclaredProvider(javaInfo) .addOutputGroup(JavaSemantics.SOURCE_JARS_OUTPUT_GROUP, transitiveSourceJars) .addOutputGroup( JavaSemantics.DIRECT_SOURCE_JARS_OUTPUT_GROUP, @@ -207,6 +206,10 @@ final ConfiguredTarget init( if (isJavaPluginRule) { builder.addStarlarkDeclaredProvider(javaPluginInfo); } + if (!isJavaPluginRule || !javaConfig.requireJavaPluginInfo()) { + // After javaConfig.requireJavaPluginInfo is flipped JavaInfo is not returned from java_plugin + builder.addNativeDeclaredProvider(javaInfo); + } Artifact validation = AndroidLintActionBuilder.create( diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaOptions.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaOptions.java index aa812fe458e717..0ab9782ba1aa1a 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaOptions.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaOptions.java @@ -655,6 +655,18 @@ public ImportDepsCheckingLevelConverter() { help = "When enabled the native libraries in the data attribute are not collected.") public boolean dontCollectDataLibraries; + @Option( + name = "incompatible_require_javaplugininfo_in_javacommon", + defaultValue = "false", + documentationCategory = OptionDocumentationCategory.UNDOCUMENTED, + effectTags = {OptionEffectTag.UNKNOWN}, + metadataTags = { + OptionMetadataTag.INCOMPATIBLE_CHANGE, + OptionMetadataTag.TRIGGERED_BY_ALL_INCOMPATIBLE_CHANGES + }, + help = "When enabled java_common.compile only accepts JavaPluginInfo for plugins.") + public boolean requireJavaPluginInfo; + @Option( name = "experimental_publish_javacclinkparamsinfo", defaultValue = "true", @@ -753,6 +765,7 @@ public FragmentOptions getHost() { host.dontCollectSoArtifacts = dontCollectSoArtifacts; host.dontCollectDataLibraries = dontCollectDataLibraries; + host.requireJavaPluginInfo = requireJavaPluginInfo; return host; } diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaStarlarkCommon.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaStarlarkCommon.java index 2dcf4cade5d246..8811182874ad49 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaStarlarkCommon.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaStarlarkCommon.java @@ -13,6 +13,7 @@ // limitations under the License. package com.google.devtools.build.lib.rules.java; +import static com.google.common.collect.ImmutableList.toImmutableList; import static com.google.devtools.build.lib.packages.semantics.BuildLanguageOptions.INCOMPATIBLE_ENABLE_EXPORTS_PROVIDER; import com.google.common.collect.ImmutableList; @@ -27,6 +28,7 @@ import com.google.devtools.build.lib.starlarkbuildapi.core.ProviderApi; import com.google.devtools.build.lib.starlarkbuildapi.java.JavaCommonApi; import com.google.devtools.build.lib.starlarkbuildapi.java.JavaToolchainStarlarkApiProviderApi; +import java.util.Objects; import net.starlark.java.eval.EvalException; import net.starlark.java.eval.Sequence; import net.starlark.java.eval.Starlark; @@ -65,8 +67,8 @@ public JavaInfo createJavaCompileAction( Sequence runtimeDeps, // expected Sequence experimentalLocalCompileTimeDeps, // expected Sequence exports, // expected - Sequence plugins, // expected - Sequence exportedPlugins, // expected + Sequence plugins, // expected + Sequence exportedPlugins, // expected Sequence nativeLibraries, // expected. Sequence annotationProcessorAdditionalInputs, // expected Sequence annotationProcessorAdditionalOutputs, // expected @@ -79,6 +81,40 @@ public JavaInfo createJavaCompileAction( StarlarkThread thread) throws EvalException, InterruptedException { + boolean acceptJavaInfo = + !starlarkRuleContext + .getRuleContext() + .getFragment(JavaConfiguration.class) + .requireJavaPluginInfo(); + + final ImmutableList pluginsParam; + if (acceptJavaInfo && !plugins.isEmpty() && plugins.get(0) instanceof JavaInfo) { + // Handle deprecated case where plugins is given a list of JavaInfos + pluginsParam = + Sequence.cast(plugins, JavaInfo.class, "plugins").stream() + .map(JavaInfo::getJavaPluginInfo) + .filter(Objects::nonNull) + .collect(toImmutableList()); + } else { + pluginsParam = Sequence.cast(plugins, JavaPluginInfo.class, "plugins").getImmutableList(); + } + + final ImmutableList exportedPluginsParam; + if (acceptJavaInfo + && !exportedPlugins.isEmpty() + && exportedPlugins.get(0) instanceof JavaInfo) { + // Handle deprecated case where exported_plugins is given a list of JavaInfos + exportedPluginsParam = + Sequence.cast(exportedPlugins, JavaInfo.class, "exported_plugins").stream() + .map(JavaInfo::getJavaPluginInfo) + .filter(Objects::nonNull) + .collect(toImmutableList()); + } else { + exportedPluginsParam = + Sequence.cast(exportedPlugins, JavaPluginInfo.class, "exported_plugins") + .getImmutableList(); + } + return JavaInfoBuildHelper.getInstance() .createJavaCompileAction( starlarkRuleContext, @@ -94,8 +130,8 @@ public JavaInfo createJavaCompileAction( JavaInfo.class, "experimental_local_compile_time_deps"), Sequence.cast(exports, JavaInfo.class, "exports"), - Sequence.cast(plugins, JavaInfo.class, "plugins"), - Sequence.cast(exportedPlugins, JavaInfo.class, "exported_plugins"), + pluginsParam, + exportedPluginsParam, Sequence.cast(nativeLibraries, CcInfo.class, "native_libraries"), Sequence.cast( annotationProcessorAdditionalInputs, diff --git a/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/java/JavaCommonApi.java b/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/java/JavaCommonApi.java index 3d7f1aadc5bfbf..7db5a70e7d40c2 100644 --- a/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/java/JavaCommonApi.java +++ b/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/java/JavaCommonApi.java @@ -137,14 +137,20 @@ public interface JavaCommonApi< name = "plugins", positional = false, named = true, - allowedTypes = {@ParamType(type = Sequence.class, generic1 = JavaInfoApi.class)}, + allowedTypes = { + @ParamType(type = Sequence.class, generic1 = JavaPluginInfoApi.class), + @ParamType(type = Sequence.class, generic1 = JavaInfoApi.class) + }, defaultValue = "[]", doc = "A list of plugins. Optional."), @Param( name = "exported_plugins", positional = false, named = true, - allowedTypes = {@ParamType(type = Sequence.class, generic1 = JavaInfoApi.class)}, + allowedTypes = { + @ParamType(type = Sequence.class, generic1 = JavaPluginInfoApi.class), + @ParamType(type = Sequence.class, generic1 = JavaInfoApi.class) + }, defaultValue = "[]", doc = "A list of exported plugins. Optional."), @Param( diff --git a/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/java/JavaInfoApi.java b/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/java/JavaInfoApi.java index 9099630a27e6d1..10ce36ffc069c0 100644 --- a/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/java/JavaInfoApi.java +++ b/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/java/JavaInfoApi.java @@ -319,6 +319,14 @@ interface JavaInfoProviderApi extends ProviderApi { "Libraries to make available for users of this library. See also " + "java_library.exports."), + @Param( + name = "exported_plugins", + named = true, + allowedTypes = { + @ParamType(type = Sequence.class, generic1 = JavaPluginInfoApi.class) + }, + defaultValue = "[]", + doc = "A list of exported plugins. Optional."), @Param( name = "jdeps", allowedTypes = { @@ -355,6 +363,7 @@ interface JavaInfoProviderApi extends ProviderApi { Sequence deps, Sequence runtimeDeps, Sequence exports, + Sequence exportedPlugins, Object jdepsApi, Sequence nativeLibraries, StarlarkThread thread) diff --git a/src/test/java/com/google/devtools/build/lib/rules/java/JavaInfoStarlarkApiTest.java b/src/test/java/com/google/devtools/build/lib/rules/java/JavaInfoStarlarkApiTest.java index 337addc6b083c2..78b4aec6c51a88 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/java/JavaInfoStarlarkApiTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/java/JavaInfoStarlarkApiTest.java @@ -623,16 +623,8 @@ public void buildHelperCreateJavaInfoExportProvider001() throws Exception { } @Test - public void buildHelperCreateJavaInfoPlugins() throws Exception { + public void buildHelperCreateJavaInfoPluginsFromExports() throws Exception { ruleBuilder().build(); - scratch.file("java/test/lib.jar"); - scratch.file( - "java/test/BUILD", - "load(':custom_rule.bzl', 'java_custom_library')", - "java_custom_library(", - " name = 'custom',", - " export = ':export',", - ")"); scratch.file( "foo/BUILD", "load(':extension.bzl', 'my_rule')", @@ -656,6 +648,28 @@ public void buildHelperCreateJavaInfoPlugins() throws Exception { .containsExactly("com.google.process.stuff"); } + @Test + public void buildHelperCreateJavaInfoWithPlugins() throws Exception { + ruleBuilder().build(); + scratch.file( + "foo/BUILD", + "load(':extension.bzl', 'my_rule')", + "java_library(name = 'plugin_dep',", + " srcs = [ 'ProcessorDep.java'])", + "java_plugin(name = 'plugin',", + " srcs = ['AnnotationProcessor.java'],", + " processor_class = 'com.google.process.stuff',", + " deps = [ ':plugin_dep' ])", + "my_rule(name = 'my_starlark_rule',", + " output_jar = 'my_starlark_rule_lib.jar',", + " dep_exported_plugins = [':plugin']", + ")"); + assertNoEvents(); + + assertThat(fetchJavaInfo().getJavaPluginInfo().plugins().processorClasses().toList()) + .containsExactly("com.google.process.stuff"); + } + @Test public void buildHelperCreateJavaInfoWithOutputJarAndStampJar() throws Exception { ruleBuilder().withStampJar().build(); @@ -895,6 +909,7 @@ private String[] newJavaInfo() { " dp = [dep[java_common.provider] for dep in ctx.attr.dep]", " dp_runtime = [dep[java_common.provider] for dep in ctx.attr.dep_runtime]", " dp_exports = [dep[java_common.provider] for dep in ctx.attr.dep_exports]", + " dp_exported_plugins = [dep[JavaPluginInfo] for dep in ctx.attr.dep_exported_plugins]", " dp_libs = [dep[CcInfo] for dep in ctx.attr.cc_dep]"); if (useIJar) { @@ -941,6 +956,7 @@ private String[] newJavaInfo() { " deps = dp,", " runtime_deps = dp_runtime,", " exports = dp_exports,", + " exported_plugins = dp_exported_plugins,", " jdeps = ctx.file.jdeps,", " compile_jdeps = ctx.file.compile_jdeps,", " generated_class_jar = ctx.file.generated_class_jar,", @@ -968,6 +984,7 @@ private void build() throws Exception { " 'cc_dep' : attr.label_list(),", " 'dep_runtime' : attr.label_list(),", " 'dep_exports' : attr.label_list(),", + " 'dep_exported_plugins' : attr.label_list(),", " 'output_jar' : attr.output(mandatory=True),", " 'source_jars' : attr.label_list(allow_files=['.jar']),", " 'sources' : attr.label_list(allow_files=['.java']),", diff --git a/src/test/java/com/google/devtools/build/lib/rules/java/JavaStarlarkApiTest.java b/src/test/java/com/google/devtools/build/lib/rules/java/JavaStarlarkApiTest.java index 1fd8f2228973c3..47ef5f03918c96 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/java/JavaStarlarkApiTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/java/JavaStarlarkApiTest.java @@ -519,7 +519,7 @@ public void testJavaCommonCompileExposesAnnotationProcessingInfo() throws Except " source_files = ctx.files.srcs,", " deps = [d[JavaInfo] for d in ctx.attr.deps],", " exports = [e[JavaInfo] for e in ctx.attr.exports],", - " plugins = [p[JavaInfo] for p in ctx.attr.plugins],", + " plugins = [p[JavaPluginInfo] for p in ctx.attr.plugins],", " output = output_jar,", " java_toolchain = ctx.attr._java_toolchain[java_common.JavaToolchainInfo],", " )", @@ -543,6 +543,54 @@ public void testJavaCommonCompileExposesAnnotationProcessingInfo() throws Except /*extraLoad=*/ "load(':custom_rule.bzl', 'java_custom_library')"); } + /** + * Test that plugin parameter of java_common.compile does not accept JavaInfo when + * incompatible_require_javaplugininfo_in_javacommon is flipped. + */ + @Test + public void javaCommonCompile_requiresJavaPluginInfo() throws Exception { + useConfiguration("--incompatible_require_javaplugininfo_in_javacommon"); + JavaToolchainTestUtil.writeBuildFileForJavaToolchain(scratch); + scratch.file( + "java/test/custom_rule.bzl", + "def _impl(ctx):", + " output_jar = ctx.actions.declare_file('lib' + ctx.label.name + '.jar')", + " return java_common.compile(", + " ctx,", + " source_files = ctx.files.srcs,", + " plugins = [p[JavaInfo] for p in ctx.attr.deps],", + " output = output_jar,", + " java_toolchain = ctx.attr._java_toolchain[java_common.JavaToolchainInfo],", + " )", + "java_custom_library = rule(", + " implementation = _impl,", + " outputs = {", + " 'my_output': 'lib%{name}.jar'", + " },", + " attrs = {", + " 'srcs': attr.label_list(allow_files=['.java']),", + " 'deps': attr.label_list(),", + " '_java_toolchain': attr.label(default = Label('//java/com/google/test:toolchain')),", + " },", + " fragments = ['java']", + ")"); + scratch.file( + "java/test/BUILD", + "load(':custom_rule.bzl', 'java_custom_library')", + "java_library(name = 'dep',", + " srcs = [ 'ProcessorDep.java'])", + "java_custom_library(", + " name = 'to_be_processed',", + " deps = [':dep'],", + " srcs = ['ToBeProcessed.java'],", + ")"); + + reporter.removeHandler(failFastHandler); + getConfiguredTarget("//java/test:to_be_processed"); + + assertContainsEvent("at index 0 of plugins, got element of type JavaInfo, want JavaPluginInfo"); + } + @Test public void testJavaCommonCompileCompilationInfo() throws Exception { JavaToolchainTestUtil.writeBuildFileForJavaToolchain(scratch);