Skip to content

Add build.gradle.kts plugin setup specifics to readme #133

@0x330a

Description

@0x330a

Needed to do some digging around to how to set up a build.gradle.kts with a lot of trial and error, I think I've got it mostly.

to apply the plugin in a module's build.gradle.kts:

plugins {
    // ...
    id("org.mozilla.rust-android-gradle.rust-android") version "0.9.3"
}

to configure the plugin in a module's build.gradle.kts

extensions.configure(CargoExtension::class) {
    module = "[module name]"
    libname = "[libname]"
    // ...
}

to set a build dependency (This seems to work for me but not sure if it's the best method):

tasks.preBuild.configure {
    dependsOn.add(tasks.withType(CargoBuildTask::class.java))
}

Additionally, it seems that the most recent template for adding plugins in an Android build.gradle.kts setup puts the plugin (without applying) in the project level build.gradle.kts like so:

plugins {
    // ...
    id("org.mozilla.rust-android-gradle.rust-android") version "0.9.3" apply false
}

Could probably do a PR myself but not sure where exactly these instructions would best fit

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions