|
|
@ -57,7 +57,7 @@ class NativeImagePluginActionIntegrationTests {
|
|
|
|
@TestTemplate
|
|
|
|
@TestTemplate
|
|
|
|
void reachabilityMetadataConfigurationFilesAreCopiedToJar() throws IOException {
|
|
|
|
void reachabilityMetadataConfigurationFilesAreCopiedToJar() throws IOException {
|
|
|
|
writeDummySpringApplicationAotProcessorMainClass();
|
|
|
|
writeDummySpringApplicationAotProcessorMainClass();
|
|
|
|
BuildResult result = this.gradleBuild.build("bootJar");
|
|
|
|
BuildResult result = this.gradleBuild.expectDeprecationWarningsWithAtLeastVersion("8.2-rc-1").build("bootJar");
|
|
|
|
assertThat(result.task(":bootJar").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
|
|
|
|
assertThat(result.task(":bootJar").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
|
|
|
|
File buildLibs = new File(this.gradleBuild.getProjectDir(), "build/libs");
|
|
|
|
File buildLibs = new File(this.gradleBuild.getProjectDir(), "build/libs");
|
|
|
|
File jarFile = new File(buildLibs, this.gradleBuild.getProjectDir().getName() + ".jar");
|
|
|
|
File jarFile = new File(buildLibs, this.gradleBuild.getProjectDir().getName() + ".jar");
|
|
|
@ -75,7 +75,7 @@ class NativeImagePluginActionIntegrationTests {
|
|
|
|
writeDummySpringApplicationAotProcessorMainClass();
|
|
|
|
writeDummySpringApplicationAotProcessorMainClass();
|
|
|
|
FileSystemUtils.copyRecursively(new File("src/test/resources/reachability-metadata-repository"),
|
|
|
|
FileSystemUtils.copyRecursively(new File("src/test/resources/reachability-metadata-repository"),
|
|
|
|
new File(this.gradleBuild.getProjectDir(), "reachability-metadata-repository"));
|
|
|
|
new File(this.gradleBuild.getProjectDir(), "reachability-metadata-repository"));
|
|
|
|
BuildResult result = this.gradleBuild.build("bootJar");
|
|
|
|
BuildResult result = this.gradleBuild.expectDeprecationWarningsWithAtLeastVersion("8.2-rc-1").build("bootJar");
|
|
|
|
assertThat(result.task(":bootJar").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
|
|
|
|
assertThat(result.task(":bootJar").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
|
|
|
|
File buildLibs = new File(this.gradleBuild.getProjectDir(), "build/libs");
|
|
|
|
File buildLibs = new File(this.gradleBuild.getProjectDir(), "build/libs");
|
|
|
|
File jarFile = new File(buildLibs, this.gradleBuild.getProjectDir().getName() + ".jar");
|
|
|
|
File jarFile = new File(buildLibs, this.gradleBuild.getProjectDir().getName() + ".jar");
|
|
|
@ -91,27 +91,31 @@ class NativeImagePluginActionIntegrationTests {
|
|
|
|
@TestTemplate
|
|
|
|
@TestTemplate
|
|
|
|
void bootBuildImageIsConfiguredToBuildANativeImage() {
|
|
|
|
void bootBuildImageIsConfiguredToBuildANativeImage() {
|
|
|
|
writeDummySpringApplicationAotProcessorMainClass();
|
|
|
|
writeDummySpringApplicationAotProcessorMainClass();
|
|
|
|
BuildResult result = this.gradleBuild.build("bootBuildImageConfiguration");
|
|
|
|
BuildResult result = this.gradleBuild.expectDeprecationWarningsWithAtLeastVersion("8.2-rc-1")
|
|
|
|
|
|
|
|
.build("bootBuildImageConfiguration");
|
|
|
|
assertThat(result.getOutput()).contains("paketobuildpacks/builder:tiny").contains("BP_NATIVE_IMAGE = true");
|
|
|
|
assertThat(result.getOutput()).contains("paketobuildpacks/builder:tiny").contains("BP_NATIVE_IMAGE = true");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@TestTemplate
|
|
|
|
@TestTemplate
|
|
|
|
void developmentOnlyDependenciesDoNotAppearInNativeImageClasspath() {
|
|
|
|
void developmentOnlyDependenciesDoNotAppearInNativeImageClasspath() {
|
|
|
|
writeDummySpringApplicationAotProcessorMainClass();
|
|
|
|
writeDummySpringApplicationAotProcessorMainClass();
|
|
|
|
BuildResult result = this.gradleBuild.build("checkNativeImageClasspath");
|
|
|
|
BuildResult result = this.gradleBuild.expectDeprecationWarningsWithAtLeastVersion("8.2-rc-1")
|
|
|
|
|
|
|
|
.build("checkNativeImageClasspath");
|
|
|
|
assertThat(result.getOutput()).doesNotContain("commons-lang");
|
|
|
|
assertThat(result.getOutput()).doesNotContain("commons-lang");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@TestTemplate
|
|
|
|
@TestTemplate
|
|
|
|
void classesGeneratedDuringAotProcessingAreOnTheNativeImageClasspath() {
|
|
|
|
void classesGeneratedDuringAotProcessingAreOnTheNativeImageClasspath() {
|
|
|
|
BuildResult result = this.gradleBuild.build("checkNativeImageClasspath");
|
|
|
|
BuildResult result = this.gradleBuild.expectDeprecationWarningsWithAtLeastVersion("8.2-rc-1")
|
|
|
|
|
|
|
|
.build("checkNativeImageClasspath");
|
|
|
|
assertThat(result.getOutput()).contains(projectPath("build/classes/java/aot"),
|
|
|
|
assertThat(result.getOutput()).contains(projectPath("build/classes/java/aot"),
|
|
|
|
projectPath("build/resources/aot"), projectPath("build/generated/aotClasses"));
|
|
|
|
projectPath("build/resources/aot"), projectPath("build/generated/aotClasses"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@TestTemplate
|
|
|
|
@TestTemplate
|
|
|
|
void classesGeneratedDuringAotTestProcessingAreOnTheTestNativeImageClasspath() {
|
|
|
|
void classesGeneratedDuringAotTestProcessingAreOnTheTestNativeImageClasspath() {
|
|
|
|
BuildResult result = this.gradleBuild.build("checkTestNativeImageClasspath");
|
|
|
|
BuildResult result = this.gradleBuild.expectDeprecationWarningsWithAtLeastVersion("8.2-rc-1")
|
|
|
|
|
|
|
|
.build("checkTestNativeImageClasspath");
|
|
|
|
assertThat(result.getOutput()).contains(projectPath("build/classes/java/aotTest"),
|
|
|
|
assertThat(result.getOutput()).contains(projectPath("build/classes/java/aotTest"),
|
|
|
|
projectPath("build/resources/aotTest"), projectPath("build/generated/aotTestClasses"));
|
|
|
|
projectPath("build/resources/aotTest"), projectPath("build/generated/aotTestClasses"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|