Copy native reachability metadata to jar file in Gradle plugin

When the Spring Boot Gradle plugin builds a fat jar and the Native
Build Tools Gradle plugin is applied to the build, any configuration
files from the GraalVM reachability metadata repository that match
project dependencies are copied to a `META-INF/native-image`
directory in the fat jar.

Closes gh-32408
This commit is contained in:
Scott Frederick
2022-09-16 12:26:24 -05:00
parent 2b3ef96156
commit 1ed4d89466
3 changed files with 135 additions and 13 deletions

View File

@@ -0,0 +1,23 @@
plugins {
id 'java'
id 'org.springframework.boot'
id 'org.springframework.boot.aot'
}
apply plugin: 'org.graalvm.buildtools.native'
repositories {
mavenCentral()
}
dependencies {
implementation "ch.qos.logback:logback-classic:1.2.11"
implementation "org.jline:jline:3.21.0"
}
// see https://github.com/graalvm/native-build-tools/issues/302
graalvmNative {
agent {
tasksToInstrumentPredicate = { t -> false } as java.util.function.Predicate<Test>
}
}