File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77
88jobs :
99 build :
10- timeout-minutes : 5
11- runs-on : ubuntu-latest
10+ timeout-minutes : 10
1211 strategy :
1312 fail-fast : false
1413 matrix :
1514 java : [ '17', '21', '25' ]
15+ platform : [ 'ubuntu-latest' ]
16+ include :
17+ - java : ' 25'
18+ platform : ' windows-latest'
19+
20+ runs-on : ${{ matrix.platform }}
1621 permissions :
1722 contents : read
1823 packages : write
Original file line number Diff line number Diff line change @@ -17,3 +17,23 @@ dependencies {
1717 testImplementation(" ch.qos.logback:logback-classic:1.5.18" )
1818 testImplementation(" org.awaitility:awaitility:4.3.0" )
1919}
20+
21+
22+ tasks {
23+
24+ register<Copy >(" extractNativeLibs" ) {
25+ from(configurations.runtimeClasspath.get().filter { it.name.contains(" mbedtls-lib" ) }.map { zipTree(it) })
26+ include(" win32-x86-64/**" )
27+ into(layout.buildDirectory.dir(" native-libs" ))
28+ }
29+
30+
31+ test {
32+ if (System .getProperty(" os.name" ).lowercase().contains(" windows" )) {
33+ // On Windows, JNA cannot automatically load native libraries from JAR when they have dependencies on each other,
34+ // so we extract them and set the path explicitly.
35+ dependsOn(" extractNativeLibs" )
36+ systemProperty(" jna.library.path" , layout.buildDirectory.dir(" native-libs/win32-x86-64" ).get().asFile.absolutePath)
37+ }
38+ }
39+ }
You can’t perform that action at this time.
0 commit comments