aboutsummaryrefslogtreecommitdiff
path: root/src/android/app
diff options
context:
space:
mode:
authorcrueter <crueter@eden-emu.dev>2025-12-03 06:40:11 +0100
committercrueter <crueter@eden-emu.dev>2025-12-03 06:40:11 +0100
commitfe8017734b48eaf092ebe4e4930c4d9a48a586c6 (patch)
treed3bff61e50524ca1bf313641a0f02565981c5e8c /src/android/app
parent33ee9de85a49c381b84b84d23c931301afaa4a8e (diff)
[cmake, externals] android x86_64 support (#3086)
Updates all of our bundled CI deps to support android x86_64, adds a build flavor thereof (`chromeOS`), and also adds sirit mingw support. The new FFmpeg package is built in a much better way that actually makes it identically built to the other CI packages, meaning we now have real 8.0.0 support, no need for libvpx/cpu_features/all that other crap. PLUS, we can now statically link it! Hooray! It's also built with MediaCodec support so in the future we can work on that. Rewrote the android build script too, plus added a copyFlavorTypeOutput target that assembles and copies the APK. The code behind it sucks because I'm not great with Gradle but hey, it works. Testers: please test everything related to video decoding. VP9 and h264, games that normally suck with their prerendered stuff, make sure I didn't nuke it to oblivion, etc. Signed-off-by: crueter <crueter@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3086 Reviewed-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Reviewed-by: Lizzie <lizzie@eden-emu.dev>
Diffstat (limited to 'src/android/app')
-rw-r--r--src/android/app/build.gradle.kts71
1 files changed, 63 insertions, 8 deletions
diff --git a/src/android/app/build.gradle.kts b/src/android/app/build.gradle.kts
index 01a413261e..87d815c92c 100644
--- a/src/android/app/build.gradle.kts
+++ b/src/android/app/build.gradle.kts
@@ -4,10 +4,11 @@
// SPDX-FileCopyrightText: Copyright yuzu/Citra Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
-import android.annotation.SuppressLint
+// import android.annotation.SuppressLint
import kotlin.collections.setOf
import org.jlleitschuh.gradle.ktlint.reporter.ReporterType
import com.github.triplet.gradle.androidpublisher.ReleaseStatus
+import org.gradle.api.tasks.Copy
plugins {
id("com.android.application")
@@ -63,11 +64,6 @@ android {
versionName = getGitVersion()
versionCode = autoVersion
- ndk {
- @SuppressLint("ChromeOsAbiSupport")
- abiFilters += listOf("arm64-v8a")
- }
-
externalNativeBuild {
cmake {
val extraCMakeArgs =
@@ -127,7 +123,7 @@ android {
isMinifyEnabled = true
isDebuggable = false
proguardFiles(
- getDefaultProguardFile("proguard-android.txt"),
+ getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
@@ -139,7 +135,7 @@ android {
signingConfig = signingConfigs.getByName("default")
isDebuggable = true
proguardFiles(
- getDefaultProguardFile("proguard-android.txt"),
+ getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
versionNameSuffix = "-relWithDebInfo"
@@ -163,12 +159,20 @@ android {
create("mainline") {
dimension = "version"
resValue("string", "app_name_suffixed", "Eden")
+
+ ndk {
+ abiFilters += listOf("arm64-v8a")
+ }
}
create("genshinSpoof") {
dimension = "version"
resValue("string", "app_name_suffixed", "Eden Optimized")
applicationId = "com.miHoYo.Yuanshen"
+
+ ndk {
+ abiFilters += listOf("arm64-v8a")
+ }
}
create("legacy") {
@@ -187,6 +191,25 @@ android {
res.srcDirs("src/main/legacy")
}
}
+
+ ndk {
+ abiFilters += listOf("arm64-v8a")
+ }
+ }
+
+ create("chromeOS") {
+ dimension = "version"
+ resValue("string", "app_name_suffixed", "Eden")
+
+ ndk {
+ abiFilters += listOf("x86_64")
+ }
+
+ externalNativeBuild {
+ cmake {
+ abiFilters("x86_64")
+ }
+ }
}
}
@@ -321,3 +344,35 @@ fun getGitVersion(): String {
}
return versionName.ifEmpty { "0.0" }
}
+
+afterEvaluate {
+ val artifactsDir = layout.projectDirectory.dir("../../../artifacts")
+ val outputsDir = layout.buildDirectory.dir("outputs").get()
+
+ android.applicationVariants.forEach { variant ->
+ val variantName = variant.name
+ val variantTask = variantName.replaceFirstChar { it.uppercaseChar() }
+
+ val flavor = variant.flavorName
+ val type = variant.buildType.name
+
+ val baseName = "app-$flavor-$type"
+
+ val apkFile = outputsDir.file("apk/$flavor/$type/$baseName.apk")
+ val aabFile = outputsDir.file("bundle/$variantName/$baseName.aab")
+
+ val taskName = "copy${variantTask}Outputs"
+
+ tasks.register<Copy>(taskName) {
+ group = "publishing"
+ description = "Copy APK and AAB for $variantName to $artifactsDir"
+
+ from(apkFile)
+ from(aabFile)
+ into(artifactsDir)
+
+ dependsOn("assemble${variantTask}")
+ dependsOn("bundle${variantTask}")
+ }
+ }
+}