summaryrefslogtreecommitdiffstats
path: root/platform/android/java
diff options
context:
space:
mode:
authorFredia Huya-Kouadio <fhuya@meta.com>2024-04-30 14:09:24 -0700
committerFredia Huya-Kouadio <fhuyakou@gmail.com>2024-05-31 06:21:16 -0700
commitd38c5b67377f453f9c126dde24e10aa1a2c891bd (patch)
treec6bd3f541530cf496ef54a7d220e9b6cc7a49f40 /platform/android/java
parent0342900b7727aa3007a4233502fee1dd94b7415d (diff)
downloadredot-engine-d38c5b67377f453f9c126dde24e10aa1a2c891bd.tar.gz
Clean up the build commands used by the editor for gradle builds
Diffstat (limited to 'platform/android/java')
-rw-r--r--platform/android/java/app/build.gradle68
-rw-r--r--platform/android/java/app/config.gradle16
2 files changed, 27 insertions, 57 deletions
diff --git a/platform/android/java/app/build.gradle b/platform/android/java/app/build.gradle
index bde6a93c86..939a39f3c9 100644
--- a/platform/android/java/app/build.gradle
+++ b/platform/android/java/app/build.gradle
@@ -210,70 +210,24 @@ android {
}
}
-task copyAndRenameDebugApk(type: Copy) {
+task copyAndRenameBinary(type: Copy) {
// The 'doNotTrackState' is added to disable gradle's up-to-date checks for output files
// and directories. Otherwise this check may cause permissions access failures on Windows
// machines.
doNotTrackState("No need for up-to-date checks for the copy-and-rename operation")
- from "$buildDir/outputs/apk/debug/android_debug.apk"
- into getExportPath()
- rename "android_debug.apk", getExportFilename()
-}
+ String exportPath = getExportPath()
+ String exportFilename = getExportFilename()
+ String exportBuildType = getExportBuildType()
+ String exportFormat = getExportFormat()
-task copyAndRenameDevApk(type: Copy) {
- // The 'doNotTrackState' is added to disable gradle's up-to-date checks for output files
- // and directories. Otherwise this check may cause permissions access failures on Windows
- // machines.
- doNotTrackState("No need for up-to-date checks for the copy-and-rename operation")
-
- from "$buildDir/outputs/apk/dev/android_dev.apk"
- into getExportPath()
- rename "android_dev.apk", getExportFilename()
-}
-
-task copyAndRenameReleaseApk(type: Copy) {
- // The 'doNotTrackState' is added to disable gradle's up-to-date checks for output files
- // and directories. Otherwise this check may cause permissions access failures on Windows
- // machines.
- doNotTrackState("No need for up-to-date checks for the copy-and-rename operation")
-
- from "$buildDir/outputs/apk/release/android_release.apk"
- into getExportPath()
- rename "android_release.apk", getExportFilename()
-}
-
-task copyAndRenameDebugAab(type: Copy) {
- // The 'doNotTrackState' is added to disable gradle's up-to-date checks for output files
- // and directories. Otherwise this check may cause permissions access failures on Windows
- // machines.
- doNotTrackState("No need for up-to-date checks for the copy-and-rename operation")
-
- from "$buildDir/outputs/bundle/debug/build-debug.aab"
- into getExportPath()
- rename "build-debug.aab", getExportFilename()
-}
-
-task copyAndRenameDevAab(type: Copy) {
- // The 'doNotTrackState' is added to disable gradle's up-to-date checks for output files
- // and directories. Otherwise this check may cause permissions access failures on Windows
- // machines.
- doNotTrackState("No need for up-to-date checks for the copy-and-rename operation")
-
- from "$buildDir/outputs/bundle/dev/build-dev.aab"
- into getExportPath()
- rename "build-dev.aab", getExportFilename()
-}
-
-task copyAndRenameReleaseAab(type: Copy) {
- // The 'doNotTrackState' is added to disable gradle's up-to-date checks for output files
- // and directories. Otherwise this check may cause permissions access failures on Windows
- // machines.
- doNotTrackState("No need for up-to-date checks for the copy-and-rename operation")
+ boolean isAab = exportFormat == "aab"
+ String sourceFilepath = isAab ? "$buildDir/outputs/bundle/$exportBuildType/build-${exportBuildType}.aab" : "$buildDir/outputs/apk/$exportBuildType/android_${exportBuildType}.apk"
+ String sourceFilename = isAab ? "build-${exportBuildType}.aab" : "android_${exportBuildType}.apk"
- from "$buildDir/outputs/bundle/release/build-release.aab"
- into getExportPath()
- rename "build-release.aab", getExportFilename()
+ from sourceFilepath
+ into exportPath
+ rename sourceFilename, exportFilename
}
/**
diff --git a/platform/android/java/app/config.gradle b/platform/android/java/app/config.gradle
index c404af34d8..0e367dfb22 100644
--- a/platform/android/java/app/config.gradle
+++ b/platform/android/java/app/config.gradle
@@ -223,6 +223,22 @@ ext.getExportFilename = {
return exportFilename
}
+ext.getExportBuildType = {
+ String exportBuildType = project.hasProperty("export_build_type") ? project.property("export_build_type") : ""
+ if (exportBuildType == null || exportBuildType.isEmpty()) {
+ exportBuildType = "debug"
+ }
+ return exportBuildType
+}
+
+ext.getExportFormat = {
+ String exportFormat = project.hasProperty("export_format") ? project.property("export_format") : ""
+ if (exportFormat == null || exportFormat.isEmpty()) {
+ exportFormat = "apk"
+ }
+ return exportFormat
+}
+
/**
* Parse the project properties for the 'plugins_maven_repos' property and return the list
* of maven repos.