-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add build.gradle.kts plugin setup specifics to readme #133
Comments
Thanks a lot for these details! I ended up changing the build-time dependencies to apply to 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 |
Thanks, the last step is very important and also we need add |
You need to place the cargo gradle plugin before others. Otherwise, a wiered "Duplicate Resource" error would likely occur. Details here |
Thanks for linking that @Chiichen, that indeed fixes the |
Thanks for your answer! However, I am using cargo {
//...
}
project.afterEvaluate {
tasks.withType(com.nishtahir.CargoBuildTask::class)
.forEach { buildTask ->
tasks.withType(com.android.build.gradle.tasks.MergeSourceSetFolders::class)
.configureEach {
this.dependsOn(buildTask)
}
}
} |
@Chiichen this might be caused by a prior successful build: the library will be picked up in the APK, but it will always be an older version. If you skip adding
|
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
The text was updated successfully, but these errors were encountered: