diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-09-24 16:29:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-24 16:29:34 +0200 |
commit | 2b628e5d5b1b955beb599199e681b38edb5394a4 (patch) | |
tree | b8fccbc0561d3adec47e0cddf9cb086888b83fe0 /platform/android/java/lib | |
parent | 78e6b7c1bfb4de1a6eb82d5d0e6884d3a9f1566e (diff) | |
parent | ef143447adc31eae038940efc8bc8dffbec5a18b (diff) |
Merge pull request #32269 from m4gr3d/improve_build_time
Update the Godot gradle build tasks to provide additional flexibility
Diffstat (limited to 'platform/android/java/lib')
-rw-r--r-- | platform/android/java/lib/build.gradle | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/platform/android/java/lib/build.gradle b/platform/android/java/lib/build.gradle index 6d07504e45..13a14422ed 100644 --- a/platform/android/java/lib/build.gradle +++ b/platform/android/java/lib/build.gradle @@ -5,8 +5,6 @@ dependencies { } def pathToRootDir = "../../../../" -// Note: Only keep the abis you support to speed up the gradle 'assemble' task. -def supportedAbis = ["armv7", "arm64v8", "x86", "x86_64"] android { compileSdkVersion versions.compileSdk @@ -56,27 +54,20 @@ android { // files is only setup for editing support. gradle.startParameter.excludedTaskNames += taskPrefix + "externalNativeBuild" + buildType - // Create tasks to generate the Godot native libraries. - def taskName = "compileGodotNativeLibs" + buildType - def releaseTarget = "release" - if (buildType == "Debug") { - releaseTarget += "_debug" + def releaseTarget = supportedTargets[buildType.toLowerCase()] + if (releaseTarget == null || releaseTarget == "") { + throw new GradleException("Invalid build type: " + buildType) } - def abiTaskNames = [] - // Creating gradle tasks to generate the native libraries for the supported abis. - supportedAbis.each { abi -> - def abiTaskName = taskName + abi.capitalize() - abiTaskNames += abiTaskName - tasks.create(name: abiTaskName, type: Exec) { - executable "scons" - args "--directory=${pathToRootDir}", "platform=android", "target=${releaseTarget}", "android_arch=${abi}" - } + if (!supportedAbis.contains(defaultAbi)) { + throw new GradleException("Invalid default abi: " + defaultAbi) } - // Creating gradle task to run all of the previously generated tasks. - tasks.create(name: taskName, type: GradleBuild) { - tasks = abiTaskNames + // Creating gradle task to generate the native libraries for the default abi. + def taskName = getSconsTaskName(buildType) + tasks.create(name: taskName, type: Exec) { + executable "scons" + sconsExt + args "--directory=${pathToRootDir}", "platform=android", "target=${releaseTarget}", "android_arch=${defaultAbi}", "-j" + Runtime.runtime.availableProcessors() } // Schedule the tasks so the generated libs are present before the aar file is packaged. |