Files
lingjhf aa5255d1e4
Gitea CI / Build Windows x64 app (push) Successful in 2m38s
Gitea CI / Check code and tests (push) Successful in 5m19s
Gitea CI / Build Android APK (push) Successful in 3m13s
Gitea CI / Audit and package Windows x64 (push) Successful in 2m49s
Gitea CI / Assemble and validate CI artifacts (push) Successful in 59s
Gitea CI / Gitea CI passed (push) Successful in 2s
fix(preview): 接入已合并 SDK 与 Android 0.1.3 预览验证 (#12)
2026-10-07 18:30:29 +00:00

101 lines
3.9 KiB
Kotlin

plugins {
id("com.android.application")
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id("dev.flutter.flutter-gradle-plugin")
}
// Match native libraries to Flutter's requested targets; the media runtime is 64-bit only.
val supportedAndroidAbis = mapOf(
"android-arm64" to "arm64-v8a",
"android-x64" to "x86_64",
)
val requestedAndroidPlatforms = (findProperty("target-platform") as? String)
?.split(",") ?: supportedAndroidAbis.keys.toList()
val enabledAndroidAbis = requestedAndroidPlatforms.mapNotNull(supportedAndroidAbis::get)
check(enabledAndroidAbis.isNotEmpty()) {
"Cutdex requires Android ARM64 or x86_64. Use --target-platform android-arm64,android-x64."
}
android {
namespace = "com.example.cutdex"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion
buildFeatures {
resValues = true
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "com.example.cutdex"
manifestPlaceholders["cutdexPreviewReverseCacheMiB"] = "0"
manifestPlaceholders["cutdexNativeSurfacePreview"] = "false"
// You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = 31
targetSdk = flutter.targetSdkVersion
// Uses the version code from pubspec.yaml. When using split APKs, 1000 * ABI_VERSION
// is added automatically by Flutter. (https://developer.android.com/studio/build/configure-apk-splits#configure-APK-versions)
// You can force using the value of versionCode by specifying the `-P force-version-code-ignoring-abi=true`
// flag during build.
versionCode = flutter.versionCode
versionName = flutter.versionName
}
flavorDimensions += "environment"
productFlavors {
create("development") {
dimension = "environment"
applicationIdSuffix = ".dev"
// Device validation can coexist with an app signed on another machine.
val validationId = providers.gradleProperty("cutdexValidationApplicationId")
.orElse(providers.environmentVariable("CUTDEX_VALIDATION_APPLICATION_ID")).orNull
if (validationId != null) applicationId = validationId
resValue("string", "app_name", if (validationId == null) "Cutdex Dev" else "Cutdex Decoder Test")
manifestPlaceholders["cutdexPreviewReverseCacheMiB"] = providers
.gradleProperty("cutdexPreviewReverseCacheMiB")
.orElse(providers.environmentVariable("CUTDEX_PREVIEW_REVERSE_CACHE_MIB")).getOrElse("0")
manifestPlaceholders["cutdexNativeSurfacePreview"] = providers
.gradleProperty("cutdexNativeSurfacePreview")
.orElse(providers.environmentVariable("CUTDEX_NATIVE_SURFACE_PREVIEW")).getOrElse("false")
}
create("production") {
dimension = "environment"
resValue("string", "app_name", "Cutdex")
}
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig = signingConfigs.getByName("debug")
}
}
if (splits.abi.isEnable) {
splits.abi.reset()
splits.abi.include(*enabledAndroidAbis.toTypedArray())
} else {
defaultConfig.ndk {
abiFilters.clear()
abiFilters += enabledAndroidAbis
}
}
}
kotlin {
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
}
}
flutter {
source = "../.."
}