@@ -19,7 +19,7 @@ group = 'org.restheart'
1919version = ' 1.0.0-SNAPSHOT'
2020description = ' restheart-plugin-skeleton'
2121
22- def restheartVersion = ' [8.12 .0,8 .1000.0)'
22+ def restheartVersion = [ 9.0 .0 ,9 .1000.0 )
2323
2424// Profile-based configurations
2525// When -Pname is passed, the property exists (even if empty)
@@ -32,23 +32,25 @@ def metricsProfile = project.hasProperty('metrics')
3232
3333java {
3434 toolchain {
35- languageVersion = JavaLanguageVersion . of(24 )
35+ languageVersion = JavaLanguageVersion . of(25 )
3636 }
3737}
3838
3939dependencies {
4040 // Runtime dependency
4141 implementation ' org.apache.commons:commons-lang3:3.18.0'
42-
42+
4343 // Base provided dependency
4444 if (nativeProfile) {
4545 implementation " org.restheart:restheart-commons:${ restheartVersion} "
4646 implementation " org.restheart:restheart:${ restheartVersion} "
4747 implementation " org.restheart:restheart-polyglot:${ restheartVersion} "
48+ // Update transitive dependency of undertow-core required for the native image build
49+ implementation ' org.wildfly.common:wildfly-common:1.7.0.Final'
4850 } else {
4951 compileOnly " org.restheart:restheart-commons:${ restheartVersion} "
5052 }
51-
53+
5254 // Profile-based dependencies
5355 if (securityProfile) {
5456 implementation " org.restheart:restheart-security:${ restheartVersion} "
@@ -77,7 +79,7 @@ tasks.named('jar') {
7779 archiveBaseName = ' restheart-plugin-skeleton'
7880 archiveVersion = ' '
7981 destinationDirectory = file(" $rootDir /target" )
80-
82+
8183 // Always set Main-Class for native builds
8284 manifest {
8385 attributes(
@@ -123,7 +125,7 @@ tasks.withType(Javadoc).configureEach {
123125if (nativeProfile) {
124126 def nativeGc = findProperty(' native.gc' ) ?: ' --gc=serial'
125127 def nativeQuickBuild = findProperty(' native.quickBuild' ) == null ? true : findProperty(' native.quickBuild' ). toBoolean()
126-
128+
127129 graalvmNative {
128130 binaries {
129131 main {
@@ -136,24 +138,24 @@ if (nativeProfile) {
136138 }
137139 }
138140 }
139-
141+
140142 tasks. named(' nativeCompile' ) {
141143 doLast {
142144 def outputDir = file(" $rootDir /target" )
143145 outputDir. mkdirs()
144-
146+
145147 // Copy the native image to target directory
146148 def buildDir = file(" $rootDir /build/native/nativeCompile" )
147149 def nativeExe = file(" $buildDir /restheart-plugin-skeleton" )
148-
150+
149151 // Also check for dylib on macOS or exe on Windows
150152 if (! nativeExe. exists()) {
151153 nativeExe = file(" $buildDir /restheart-plugin-skeleton.dylib" )
152154 }
153155 if (! nativeExe. exists()) {
154156 nativeExe = file(" $buildDir /restheart-plugin-skeleton.exe" )
155157 }
156-
158+
157159 if (nativeExe. exists()) {
158160 def targetName = nativeExe. name. replace(' .dylib' , ' ' ). replace(' .exe' , ' ' )
159161 def targetExe = file(" $rootDir /target/$targetName " )
@@ -168,7 +170,7 @@ if (nativeProfile) {
168170 } else {
169171 println " Warning: Native image not found in $buildDir "
170172 }
171-
173+
172174 // Create plugins directory
173175 file(" $rootDir /target/plugins" ). mkdirs()
174176 }
0 commit comments