mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-09-20 17:51:13 +02:00
Add build variants/flavors
This commit is contained in:
@@ -23,7 +23,8 @@ android {
|
|||||||
|
|
||||||
externalNativeBuild {
|
externalNativeBuild {
|
||||||
cmake {
|
cmake {
|
||||||
cppFlags "-std=c++20 -O3 -fno-math-errno -fno-trapping-math -fno-signed-zeros -ffinite-math-only -march=armv8-a"
|
cppFlags "-std=c++20 -O3",
|
||||||
|
"-fno-math-errno -fno-trapping-math -fno-signed-zeros -ffinite-math-only"
|
||||||
arguments "-DANDROID_STL=c++_shared",
|
arguments "-DANDROID_STL=c++_shared",
|
||||||
"-DCMAKE_BUILD_TYPE=Release",
|
"-DCMAKE_BUILD_TYPE=Release",
|
||||||
"-DANDROID_ARM_NEON=TRUE",
|
"-DANDROID_ARM_NEON=TRUE",
|
||||||
@@ -34,17 +35,62 @@ android {
|
|||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
minifyEnabled false
|
// minifyEnabled false
|
||||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
// proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||||
signingConfig = signingConfigs.debug
|
signingConfig = signingConfigs.debug
|
||||||
debuggable false
|
debuggable false
|
||||||
jniDebuggable false
|
jniDebuggable false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def deviceFlavors = [
|
||||||
|
armv8 : "-march=armv8-a",
|
||||||
|
armv82 : "-march=armv8.2-a",
|
||||||
|
armv87 : "-march=armv8.7-a",
|
||||||
|
sd8eg5 : "-march=armv8.7-a+sve+sve2",
|
||||||
|
]
|
||||||
|
|
||||||
|
flavorDimensions "appid", "device"
|
||||||
|
productFlavors {
|
||||||
|
mainline {
|
||||||
|
dimension "appid"
|
||||||
|
applicationId "org.kenjinx.android"
|
||||||
|
manifestPlaceholders = [applicationLabel: "@string/app_name"]
|
||||||
|
}
|
||||||
|
optimized {
|
||||||
|
dimension "appid"
|
||||||
|
applicationId "com.garena.game.codm"
|
||||||
|
manifestPlaceholders = [applicationLabel: "@string/app_name_optimized"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
deviceFlavors.each { name, flags ->
|
||||||
|
productFlavors.create(name) {
|
||||||
|
dimension "device"
|
||||||
|
externalNativeBuild {
|
||||||
|
cmake {
|
||||||
|
cppFlags flags
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
androidComponents {
|
androidComponents {
|
||||||
onVariants(selector().withBuildType("release")) {
|
onVariants(selector().withBuildType("debug")) {
|
||||||
packaging.dex.useLegacyPackaging.set(true)
|
packaging.dex.useLegacyPackaging.set(false)
|
||||||
|
}
|
||||||
|
beforeVariants(selector().all()) { variant ->
|
||||||
|
def flavors = variant.productFlavors.collect { it.second }.toSet()
|
||||||
|
|
||||||
|
def invalidCombos = [
|
||||||
|
["optimized", "armv8"],
|
||||||
|
["optimized", "armv87"],
|
||||||
|
["optimized", "sd8eg5"]
|
||||||
|
]
|
||||||
|
|
||||||
|
if (invalidCombos.any { combo -> flavors.containsAll(combo) }) {
|
||||||
|
enable = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,6 +110,9 @@ android {
|
|||||||
keepDebugSymbols += '**/libkenjinx.so'
|
keepDebugSymbols += '**/libkenjinx.so'
|
||||||
useLegacyPackaging true
|
useLegacyPackaging true
|
||||||
}
|
}
|
||||||
|
dex {
|
||||||
|
useLegacyPackaging true
|
||||||
|
}
|
||||||
resources {
|
resources {
|
||||||
excludes += '/META-INF/{AL2.0,LGPL2.1}'
|
excludes += '/META-INF/{AL2.0,LGPL2.1}'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
android:fullBackupContent="@xml/backup_rules"
|
android:fullBackupContent="@xml/backup_rules"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:isGame="true"
|
android:isGame="true"
|
||||||
android:label="@string/app_name"
|
android:label="${applicationLabel}"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/Theme.KenjinxAndroid"
|
android:theme="@style/Theme.KenjinxAndroid"
|
||||||
android:largeHeap="true"
|
android:largeHeap="true"
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">Kenji-NX</string>
|
<string name="app_name">Kenji-NX</string>
|
||||||
|
<string name="app_name_optimized">Kenji-NX Optimized</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -118,7 +118,6 @@ tasks.register('compileLibKenjinx', Exec) {
|
|||||||
baseArgs.addAll([
|
baseArgs.addAll([
|
||||||
"-p:IlcOptimizationPreference=Speed",
|
"-p:IlcOptimizationPreference=Speed",
|
||||||
"-p:IlcOptimizationLevel=3",
|
"-p:IlcOptimizationLevel=3",
|
||||||
"-p:IlcFoldIdenticalMethodBodies=true",
|
|
||||||
"-p:IlcGenerateStackTraceData=false",
|
"-p:IlcGenerateStackTraceData=false",
|
||||||
"-p:TrimMode=full",
|
"-p:TrimMode=full",
|
||||||
"-p:IlcTrimMetadata=true",
|
"-p:IlcTrimMetadata=true",
|
||||||
|
|||||||
Reference in New Issue
Block a user