Skip to content

Commit

Permalink
fix: cargo buid type based on gradle task
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioRibera committed Jun 28, 2023
1 parent 7f6bdf8 commit f6a00cb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions examples/multiple_joysticks_mobile/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ cargo {
// "x86_64"
]
targetDirectory = "../target"
if (project.gradle.startParameter.taskNames.any { it.toLowerCase().contains('release') }) {
profile = "release"
} else {
profile = "debug"
}
}

//
Expand All @@ -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'
}
Expand Down
10 changes: 5 additions & 5 deletions examples/simple_mobile/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ cargo {
// "x86_64"
]
targetDirectory = "../target"
if (project.gradle.startParameter.taskNames.any { it.toLowerCase().contains('release') }) {
profile = "release"
} else {
profile = "debug"
}
}

//
Expand All @@ -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'
}
Expand Down

0 comments on commit f6a00cb

Please sign in to comment.