mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-09-22 18:41:13 +02:00
176 lines
5.6 KiB
Groovy
176 lines
5.6 KiB
Groovy
plugins {
|
|
id 'com.android.application'
|
|
id 'org.jetbrains.kotlin.plugin.compose'
|
|
}
|
|
|
|
android {
|
|
namespace = 'org.kenjinx.android'
|
|
compileSdk 36
|
|
|
|
defaultConfig {
|
|
applicationId "org.kenjinx.android"
|
|
minSdk 29
|
|
targetSdk 36
|
|
versionCode 20100
|
|
versionName '2.1.0-pr.2'
|
|
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
|
|
ndk {
|
|
//noinspection ChromeOsAbiSupport
|
|
abiFilters 'arm64-v8a'
|
|
}
|
|
|
|
externalNativeBuild {
|
|
cmake {
|
|
cppFlags "-std=c++20 -O3",
|
|
"-fno-math-errno -fno-trapping-math -fno-signed-zeros -ffinite-math-only"
|
|
arguments "-DANDROID_STL=c++_shared",
|
|
"-DCMAKE_BUILD_TYPE=Release",
|
|
"-DANDROID_ARM_NEON=TRUE",
|
|
"-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON"
|
|
}
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
// minifyEnabled false
|
|
// proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
signingConfig = signingConfigs.debug
|
|
debuggable 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 {
|
|
onVariants(selector().withBuildType("debug")) {
|
|
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
|
|
}
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_21
|
|
targetCompatibility JavaVersion.VERSION_21
|
|
}
|
|
|
|
buildFeatures {
|
|
compose = true
|
|
prefab = true
|
|
buildConfig = true
|
|
}
|
|
|
|
packagingOptions {
|
|
jniLibs {
|
|
keepDebugSymbols += '**/libkenjinx.so'
|
|
useLegacyPackaging true
|
|
}
|
|
dex {
|
|
useLegacyPackaging true
|
|
}
|
|
resources {
|
|
excludes += '/META-INF/{AL2.0,LGPL2.1}'
|
|
}
|
|
}
|
|
|
|
externalNativeBuild {
|
|
cmake {
|
|
path file('src/main/cpp/CMakeLists.txt')
|
|
version = '4.2.3'
|
|
}
|
|
}
|
|
|
|
sourceSets {
|
|
main {
|
|
jniLibs.srcDirs = ['src/main/extLibs', 'src/main/jniLibs']
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.named("preBuild") {
|
|
dependsOn ':libkenjinx:assemble'
|
|
}
|
|
|
|
dependencies {
|
|
runtimeOnly project(":libkenjinx")
|
|
implementation 'androidx.activity:activity-compose:1.13.0'
|
|
implementation 'androidx.appcompat:appcompat:1.7.1'
|
|
implementation 'androidx.compose.material3:material3'
|
|
implementation 'androidx.compose.material:material-icons-extended:1.7.8'
|
|
implementation 'androidx.compose.ui:ui'
|
|
implementation 'androidx.compose.ui:ui-graphics'
|
|
implementation 'androidx.compose.ui:ui-tooling-preview'
|
|
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
|
|
implementation 'androidx.core:core-ktx:1.18.0'
|
|
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.10.0'
|
|
implementation 'androidx.navigation:navigation-compose:2.9.7'
|
|
implementation 'androidx.preference:preference-ktx:1.2.1'
|
|
implementation 'br.com.devsrsouza.compose.icons:css-gg:1.1.1'
|
|
implementation 'com.anggrayudi:storage:2.2.0'
|
|
implementation 'com.github.swordfish90:radialgamepad:2.0.0'
|
|
implementation 'com.google.android.material:material:1.13.0'
|
|
implementation 'com.google.code.gson:gson:2.13.2'
|
|
implementation 'com.halilibo.compose-richtext:richtext-commonmark:0.20.0'
|
|
implementation 'com.halilibo.compose-richtext:richtext-ui-material3:0.20.0'
|
|
implementation 'com.halilibo.compose-richtext:richtext-ui:0.20.0'
|
|
implementation 'io.coil-kt:coil-compose:2.7.0'
|
|
implementation 'net.java.dev.jna:jna:5.18.1@aar'
|
|
implementation 'net.lingala.zip4j:zip4j:2.11.6'
|
|
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2'
|
|
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2'
|
|
implementation platform('androidx.compose:compose-bom:2026.03.01')
|
|
implementation platform('org.jetbrains.kotlin:kotlin-bom:2.3.10')
|
|
androidTestImplementation 'androidx.compose.ui:ui-test-junit4'
|
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.7.0'
|
|
androidTestImplementation 'androidx.test.ext:junit:1.3.0'
|
|
androidTestImplementation platform('androidx.compose:compose-bom:2026.03.01')
|
|
testImplementation 'junit:junit:4.13.2'
|
|
debugImplementation 'androidx.compose.ui:ui-test-manifest'
|
|
debugImplementation 'androidx.compose.ui:ui-tooling'
|
|
}
|