Open 0x330a opened 9 months ago
Thanks a lot for these details! I ended up changing the build-time dependencies to apply to merge{Debug,Release}JniLibFolders
instead using MergeSourceSetFolders
as described in https://github.com/mozilla/rust-android-gradle/issues/118#issuecomment-1777952460, and had a little struggle to figure out how to turn an ["arm64"]
array into a list. I can still configure the extension directly via a cargo
object in the root though:
cargo {
module = "../android_vulkan_interop"
libname = "android_vulkan_interop"
targets = listOf("arm64")
}
project.afterEvaluate {
tasks.withType(com.nishtahir.CargoBuildTask::class)
.forEach { buildTask ->
tasks.withType(com.android.build.gradle.tasks.MergeSourceSetFolders::class)
.configureEach {
this.inputs.dir(
layout.buildDirectory.dir("rustJniLibs" + File.separatorChar + buildTask.toolchain!!.folder)
)
this.dependsOn(buildTask)
}
}
}
See here for the whole project: https://github.com/MarijnS95/AndroidVulkanInterop
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:
to configure the plugin in a module's build.gradle.kts
to set a build dependency (This seems to work for me but not sure if it's the best method):
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:
Could probably do a PR myself but not sure where exactly these instructions would best fit