فهرست منبع

Fix overlapping task outputs with test-with-dep gradle plugin (#70339)

The test-with-dependencies gradle plugin copies test dependencies
into build/generated-resources. This folder is also the output directory
of the pluginProperties task of the plugin build plugin.

These overlapping outputs folders result in

a) falsely added test dependency metadata in the bundlePlugin of the plugin
b) build failures due to deprecation warning with Gradle >= 7.0 due to
implicit task output usage in bundlePlugin task when running bundlePlugin
in combination with test tasks of that project

The fix is simply to use a different output folder for copied test dependencies
Rene Groeschke 4 سال پیش
والد
کامیت
f7cd919ac4
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      buildSrc/src/main/java/org/elasticsearch/gradle/test/TestWithDependenciesPlugin.java

+ 1 - 1
buildSrc/src/main/java/org/elasticsearch/gradle/test/TestWithDependenciesPlugin.java

@@ -53,7 +53,7 @@ public class TestWithDependenciesPlugin implements Plugin<Project> {
     }
 
     private static void addPluginResources(final Project project, final Project pluginProject) {
-        final File outputDir = new File(project.getBuildDir(), "/generated-resources/" + pluginProject.getName());
+        final File outputDir = new File(project.getBuildDir(), "/generated-test-resources/" + pluginProject.getName());
         String camelProjectName = stream(pluginProject.getName().split("-")).map(t -> StringUtils.capitalize(t))
             .collect(Collectors.joining());
         String taskName = "copy" + camelProjectName + "Metadata";