Godot Engine – Multi-platform 2D and 3D game engine
Cleanup generation of the export template
Fredia Huya-Kouadio845857b7b5be
diff --git a/platform/android/java/app/build.gradle b/platform/android/java/app/build.gradleindex 007968b6cf3..78401a06f6b 100644--- a/platform/android/java/app/build.gradle+++ b/platform/android/java/app/build.gradle@@ -43,8 +43,18 @@ dependencies {implementation "androidx.core:core-splashscreen:$versions.splashscreenVersion"implementation "androidx.documentfile:documentfile:$versions.documentfileVersion"- implementation project(":dataLib")- implementation project(":fusedDepsLib")+ // Check if we have an exported project AAR to be used as the app core.+ // This is mostly used for development. See https://docs.godotengine.org/en/latest/engine_details/development/configuring_an_ide/android_studio.html#building-debugging-the-app-module+ String exportedProjectAARDirPath = "libs/exportedProjectAAR"+ File exportedProjectAARDir = file(exportedProjectAARDirPath)+ String[] exportedProjectAARFiles = exportedProjectAARDir.exists() ? exportedProjectAARDir.list() : null+ boolean hasExportedProjectAAR = exportedProjectAARFiles != null && exportedProjectAARFiles.length > 0+ if (hasExportedProjectAAR) {+ implementation fileTree(dir: exportedProjectAARDirPath, include: ["**/*.jar", "**/*.aar"])+ } else {+ implementation project(":dataLib")+ implementation project(":fusedDepsLib")+ }if (rootProject.findProject(":lib")) {implementation project(":lib")@@ -53,8 +63,8 @@ dependencies {} else {// Godot gradle build mode. In this scenario this project is the only one around and the Godot// library is available through the pre-generated godot-lib.*.aar android archive files.- debugImplementation fileTree(dir: 'libs/debug', include: ['**/*.jar', '*.aar'])- releaseImplementation fileTree(dir: 'libs/release', include: ['**/*.jar', '*.aar'])+ debugImplementation fileTree(dir: 'libs/debug', include: ['**/*.jar', '**/*.aar'])+ releaseImplementation fileTree(dir: 'libs/release', include: ['**/*.jar', '**/*.aar'])}// Godot user plugins remote dependenciesdiff --git a/platform/android/java/app/dataLib/build.gradle b/platform/android/java/app/dataLib/build.gradleindex a35ec09c9fe..633ea3414d5 100644--- a/platform/android/java/app/dataLib/build.gradle+++ b/platform/android/java/app/dataLib/build.gradle@@ -14,8 +14,8 @@ dependencies {} else {// Godot gradle build mode. In this scenario this project is the only one around and the Godot// library is available through the pre-generated godot-lib.*.aar android archive files.- debugCompileOnly fileTree(dir: '../libs/debug', include: ['**/*.jar', '*.aar'])- releaseCompileOnly fileTree(dir: '../libs/release', include: ['**/*.jar', '*.aar'])+ debugCompileOnly fileTree(dir: '../libs/debug', include: ['**/*.jar', '**/*.aar'])+ releaseCompileOnly fileTree(dir: '../libs/release', include: ['**/*.jar', '**/*.aar'])}}diff --git a/platform/android/java/build.gradle b/platform/android/java/build.gradleindex 5182459a6a1..23c2ba5619f 100644--- a/platform/android/java/build.gradle+++ b/platform/android/java/build.gradle@@ -61,7 +61,16 @@ task zipGradleBuild(type: Zip) {doFirst {logger.lifecycle("Generating Godot gradle build template")}- from(fileTree(dir: 'app', excludes: ['**/build/**', '**/.gradle/**', '**/*.iml']), fileTree(dir: '.', includes: ['gradlew', 'gradlew.bat', 'gradle/**']))+ from(fileTree(dir: 'app', excludes: [+ 'dataLib/src/main/assets/**',+ 'libs/exportedProjectAAR/**',+ 'src/androidTestInstrumented/**',+ 'src/instrumented/**',+ 'src/main/assets/**',+ '**/build/**',+ '**/.gradle/**',+ '**/*.iml'+ ]), fileTree(dir: '.', includes: ['gradlew', 'gradlew.bat', 'gradle/**']))include '**/*'archiveFileName = 'android_source.zip'destinationDirectory = file(binDir)