Files
CloudHome-Ops/android/app/build.gradle

56 lines
1.9 KiB
Groovy

plugins {
id "com.android.application"
id "kotlin-android"
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id "dev.flutter.flutter-gradle-plugin"
}
// The `flutter` Gradle extension is shadowed by a stale convention property on Gradle 8.3,
// so we resolve it explicitly instead of relying on the `project.flutter` shorthand.
def flutterExt = project.extensions.getByName("flutter")
android {
namespace = "com.tongshi.cloudhome"
compileSdk = flutterExt.compileSdkVersion
ndkVersion = flutterExt.ndkVersion
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "com.tongshi.cloudhome"
// You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = flutterExt.minSdkVersion
targetSdk = flutterExt.targetSdkVersion
versionCode = flutterExt.versionCode
versionName = flutterExt.versionName
}
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.debug
}
}
// 规避 Windows 下 packageReleaseResources 删除目录时文件被占用导致构建失败。
tasks.configureEach { task ->
if (task.name == 'packageReleaseResources') {
task.doFirst {
delete "${buildDir}/intermediates/incremental/release/packageReleaseResources"
}
}
}
}
flutterExt.source = "../.."