| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- plugins {
- id "com.android.application"
- id "kotlin-android"
- id "dev.flutter.flutter-gradle-plugin"
- }
- def localProperties = new Properties()
- def localPropertiesFile = rootProject.file('local.properties')
- if (localPropertiesFile.exists()) {
- localPropertiesFile.withReader('UTF-8') { reader ->
- localProperties.load(reader)
- }
- }
- def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
- if (flutterVersionCode == null) {
- flutterVersionCode = '1'
- }
- def flutterVersionName = localProperties.getProperty('flutter.versionName')
- if (flutterVersionName == null) {
- flutterVersionName = '1.0'
- }
- android {
- namespace "com.szls.lszlgl"
- compileSdkVersion flutter.compileSdkVersion
- ndkVersion flutter.ndkVersion
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
- }
- defaultConfig {
- applicationId "com.szls.lszlgl"
- // You can update the following values to match your application needs.
- // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
- minSdkVersion flutter.minSdkVersion
- targetSdkVersion flutter.targetSdkVersion
- versionCode flutterVersionCode.toInteger()
- versionName flutterVersionName
- }
- // 签名配置
- signingConfigs {
- release {
- v1SigningEnabled true
- v2SigningEnabled true
- storeFile file(KEY_PATH)
- storePassword KEY_PWD
- keyAlias = ALIAS_NAME
- keyPassword ALIAS_PWD
- }
- }
- buildTypes {
- release {
- proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
- signingConfig signingConfigs.release
- }
- profile {
- signingConfig signingConfigs.release
- }
- debug {
- signingConfig signingConfigs.release
- }
- }
- android.applicationVariants.all {
- def buildType = it.buildType.name
- def outputFile
- it.outputs.each {
- outputFile = it.outputFile
- // 名称_环境_版本名称_版本号.apk
- // lszlgl_release_0.0.2_2.apk
- it.outputFileName = "lszlgl_${buildType}_${defaultConfig.versionName}_${defaultConfig.versionCode}.apk"
- }
- }
- dependencies {
- implementation fileTree(include: ['*.jar'], dir: 'libs')
- implementation 'com.amap.api:location:5.6.0'
- }
- }
- flutter {
- source '../..'
- }
|