|
19 | 19 | import org.gradle.api.provider.ProviderFactory; |
20 | 20 | import org.gradle.api.tasks.SourceSet; |
21 | 21 | import org.gradle.api.tasks.SourceSetContainer; |
22 | | -import org.gradle.jvm.tasks.Jar; |
23 | 22 |
|
24 | 23 | import javax.inject.Inject; |
25 | 24 |
|
26 | | -import static java.util.stream.Collectors.toList; |
27 | | - |
28 | 25 | /** |
29 | 26 | * Encapsulates build configuration for an Elasticsearch plugin. |
30 | 27 | */ |
@@ -69,29 +66,26 @@ public void apply(final Project project) { |
69 | 66 | if (policy.getAsFile().exists()) { |
70 | 67 | task.getPolicyFile().set(policy); |
71 | 68 | } |
72 | | - task.getCodeLocations().set( |
73 | | - project.getConfigurations() |
74 | | - .getByName("runtimeClasspath") |
75 | | - .minus(project.getConfigurations().getByName(CompileOnlyResolvePlugin.RESOLVEABLE_COMPILE_ONLY_CONFIGURATION_NAME)) |
76 | | - .plus(sourceSets.getByName(SourceSet.MAIN_SOURCE_SET_NAME).getOutput().getClassesDirs()) |
77 | | - .plus(sourceSets.getByName(SourceSet.TEST_SOURCE_SET_NAME).getOutput().getClassesDirs()) |
78 | | - ); |
79 | | - |
80 | | - Provider<Directory> directory = project.getLayout() |
81 | | - .getBuildDirectory() |
82 | | - .dir("generated-build-info/test"); |
| 69 | + task.getCodeLocations() |
| 70 | + .set( |
| 71 | + project.getConfigurations() |
| 72 | + .getByName("runtimeClasspath") |
| 73 | + .minus(project.getConfigurations().getByName(CompileOnlyResolvePlugin.RESOLVEABLE_COMPILE_ONLY_CONFIGURATION_NAME)) |
| 74 | + .plus(sourceSets.getByName(SourceSet.MAIN_SOURCE_SET_NAME).getOutput().getClassesDirs()) |
| 75 | + .plus(sourceSets.getByName(SourceSet.TEST_SOURCE_SET_NAME).getOutput().getClassesDirs()) |
| 76 | + ); |
| 77 | + |
| 78 | + Provider<Directory> directory = project.getLayout().getBuildDirectory().dir("generated-build-info/test"); |
83 | 79 | task.getOutputDirectory().set(directory); |
84 | 80 | }); |
85 | 81 |
|
86 | | - sourceSets.named(SourceSet.TEST_SOURCE_SET_NAME).configure(sourceSet -> { |
87 | | - sourceSet.getResources().srcDir(testBuildInfoTask); |
88 | | - }); |
| 82 | + sourceSets.named(SourceSet.TEST_SOURCE_SET_NAME).configure(sourceSet -> { sourceSet.getResources().srcDir(testBuildInfoTask); }); |
89 | 83 |
|
90 | 84 | // TODO: get the jar task |
91 | 85 | // TODO: configure on this task |
92 | 86 | // TODO: task.from() |
93 | | - //project.getLogger().lifecycle( |
94 | | - // "HELLO: " + project.getTasks().withType(Jar.class).getByName("jar").getArchiveFile().get().getAsFile().getAbsolutePath()); |
| 87 | + // project.getLogger().lifecycle( |
| 88 | + // "HELLO: " + project.getTasks().withType(Jar.class).getByName("jar").getArchiveFile().get().getAsFile().getAbsolutePath()); |
95 | 89 | } |
96 | 90 |
|
97 | 91 | } |
0 commit comments