123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- /*
- * @Author: XianKaiQun
- * @Date: 2020-03-31 18:07:43
- * @LastEditors : WuWei
- * @LastEditTime : 2023-05-17 09:38:41
- * @Descripttion:
- */
- //读取打包证书
- def keystorePropertiesFile = rootProject.file("cert/key.properties")
- def keystoreProperties = new Properties()
- keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
- //读取local.properties
- 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.")
- // }
- 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: 'kotlin-android'
- apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
- android {
- compileSdkVersion 35 //flutter.compileSdkVersion
- ndkVersion "27.0.12077973"
- sourceSets {
- main.java.srcDirs += 'src/main/kotlin'
- }
- //多渠道打包
- flavorDimensions "type"
- productFlavors{
- dev{
- dimension "type"
- applicationId "cn.huifuwu.appdev"
- manifestPlaceholders = [
- APP_NAME: "绘服务dev",
- //高德
- // AMAP_KEY : "ceca571ebb034cfa994cc772dace12cc",
- ]
- }
- prod{
- dimension "type"
- applicationId "cn.huifuwu.app"
- manifestPlaceholders = [
- APP_NAME: "绘服务",
- //高德
- // AMAP_KEY : "8a246a9e2a9f110609d2e13524948fec",
- ]
- }
- }
- defaultConfig {
- minSdk 27
- targetSdk 35
- // 使用自带的sdk版本
- //flutter.targetSdkVersion
- versionCode flutterVersionCode.toInteger()
- versionName flutterVersionName
- testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
- //multiDexEnabled true ////报dex超过64k时需要
- }
- compileOptions {
- sourceCompatibility = JavaVersion.VERSION_17
- targetCompatibility = JavaVersion.VERSION_17
- }
- kotlinOptions {
- jvmTarget = "17"
- }
-
- //配置打包证书
- signingConfigs {
- release {
- keyAlias keystoreProperties['keyAlias']
- keyPassword keystoreProperties['keyPassword']
- storeFile file(keystoreProperties['storeFile'])
- storePassword keystoreProperties['storePassword']
- }
- }
- buildTypes {
- release {
- signingConfig signingConfigs.release
- }
- debug {
- minifyEnabled true
- signingConfig signingConfigs.release
- }
- profile {
- signingConfig signingConfigs.release
- }
- }
- namespace 'cn.huifuwu.app'
- // buildToolsVersion '36.0.0 rc5'
- }
- flutter {
- source '../..'
- }
- dependencies {
- // 此处以JPush 5.6.0 版本为例,注意:从 5.0.0 版本开始可以自动拉取 JCore 包,无需另外配置
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
- testImplementation 'junit:junit:4.13.2'
- androidTestImplementation 'androidx.test.ext:junit:1.1.5'
- androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
- // implementation 'com.android.support:multidex:1.0.1' //报dex超过64k时需要
- //引入高德地图SDK 已去除
- // implementation('com.amap.api:3dmap:7.7.0')
- // implementation('com.amap.api:location:5.2.0')
- }
|