mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 01:22:26 -04:00
Ensure all sourceSets are compiled as part of Gradle precommit (#91897)
This commit is contained in:
parent
6b7e8ffeaf
commit
1efb95b857
2 changed files with 3 additions and 3 deletions
|
@ -31,10 +31,10 @@ public class PrecommitTaskPlugin implements Plugin<Project> {
|
|||
"lifecycle-base",
|
||||
p -> project.getTasks().named(LifecycleBasePlugin.CHECK_TASK_NAME).configure(t -> t.dependsOn(precommit))
|
||||
);
|
||||
project.getPluginManager().withPlugin("java", p -> {
|
||||
project.getPluginManager().withPlugin("java-base", p -> {
|
||||
// run compilation as part of precommit
|
||||
project.getExtensions().getByType(JavaPluginExtension.class).getSourceSets().all(sourceSet ->
|
||||
precommit.configure(t -> t.shouldRunAfter(sourceSet.getClassesTaskName()))
|
||||
precommit.configure(t -> t.dependsOn(sourceSet.getClassesTaskName()))
|
||||
);
|
||||
// make sure tests run after all precommit tasks
|
||||
project.getTasks().withType(Test.class).configureEach(t -> t.mustRunAfter(precommit));
|
||||
|
|
|
@ -38,8 +38,8 @@ public class ElasticsearchJavaBasePlugin implements Plugin<Project> {
|
|||
public void apply(Project project) {
|
||||
// make sure the global build info plugin is applied to the root project
|
||||
project.getRootProject().getPluginManager().apply(GlobalBuildInfoPlugin.class);
|
||||
// common repositories setup
|
||||
project.getPluginManager().apply(JavaBasePlugin.class);
|
||||
// common repositories setup
|
||||
project.getPluginManager().apply(RepositoriesSetupPlugin.class);
|
||||
project.getPluginManager().apply(ElasticsearchTestBasePlugin.class);
|
||||
project.getPluginManager().apply(PrecommitTaskPlugin.class);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue