From f6a00cbe7b47eff4bfa85cc9455a15a4d9d8f19a Mon Sep 17 00:00:00 2001 From: Sergio Ribera Date: Wed, 28 Jun 2023 13:22:15 -0400 Subject: [PATCH] fix: cargo buid type based on gradle task --- .../multiple_joysticks_mobile/android/build.gradle | 10 +++++----- examples/simple_mobile/android/build.gradle | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/multiple_joysticks_mobile/android/build.gradle b/examples/multiple_joysticks_mobile/android/build.gradle index 57b056b..388a6e5 100644 --- a/examples/multiple_joysticks_mobile/android/build.gradle +++ b/examples/multiple_joysticks_mobile/android/build.gradle @@ -91,6 +91,11 @@ cargo { // "x86_64" ] targetDirectory = "../target" + if (project.gradle.startParameter.taskNames.any { it.toLowerCase().contains('release') }) { + profile = "release" + } else { + profile = "debug" + } } // @@ -102,11 +107,6 @@ cargo { import org.apache.tools.ant.taskdefs.condition.Os tasks.whenTaskAdded { task -> - if (task.name == 'assembleDebug' || task.name == 'bundleDebug') { - cargo.profile = "debug" - } else if (task.name == 'assembleRelease' || task.name == 'bundleRelease') { - cargo.profile = "release" - } if (task.name == 'mergeDebugJniLibFolders' || task.name == 'mergeReleaseJniLibFolders') { task.dependsOn 'cargoBuild' } diff --git a/examples/simple_mobile/android/build.gradle b/examples/simple_mobile/android/build.gradle index 57b056b..388a6e5 100644 --- a/examples/simple_mobile/android/build.gradle +++ b/examples/simple_mobile/android/build.gradle @@ -91,6 +91,11 @@ cargo { // "x86_64" ] targetDirectory = "../target" + if (project.gradle.startParameter.taskNames.any { it.toLowerCase().contains('release') }) { + profile = "release" + } else { + profile = "debug" + } } // @@ -102,11 +107,6 @@ cargo { import org.apache.tools.ant.taskdefs.condition.Os tasks.whenTaskAdded { task -> - if (task.name == 'assembleDebug' || task.name == 'bundleDebug') { - cargo.profile = "debug" - } else if (task.name == 'assembleRelease' || task.name == 'bundleRelease') { - cargo.profile = "release" - } if (task.name == 'mergeDebugJniLibFolders' || task.name == 'mergeReleaseJniLibFolders') { task.dependsOn 'cargoBuild' }