DeepMedia logo
Open Source

Search...

Other versions of this page

Improve this page on GitHub

Search

Configuration

Like installation, configuration of Knee settings is done via the Gradle Plugin and Gradle properties. The plugin will install an extension named knee with the following options:

Verbosity

kotlin logokotlin
knee { verboseLogs.set(true) // default: false verboseRuntime.set(true) // default: false verboseSources.set(true) // default: false }

These three options should be used for debugging. They may also be controlled via a property in gradle.properties, using the syntax io.deepmedia.knee.<propName>=<true|false>.

  • verboseLogs: if enabled, the Gradle plugin will print logs to the terminal.
  • verboseRuntime: if enabled, the compiler plugin will inject println() calls at runtime for debugging.
  • verboseSources: if enabled, the generated frontend source files will include comments and extra elements to understand which code generated them.

Source Sets

⚠️

In multiplatform projects with both backend and frontend targets, you can ignore this and just use automatic target connection.

As described in the concepts page, Knee analyzes your native code and generates JVM sources. These sources must be consumed somehow (e.g. added to your source sets).

To retrieve and configure the directory, use:

kotlin logokotlin
knee { generatedSourceDirectory.get() // default dir is build/knee/src generatedSourceDirectory.set(layout.buildDirectory.map { it.dir("somethingElse") }) val targetSpecificDir = generatedSourceDirectory(myKotlinTarget) }

Note that the generatedSourceDirectory is a root directory, with one subfolder per each KotlinNativeTarget where Knee is applied.

Target Connection

In Android Multiplatform projects, Knee will try to automatically bind backends with frontends:

  • Determine all androidNative targets
  • Declare debug and release binaries for them
  • Pack the binaries in a dedicated folder (build/knee/bin) respecting Android's jniLibs convention
  • Add such folder to Android Gradle Plugin and link tasks accordingly
  • Add knee.generatedSourceDirectory to Android Gradle Plugin source sets and link tasks accordingly

This can be disabled by using knee.connectTargets.set(true).

Subscribe to the DeepMedia Newsletter

The latest news about DeepMedia products, open source projects and software development at our company.

By clicking “Subscribe”, you agree that DeepMedia may use your email address to send you newsletters, including commercial communications, and to process your personal data for this purpose. You agree that DeepMedia may process said data using third-party services for this purpose in accordance with the DeepMedia Privacy Policy. You can revoke this consent at any time using the unsubscribe link included in each email or by writing at contact@deepmedia.io.