Nokee Release Notes
The Nokee team is excited to announce the second release onward to a better native development experience in Gradle.
This release focus on adding support for macOS framework as well as adding support for Objective-C and Objective-C++ implementation languages. It extends automated test coverage to macOS, Linux, and Windows and adds configuration for the resource path for the native libraries embedded inside the Java Native Interface (JNI) library.
Since the last release, we tried many experiments for the work to come. You can read all about them in the announcement blog for this release.
Getting Started
To use the Nokee plugins in Gradle, simply copy the following code to the settings script of your project, then apply any of the Nokee plugins to your build using the plugins DSL block:
pluginManagement {
repositories {
gradlePluginPortal()
maven {
url = uri('https://repo.nokee.dev/snapshot')
}
}
def nokeeVersion = '0.2.0'
resolutionStrategy {
eachPlugin {
if (requested.id.id.startsWith('dev.nokee.')) {
useModule("${requested.id.id}:${requested.id.id}.gradle.plugin:${nokeeVersion}")
}
}
}
}
pluginManagement {
repositories {
gradlePluginPortal()
maven {
url = uri("https://repo.nokee.dev/snapshot")
}
}
val nokeeVersion = "0.2.0"
resolutionStrategy {
eachPlugin {
if (requested.id.id.startsWith("dev.nokee.")) {
useModule("${requested.id.id}:${requested.id.id}.gradle.plugin:${nokeeVersion}")
}
}
}
}
Framework Support on macOS
The Nokee plugin support macOS framework dependencies as normal dependencies.
It is also possible to depend on frameworks within other frameworks (also known as subframework).
For example, JavaNativeFoundation
is a subframework of JavaVM
framework and is required for Cocoa development in Java through the JNI runtime.
You can depend on subframework by requesting the capability matching the target subframework.
Because the underlying implementation relies on Gradle core native infrastructure, there are some inherent limitations. We will work out those limitations in future releases. The most important limitation is the ordering of the framework against header search paths and libraries to link. The frameworks should be allowed to interleave with other compiler and linker inputs. Instead, the command line passed to the compiler and linker group the frameworks. Also, the files inside a framework don’t participate in the up-to-date checking for the compiler and linker tasks. However, since the framework support is limited to system frameworks, it is unlikely to change between build invocation, causing build issues. Finally, this release doesn’t support dynamic version resolution of frameworks.
Resource Path Customization
The mapping of the native runtime libraries inside the JNI library JAR is customizable per-variant. It will help with the migration from existing custom JNI support to the Nokee’s JNI library support.
Objective-C and Objective-C++ Support
The JNI library plugin now support Objective-C and Objective-C++ implementation language via new language plugins. They work just like the other, C and C++, language plugins.
Plugins Testing Coverage
This release continues improving the testing coverage to prevent unintended breakage in future releases. Nokee’s continuous integration infrastructure covers all three major operating systems (e.g. Windows, macOS and Linux). Native toolchains and Gradle distribution coverage are still partial. Improvement will come in the next release.
Reporting Problems
If you find a problem with any of the plugins, please file a bug on GitHub Issues adhering to our issue guidelines. If you’re not sure you’re encountering a bug, please use the Gradle user forum or the Gradle Community Slack.