mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Align to Native Build Tools metadata repository default
Closes gh-39068
This commit is contained in:
parent
8aef70749f
commit
07ee7254a6
@ -269,9 +269,6 @@ publishing.publications.withType(MavenPublication) {
|
|||||||
delegate.artifactId('native-maven-plugin')
|
delegate.artifactId('native-maven-plugin')
|
||||||
configuration {
|
configuration {
|
||||||
delegate.classesDirectory('${project.build.outputDirectory}')
|
delegate.classesDirectory('${project.build.outputDirectory}')
|
||||||
metadataRepository {
|
|
||||||
delegate.enabled('true')
|
|
||||||
}
|
|
||||||
delegate.requiredVersion('22.3')
|
delegate.requiredVersion('22.3')
|
||||||
}
|
}
|
||||||
executions {
|
executions {
|
||||||
@ -315,9 +312,6 @@ publishing.publications.withType(MavenPublication) {
|
|||||||
delegate.artifactId('native-maven-plugin')
|
delegate.artifactId('native-maven-plugin')
|
||||||
configuration {
|
configuration {
|
||||||
delegate.classesDirectory('${project.build.outputDirectory}')
|
delegate.classesDirectory('${project.build.outputDirectory}')
|
||||||
metadataRepository {
|
|
||||||
delegate.enabled('true')
|
|
||||||
}
|
|
||||||
delegate.requiredVersion('22.3')
|
delegate.requiredVersion('22.3')
|
||||||
}
|
}
|
||||||
executions {
|
executions {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2012-2023 the original author or authors.
|
* Copyright 2012-2024 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -22,14 +22,12 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
import org.graalvm.buildtools.gradle.NativeImagePlugin;
|
import org.graalvm.buildtools.gradle.NativeImagePlugin;
|
||||||
import org.graalvm.buildtools.gradle.dsl.GraalVMExtension;
|
import org.graalvm.buildtools.gradle.dsl.GraalVMExtension;
|
||||||
import org.graalvm.buildtools.gradle.dsl.GraalVMReachabilityMetadataRepositoryExtension;
|
|
||||||
import org.gradle.api.Action;
|
import org.gradle.api.Action;
|
||||||
import org.gradle.api.Plugin;
|
import org.gradle.api.Plugin;
|
||||||
import org.gradle.api.Project;
|
import org.gradle.api.Project;
|
||||||
import org.gradle.api.artifacts.Configuration;
|
import org.gradle.api.artifacts.Configuration;
|
||||||
import org.gradle.api.file.FileCollection;
|
import org.gradle.api.file.FileCollection;
|
||||||
import org.gradle.api.java.archives.Manifest;
|
import org.gradle.api.java.archives.Manifest;
|
||||||
import org.gradle.api.plugins.ExtensionAware;
|
|
||||||
import org.gradle.api.plugins.JavaPlugin;
|
import org.gradle.api.plugins.JavaPlugin;
|
||||||
import org.gradle.api.plugins.JavaPluginExtension;
|
import org.gradle.api.plugins.JavaPluginExtension;
|
||||||
import org.gradle.api.tasks.SourceSetContainer;
|
import org.gradle.api.tasks.SourceSetContainer;
|
||||||
@ -60,7 +58,6 @@ class NativeImagePluginAction implements PluginApplicationAction {
|
|||||||
GraalVMExtension graalVmExtension = configureGraalVmExtension(project);
|
GraalVMExtension graalVmExtension = configureGraalVmExtension(project);
|
||||||
configureMainNativeBinaryClasspath(project, sourceSets, graalVmExtension);
|
configureMainNativeBinaryClasspath(project, sourceSets, graalVmExtension);
|
||||||
configureTestNativeBinaryClasspath(sourceSets, graalVmExtension);
|
configureTestNativeBinaryClasspath(sourceSets, graalVmExtension);
|
||||||
configureGraalVmReachabilityExtension(graalVmExtension);
|
|
||||||
copyReachabilityMetadataToBootJar(project);
|
copyReachabilityMetadataToBootJar(project);
|
||||||
configureBootBuildImageToProduceANativeImage(project);
|
configureBootBuildImageToProduceANativeImage(project);
|
||||||
configureJarManifestNativeAttribute(project);
|
configureJarManifestNativeAttribute(project);
|
||||||
@ -99,12 +96,6 @@ class NativeImagePluginAction implements PluginApplicationAction {
|
|||||||
return extension;
|
return extension;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void configureGraalVmReachabilityExtension(GraalVMExtension graalVmExtension) {
|
|
||||||
GraalVMReachabilityMetadataRepositoryExtension extension = ((ExtensionAware) graalVmExtension).getExtensions()
|
|
||||||
.getByType(GraalVMReachabilityMetadataRepositoryExtension.class);
|
|
||||||
extension.getEnabled().set(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void copyReachabilityMetadataToBootJar(Project project) {
|
private void copyReachabilityMetadataToBootJar(Project project) {
|
||||||
project.getTasks()
|
project.getTasks()
|
||||||
.named(SpringBootPlugin.BOOT_JAR_TASK_NAME, BootJar.class)
|
.named(SpringBootPlugin.BOOT_JAR_TASK_NAME, BootJar.class)
|
||||||
|
Loading…
Reference in New Issue
Block a user