Skip processAot and processTestAot if there is no main or test code

Closes gh-32424
This commit is contained in:
Andy Wilkinson
2022-09-20 17:15:19 +01:00
parent 64f4da80cb
commit fa81e8ca79
6 changed files with 88 additions and 41 deletions

View File

@@ -21,6 +21,7 @@ import java.io.IOException;
import java.nio.file.Files;
import java.util.List;
import org.gradle.testkit.runner.TaskOutcome;
import org.junit.jupiter.api.TestTemplate;
import org.springframework.boot.gradle.junit.GradleCompatibility;
@@ -94,4 +95,16 @@ class SpringBootAotPluginIntegrationTests {
assertThat(output).contains("org.jboss.logging" + File.separatorChar + "jboss-logging");
}
@TestTemplate
void processAotIsSkippedWhenProjectHasNoMainSource() {
assertThat(this.gradleBuild.build("processAot").task(":processAot").getOutcome())
.isEqualTo(TaskOutcome.NO_SOURCE);
}
@TestTemplate
void processTestAotIsSkippedWhenProjectHasNoTestSource() {
assertThat(this.gradleBuild.build("processTestAot").task(":processTestAot").getOutcome())
.isEqualTo(TaskOutcome.NO_SOURCE);
}
}