Port Android server runtime to GaCy Go

This commit is contained in:
CAtlas0784 committed 2026-11-02 02:39:37 +07:00
1 parent 92a4b4f545
commit 3c1186c781
20 files changed
+830 -798

No files matched your search

+38 -5
View File
@@ -12,20 +12,21 @@ android {
applicationId = "com.gacy.android"
minSdk = 26
targetSdk = 35
versionCode = 1
versionName = "v1.0.0"
versionCode = 7
versionName = "v1.0.6"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
ndk {
abiFilters += listOf("arm64-v8a")
if (providers.gradleProperty("gacyEmulator").isPresent) abiFilters += "x86_64"
}
}
sourceSets {
getByName("main") {
jniLibs.srcDirs("src/main/jniLibs")
assets.srcDirs("src/main/assets")
assets.setSrcDirs(listOf("src/goAssets"))
}
}
@@ -50,11 +51,16 @@ android {
compose = true
buildConfig = true
}
packaging {
jniLibs {
useLegacyPackaging = true
keepDebugSymbols += "**/libgacy_*.so"
excludes += listOf("**/libchaquopy*.so", "**/libpython*.so", "**/libcrypto_*.so", "**/libsqlite3_*.so", "**/libssl_*.so")
}
}
}
dependencies {
implementation(files("libs/chaquopy_java.jar"))
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation("androidx.lifecycle:lifecycle-service:2.8.6")
@@ -72,3 +78,30 @@ dependencies {
testImplementation("org.json:json:20240303")
debugImplementation(libs.androidx.ui.tooling)
}
tasks.named("preBuild") {
doFirst {
val required = listOf(
"src/goAssets/gacy-go-data.zip",
"src/main/jniLibs/arm64-v8a/libgacy_sdkserver.so",
"src/main/jniLibs/arm64-v8a/libgacy_gameserver.so"
)
check(required.all { file(it).isFile }) {
"GaCy Go runtime is missing. Run: python tools/package_go_runtime.py <path-to-GaC-hkrpg-go>"
}
}
}
val copyDebugApkToRoot by tasks.registering {
doNotTrackState("Copies the APK into the project root")
onlyIf { tasks.named("assembleDebug").get().state.failure == null }
doLast {
val source = layout.buildDirectory.file("outputs/apk/debug/app-debug.apk").get().asFile
check(source.isFile) { "Debug APK was not produced" }
source.copyTo(rootProject.file("GaCy-Android-${android.defaultConfig.versionName}-debug.apk"), overwrite = true)
}
}
tasks.matching { it.name == "assembleDebug" }.configureEach {
finalizedBy(copyDebugApkToRoot)
}