|
@@ -26,21 +26,22 @@ allprojects {
|
|
|
|
|
|
ext {
|
|
ext {
|
|
supportedAbis = ["armv7", "arm64v8", "x86", "x86_64"]
|
|
supportedAbis = ["armv7", "arm64v8", "x86", "x86_64"]
|
|
- supportedTargets = ["release", "debug"]
|
|
|
|
|
|
+ supportedTargets = ["release", "release_debug", "debug"]
|
|
|
|
+ supportedFlavors = ["toolsEnabled", "toolsDisabled"]
|
|
|
|
|
|
- // Used by gradle to specify which architecture to build for by default when running `./gradlew build`.
|
|
|
|
- // This command is usually used by Android Studio.
|
|
|
|
|
|
+ // Used by gradle to specify which architecture to build for by default when running
|
|
|
|
+ // `./gradlew build` (this command is usually used by Android Studio).
|
|
// If building manually on the command line, it's recommended to use the
|
|
// If building manually on the command line, it's recommended to use the
|
|
- // `./gradlew generateGodotTemplates` build command instead after running the `scons` command.
|
|
|
|
- // The defaultAbi must be one of the {supportedAbis} values.
|
|
|
|
- defaultAbi = "arm64v8"
|
|
|
|
|
|
+ // `./gradlew generateGodotTemplates` build command instead after running the `scons` command(s).
|
|
|
|
+ // The {selectedAbis} values must be from the {supportedAbis} values.
|
|
|
|
+ selectedAbis = ["arm64v8"]
|
|
}
|
|
}
|
|
|
|
|
|
def rootDir = "../../.."
|
|
def rootDir = "../../.."
|
|
def binDir = "$rootDir/bin/"
|
|
def binDir = "$rootDir/bin/"
|
|
|
|
|
|
-def getSconsTaskName(String buildType) {
|
|
|
|
- return "compileGodotNativeLibs" + buildType.capitalize()
|
|
|
|
|
|
+def getSconsTaskName(String flavor, String buildType, String abi) {
|
|
|
|
+ return "compileGodotNativeLibs" + flavor.capitalize() + buildType.capitalize() + abi.capitalize()
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -70,7 +71,7 @@ task copyReleaseBinaryToBin(type: Copy) {
|
|
* Depends on the library build task to ensure the AAR file is generated prior to copying.
|
|
* Depends on the library build task to ensure the AAR file is generated prior to copying.
|
|
*/
|
|
*/
|
|
task copyDebugAARToAppModule(type: Copy) {
|
|
task copyDebugAARToAppModule(type: Copy) {
|
|
- dependsOn ':lib:assembleDebug'
|
|
|
|
|
|
+ dependsOn ':lib:assembleToolsDisabledDebug'
|
|
from('lib/build/outputs/aar')
|
|
from('lib/build/outputs/aar')
|
|
into('app/libs/debug')
|
|
into('app/libs/debug')
|
|
include('godot-lib.debug.aar')
|
|
include('godot-lib.debug.aar')
|
|
@@ -81,7 +82,7 @@ task copyDebugAARToAppModule(type: Copy) {
|
|
* Depends on the library build task to ensure the AAR file is generated prior to copying.
|
|
* Depends on the library build task to ensure the AAR file is generated prior to copying.
|
|
*/
|
|
*/
|
|
task copyDebugAARToBin(type: Copy) {
|
|
task copyDebugAARToBin(type: Copy) {
|
|
- dependsOn ':lib:assembleDebug'
|
|
|
|
|
|
+ dependsOn ':lib:assembleToolsDisabledDebug'
|
|
from('lib/build/outputs/aar')
|
|
from('lib/build/outputs/aar')
|
|
into(binDir)
|
|
into(binDir)
|
|
include('godot-lib.debug.aar')
|
|
include('godot-lib.debug.aar')
|
|
@@ -92,7 +93,7 @@ task copyDebugAARToBin(type: Copy) {
|
|
* Depends on the library build task to ensure the AAR file is generated prior to copying.
|
|
* Depends on the library build task to ensure the AAR file is generated prior to copying.
|
|
*/
|
|
*/
|
|
task copyReleaseAARToAppModule(type: Copy) {
|
|
task copyReleaseAARToAppModule(type: Copy) {
|
|
- dependsOn ':lib:assembleRelease'
|
|
|
|
|
|
+ dependsOn ':lib:assembleToolsDisabledRelease'
|
|
from('lib/build/outputs/aar')
|
|
from('lib/build/outputs/aar')
|
|
into('app/libs/release')
|
|
into('app/libs/release')
|
|
include('godot-lib.release.aar')
|
|
include('godot-lib.release.aar')
|
|
@@ -103,7 +104,7 @@ task copyReleaseAARToAppModule(type: Copy) {
|
|
* Depends on the library build task to ensure the AAR file is generated prior to copying.
|
|
* Depends on the library build task to ensure the AAR file is generated prior to copying.
|
|
*/
|
|
*/
|
|
task copyReleaseAARToBin(type: Copy) {
|
|
task copyReleaseAARToBin(type: Copy) {
|
|
- dependsOn ':lib:assembleRelease'
|
|
|
|
|
|
+ dependsOn ':lib:assembleToolsDisabledRelease'
|
|
from('lib/build/outputs/aar')
|
|
from('lib/build/outputs/aar')
|
|
into(binDir)
|
|
into(binDir)
|
|
include('godot-lib.release.aar')
|
|
include('godot-lib.release.aar')
|
|
@@ -130,8 +131,12 @@ def templateExcludedBuildTask() {
|
|
def excludedTasks = []
|
|
def excludedTasks = []
|
|
if (!isAndroidStudio()) {
|
|
if (!isAndroidStudio()) {
|
|
logger.lifecycle("Excluding Android studio build tasks")
|
|
logger.lifecycle("Excluding Android studio build tasks")
|
|
- for (String buildType : supportedTargets) {
|
|
|
|
- excludedTasks += ":lib:" + getSconsTaskName(buildType)
|
|
|
|
|
|
+ for (String flavor : supportedFlavors) {
|
|
|
|
+ for (String buildType : supportedTargets) {
|
|
|
|
+ for (String abi : selectedAbis) {
|
|
|
|
+ excludedTasks += ":lib:" + getSconsTaskName(flavor, buildType, abi)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return excludedTasks
|
|
return excludedTasks
|
|
@@ -142,6 +147,10 @@ def templateBuildTasks() {
|
|
|
|
|
|
// Only build the apks and aar files for which we have native shared libraries.
|
|
// Only build the apks and aar files for which we have native shared libraries.
|
|
for (String target : supportedTargets) {
|
|
for (String target : supportedTargets) {
|
|
|
|
+ if (target == "release_debug") {
|
|
|
|
+ // 'release_debug' is not supported for generating templates.
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
File targetLibs = new File("lib/libs/" + target)
|
|
File targetLibs = new File("lib/libs/" + target)
|
|
if (targetLibs != null
|
|
if (targetLibs != null
|
|
&& targetLibs.isDirectory()
|
|
&& targetLibs.isDirectory()
|
|
@@ -167,6 +176,56 @@ def isAndroidStudio() {
|
|
return sysProps != null && sysProps['idea.platform.prefix'] != null
|
|
return sysProps != null && sysProps['idea.platform.prefix'] != null
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+task copyEditorDebugBinaryToBin(type: Copy) {
|
|
|
|
+ dependsOn ':editor:assembleDebug'
|
|
|
|
+ from('editor/build/outputs/apk/debug')
|
|
|
|
+ into(binDir)
|
|
|
|
+ include('android_editor_debug.apk')
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+task copyEditorRelease_debugBinaryToBin(type: Copy) {
|
|
|
|
+ dependsOn ':editor:assembleRelease_debug'
|
|
|
|
+ from('editor/build/outputs/apk/release_debug')
|
|
|
|
+ into(binDir)
|
|
|
|
+ include('android_editor_release_debug.apk')
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+task copyEditorReleaseBinaryToBin(type: Copy) {
|
|
|
|
+ dependsOn ':editor:assembleRelease'
|
|
|
|
+ from('editor/build/outputs/apk/release')
|
|
|
|
+ into(binDir)
|
|
|
|
+ include('android_editor_release.apk')
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * Generate the Godot Editor Android apk.
|
|
|
|
+ *
|
|
|
|
+ * Note: The Godot 'tools' shared libraries must have been generated (via scons) prior to running
|
|
|
|
+ * this gradle task. The task will only build the apk(s) for which the shared libraries is
|
|
|
|
+ * available.
|
|
|
|
+ */
|
|
|
|
+task generateGodotEditor {
|
|
|
|
+ gradle.startParameter.excludedTaskNames += templateExcludedBuildTask()
|
|
|
|
+
|
|
|
|
+ def tasks = []
|
|
|
|
+
|
|
|
|
+ for (String target : supportedTargets) {
|
|
|
|
+ if (target == "release") {
|
|
|
|
+ // Skip release for now since we need to provide signing information.
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+ File targetLibs = new File("lib/libs/tools/" + target)
|
|
|
|
+ if (targetLibs != null
|
|
|
|
+ && targetLibs.isDirectory()
|
|
|
|
+ && targetLibs.listFiles() != null
|
|
|
|
+ && targetLibs.listFiles().length > 0) {
|
|
|
|
+ tasks += "copyEditor${target.capitalize()}BinaryToBin"
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ dependsOn = tasks
|
|
|
|
+}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Master task used to coordinate the tasks defined above to generate the set of Godot templates.
|
|
* Master task used to coordinate the tasks defined above to generate the set of Godot templates.
|
|
*/
|
|
*/
|