Skip to content

Commit 5103a51

Browse files
authored
Ensure all sourceSets are compiled as part of Gradle precommit (#91897) (#91937)
1 parent 67e4ec9 commit 5103a51

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/precommit/PrecommitTaskPlugin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ public void apply(Project project) {
3131
"lifecycle-base",
3232
p -> project.getTasks().named(LifecycleBasePlugin.CHECK_TASK_NAME).configure(t -> t.dependsOn(precommit))
3333
);
34-
project.getPluginManager().withPlugin("java", p -> {
34+
project.getPluginManager().withPlugin("java-base", p -> {
3535
// run compilation as part of precommit
3636
project.getExtensions().getByType(JavaPluginExtension.class).getSourceSets().all(sourceSet ->
37-
precommit.configure(t -> t.shouldRunAfter(sourceSet.getClassesTaskName()))
37+
precommit.configure(t -> t.dependsOn(sourceSet.getClassesTaskName()))
3838
);
3939
// make sure tests run after all precommit tasks
4040
project.getTasks().withType(Test.class).configureEach(t -> t.mustRunAfter(precommit));

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/ElasticsearchJavaBasePlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ public class ElasticsearchJavaBasePlugin implements Plugin<Project> {
3838
public void apply(Project project) {
3939
// make sure the global build info plugin is applied to the root project
4040
project.getRootProject().getPluginManager().apply(GlobalBuildInfoPlugin.class);
41-
// common repositories setup
4241
project.getPluginManager().apply(JavaBasePlugin.class);
42+
// common repositories setup
4343
project.getPluginManager().apply(RepositoriesSetupPlugin.class);
4444
project.getPluginManager().apply(ElasticsearchTestBasePlugin.class);
4545
project.getPluginManager().apply(PrecommitTaskPlugin.class);

0 commit comments

Comments
 (0)