From 872e03c9a622462d69b5173ffb5003934d034008 Mon Sep 17 00:00:00 2001 From: crueter Date: Mon, 19 Jan 2026 23:12:46 +0100 Subject: [PATCH] [android] exclude cpm cache from index, set default to mainline (#3340) Your radioactive computers get beat by an intel i5-2540M on a 5400RPM hard drive that exploded in my sleep btw Also sets mainline to default and gets rid of the horrific naming logic I had before. Signed-off-by: crueter Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3340 Reviewed-by: MaranBr Reviewed-by: Lizzie Reviewed-by: DraVee --- src/android/app/build.gradle.kts | 48 +++++++++----------- src/android/app/src/main/AndroidManifest.xml | 2 +- 2 files changed, 23 insertions(+), 27 deletions(-) diff --git a/src/android/app/build.gradle.kts b/src/android/app/build.gradle.kts index 61e817e546..1d34ec5f21 100644 --- a/src/android/app/build.gradle.kts +++ b/src/android/app/build.gradle.kts @@ -112,6 +112,9 @@ android { } } + // The app name is constructed with the appNameSuffix and appNameBase manifest placeholders + // suffix is used for build type--remember to include a space beforehand + // Define build types, which are orthogonal to product flavors. buildTypes { // Signed by release key, allowing for upload to Play Store. @@ -122,6 +125,8 @@ android { signingConfigs.getByName("default") } + manifestPlaceholders += mapOf("appNameSuffix" to "") + isMinifyEnabled = true isDebuggable = false proguardFiles( @@ -140,6 +145,9 @@ android { getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" ) + + manifestPlaceholders += mapOf("appNameSuffix" to " Debug Release") + versionNameSuffix = "-relWithDebInfo" applicationIdSuffix = ".relWithDebInfo" isJniDebuggable = true @@ -153,13 +161,20 @@ android { isJniDebuggable = true versionNameSuffix = "-debug" applicationIdSuffix = ".debug" + + manifestPlaceholders += mapOf("appNameSuffix" to " Debug") } } + // appNameBase is used for the primary identifier + // this should be "Eden " flavorDimensions.add("version") productFlavors { create("mainline") { dimension = "version" + isDefault = true + + manifestPlaceholders += mapOf("appNameBase" to "Eden") resValue("string", "app_name_suffixed", "Eden") ndk { @@ -169,6 +184,7 @@ android { create("genshinSpoof") { dimension = "version" + manifestPlaceholders += mapOf("appNameBase" to "Eden Optimized") resValue("string", "app_name_suffixed", "Eden Optimized") applicationId = "com.miHoYo.Yuanshen" @@ -179,6 +195,7 @@ android { create("legacy") { dimension = "version" + manifestPlaceholders += mapOf("appNameBase" to "Eden Legacy") resValue("string", "app_name_suffixed", "Eden Legacy") applicationId = "dev.legacy.eden_emulator" @@ -201,7 +218,8 @@ android { create("chromeOS") { dimension = "version" - resValue("string", "app_name_suffixed", "Eden") + manifestPlaceholders += mapOf("appNameBase" to "Eden ChromeOS") + resValue("string", "app_name_suffixed", "Eden ChromeOS") ndk { abiFilters += listOf("x86_64") @@ -215,31 +233,6 @@ android { } } - // this is really annoying but idk any other ways to fix this behavior - applicationVariants.all { - val variant = this - when { - variant.flavorName == "legacy" && variant.buildType.name == "debug" -> { - variant.resValue("string", "app_name_suffixed", "Eden Legacy Debug") - } - variant.flavorName == "mainline" && variant.buildType.name == "debug" -> { - variant.resValue("string", "app_name_suffixed", "Eden Debug") - } - variant.flavorName == "genshinSpoof" && variant.buildType.name == "debug" -> { - variant.resValue("string", "app_name_suffixed", "Eden Optimized Debug") - } - variant.flavorName == "legacy" && variant.buildType.name == "relWithDebInfo" -> { - variant.resValue("string", "app_name_suffixed", "Eden Legacy Debug Release") - } - variant.flavorName == "mainline" && variant.buildType.name == "relWithDebInfo" -> { - variant.resValue("string", "app_name_suffixed", "Eden Debug Release") - } - variant.flavorName == "genshinSpoof" && variant.buildType.name == "relWithDebInfo" -> { - variant.resValue("string", "app_name_suffixed", "Eden Optimized Debug Release") - } - } - } - externalNativeBuild { cmake { version = "3.22.1" @@ -252,6 +245,9 @@ idea { module { // Inclusion to exclude build/ dir from non-Android excludeDirs.add(file("${edenDir}/build")) + + // also exclude CPM cache from automatic indexing + excludeDirs.add(file("${edenDir}/.cache")) } } diff --git a/src/android/app/src/main/AndroidManifest.xml b/src/android/app/src/main/AndroidManifest.xml index 13007f10e4..c642dbdcda 100644 --- a/src/android/app/src/main/AndroidManifest.xml +++ b/src/android/app/src/main/AndroidManifest.xml @@ -35,7 +35,7 @@ SPDX-License-Identifier: GPL-3.0-or-later