111 lines
3.4 KiB
Groovy
Raw Normal View History

2023-07-10 17:50:31 +08:00
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
// throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
throw new Exception("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
2023-07-10 17:50:31 +08:00
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'com.aliyun.ams.emas-services' // 引用emas-services插件
2023-07-10 17:50:31 +08:00
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
lintOptions{
checkReleaseBuilds false
abortOnError false
}
2023-07-10 17:50:31 +08:00
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
2023-09-28 18:05:23 +08:00
2023-07-10 17:50:31 +08:00
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
2024-01-18 13:49:19 +08:00
applicationId "cn.starlock.lock"
2023-07-10 17:50:31 +08:00
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
2023-08-08 09:42:35 +08:00
// minSdkVersion flutter.minSdkVersion
// targetSdkVersion flutter.targetSdkVersion
minSdkVersion 25
targetSdkVersion 33
2023-07-10 17:50:31 +08:00
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
2023-09-28 18:05:23 +08:00
ndk {
//设置支持的SO库架构开发者可以根据需要选择一个或多个平台的so
abiFilters "armeabi", "armeabi-v7a", "arm64-v8a", "x86","x86_64"
}
2023-07-10 17:50:31 +08:00
}
2023-09-28 18:05:23 +08:00
signingConfigs {
release {
storeFile file("starlock.keystore")
storePassword '123456'
keyAlias = 'starlock'
keyPassword '123456'
}
debug {
storeFile file("starlock.keystore")
storePassword '123456'
keyAlias = 'starlock'
keyPassword '123456'
}
}
2023-07-10 17:50:31 +08:00
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
2023-09-28 18:05:23 +08:00
signingConfig signingConfigs.release
}
debug {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --debug` works.
2023-07-10 17:50:31 +08:00
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
2023-09-28 18:05:23 +08:00
implementation('com.amap.api:location:5.6.0')
implementation('com.amap.api:3dmap:8.1.0')
implementation 'com.aliyun.ams:alicloud-android-push:3.1.9.1'
2023-07-10 17:50:31 +08:00
}