nokeedev / gradle-native

The home of anything about Gradle support for natively compiled languages
https://nokee.dev
Apache License 2.0
48 stars 8 forks source link

Improving on JniLibraryComposingFromSource-0.5.0-930919a0-kotlin-dsl #859

Open btbouwens opened 9 months ago

btbouwens commented 9 months ago

I downloaded the zip file for this, and tried to build. It wouldn't because some Groovy obsolescence.

I tried again with a newer Gradle and it worked.

But then: the cpp-jni-greeter/src/main/headers/com_example_greeter_Greeter.h should not be there, as it is also generated by the java-jni-greeter subproject, which will be picked up by:

@@ -20,7 +21,7 @@ library {
                                it.operatingSystem.isLinux -> listOf(File("${Jvm.current().javaHome.absolutePath}/include/linux"))
                                it.operatingSystem.isWindows -> listOf(File("${Jvm.current().javaHome.absolutePath}/include/win32"))
                                else -> emptyList()
-                       }
+                       } + "../java-jni-greeter/build/generated/sources/headers/java/main/"
                })
                compileTask.get().setPositionIndependentCode(true)
        }

But then, this should be built first, so a dependency should be defined. I don't understand how.