160 lines
5.1 KiB
Groovy
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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.")
}
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插件
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
signingConfigs {
pre {
storeFile file("starlock.keystore")
storePassword '123456'
keyAlias = 'starlock'
keyPassword '123456'
}
sky {
// CN=Unknown, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown
storeFile file("sky.jks")
storePassword 'sky2028'
keyAlias = 'upload'
keyPassword 'sky0s9x'
}
xhj {
storeFile file("xhj.jks")
storePassword 'xhj8872'
keyAlias = 'upload'
keyPassword 'xhj3md9'
}
}
// ----- BEGIN flavorDimensions (autogenerated by flutter_flavorizr) -----
flavorDimensions "flavor-type"
productFlavors {
dev {
dimension "flavor-type"
applicationId "com.starlock.lock.dev"
resValue "string", "app_name", "星锁-dev"
}
pre {
dimension "flavor-type"
applicationId "com.starlock.lock.pre"
resValue "string", "app_name", "星锁"
}
sky {
dimension "flavor-type"
applicationId "com.skychip.lock"
signingConfig signingConfigs.sky
resValue "string", "app_name", "锁通通"
}
xhj {
dimension "flavor-type"
applicationId "com.xhjcn.lock"
signingConfig signingConfigs.xhj
resValue "string", "app_name", "鑫锁"
}
}
// ----- END flavorDimensions (autogenerated by flutter_flavorizr) -----
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
lintOptions{
checkReleaseBuilds false
abortOnError false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
applicationId "cn.starlock.lock"
// 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.
// minSdkVersion flutter.minSdkVersion
// targetSdkVersion flutter.targetSdkVersion
minSdkVersion 25
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
signingConfig signingConfigs.pre
// 为减少体积,使用不同架构分包发布编译选项 flutter build apk --split-per-abi
// 所以需要禁用ndk在同一个个包中包含多个架构
ndk {
//设置支持的SO库架构开发者可以根据需要选择一个或多个平台的so
// abiFilters "armeabi", "armeabi-v7a", "arm64-v8a", "x86","x86_64"
}
// armeabi 是 32位的armeabi-v7a 是 32位的arm64-v8a 是 64位的
// armeabi: 第5代、第6代的ARM处理器早期的手机用的比较多。
// armeabi-v7a: 第7代及以上的 ARM 处理器。
// arm64-v8a: 第8代、64位ARM处理器2016年之后中高端的手机比如骁龙8系列麒麟9系列联发科1000+等。
// x86: 平板、模拟器用得比较多。
// x86_64: 64位的平板。
// 2011年以后生产的机子基本上都是armeabi-v7a 及以上了
splits {
abi {
enable true
reset()
include 'armeabi-v7a', 'arm64-v8a'
universalApk false
}
}
}
buildTypes {
release {
productFlavors.sky.signingConfig signingConfigs.sky
productFlavors.xhj.signingConfig signingConfigs.xhj
}
debug {
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
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'
}