I'm trying to "gradlize" a project involving nativ...
# community-support
g
I'm trying to "gradlize" a project involving native libraries as well and I'd like to do this the state-of-the-art I tried re-adapting what Jendrik wrote here, I'm stuck into packing the natives into the variant jar file here:
Copy code
nativeVariants.forEach { variantDefinition ->
    val nativeJar = tasks.create<Jar>(variantDefinition.classifier + "Jar") {
        doLast {
            val lib = ".." // lib.dll/so/jnilib
            // this is wrong
            archiveFile.get().asFile.writeBytes(projectDir.resolve(lib).readBytes())
        }
    }
the archive file is the jar, how may I pack them in there?
if I try
Copy code
tarTree(archiveFile).plus(projectDir.resolve(lib))
> Querying the mapped value of task ':natives-linux-aarm64Jar' property 'archiveFile' before task ':natives-linux-aarm64Jar' has completed is not supported
I'm trying
Copy code
tasks.create<Jar>(variantDefinition.classifier + "Jar") {
    from(projectDir.resolve(lib))
but the resulting jars are invalid
everything was disabled by this line
actions = listOf()
removing it fixes it