API Documentation: JniJarBinary

Configuration for a Java Native Interface (JNI) JAR binary. A JNI JAR refers to a JAR binary containing only the shared library binary. It’s only present if the library generate multiple variants. If the JNI library has only a single variant, the shared library binary is included inside the JvmJarBinary.

The binaries are accessible via the library’s BinaryView containing all the binary instance of a library:

plugins {
    id 'dev.nokee.jni-library'
    id 'dev.nokee.cpp-language'
    id 'java'
}

import dev.nokee.platform.jni.JniJarBinary

library {
    binaries.withType(JniJarBinary).configureEach {
        // ...
    }
}

The binary of a specific variant is also accessible via the variant’s BinaryView:

plugins {
    id 'dev.nokee.jni-library'
    id 'dev.nokee.cpp-language'
    id 'java'
}

import dev.nokee.platform.jni.JniJarBinary

library {
    variants.configureEach {
        binaries.withType(JniJarBinary).configureEach {
            // ...
        }
    }
}

Properties

Property Description

jarTask

The Jar task for this binary.

Methods

No methods.

Property Details

Provider<RegularFile> linkedFile (read-only)

The location of the linked binary.

ListProperty<String> linkerArgs

Additional arguments to provide to the linker.

It act as an escape hatch to the current model. Please open an issue on https://github.com/nokeedev/gradle-native with your reason for using this hatch so we can improve the model.

Provider<NativeToolChain> toolChain (read-only)

The tool chain used for the compilation.