glowner/app/build.gradle
2024-10-21 10:31:06 +08:00

147 lines
4.9 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.

plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}
def releaseTime() {
return new Date().format("yyyyMMddHHmm", TimeZone.getTimeZone("GMT+08:00"))
}
android {
signingConfigs {
config {
keyAlias 'key0'
keyPassword '210419'
storeFile file('glowner.jks')
storePassword '210419'
v1SigningEnabled true
v2SigningEnabled true
}
}
namespace 'com.dhsd.glowner'
compileSdk 34
defaultConfig {
applicationId "com.dhsd.glowner"
minSdk 23
targetSdk 34
versionCode 1
versionName "1.0"
flavorDimensions "CHANNEL_VALUE"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary true
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
debug {
signingConfig signingConfigs.config
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = '11'
}
buildFeatures {
viewBinding = true
buildConfig = true
}
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion '1.5.1'
}
productFlavors {
dev {
applicationId "com.dhsd.glowner"
manifestPlaceholders = [CHANNEL_VALUE: "货主端(测试)",
// app_icon : "@drawable/head_defaut",
JPUSH_PKGNAME: applicationId,
//JPush 上注册的包名对应的 Appkey.
JPUSH_APPKEY : "fba6f55621c670d8c1fe9191",
//暂时填写默认值即可.
JPUSH_CHANNEL: "developer-n",
]
buildConfigField("String", "BASE_URL", "\"https://platform.test.v2.dahehuoyun.com/\"")
buildConfigField "boolean", "isTest", "true"
// //APP名称可以在androidMainfest中引用
resValue "string", "appName", "货主端测试"
}
prod {
applicationId "com.dhsd.glowner"
manifestPlaceholders = [CHANNEL_VALUE: "货主端",
// app_icon : "@drawable/ysxy",
JPUSH_PKGNAME: applicationId,
//JPush 上注册的包名对应的 Appkey.
JPUSH_APPKEY : "fba6f55621c670d8c1fe9191",
//暂时填写默认值即可.
JPUSH_CHANNEL: "developer-default"]
buildConfigField("String", "BASE_URL", "\"http://app.dahehuoyun.com/api/\"")
buildConfigField "boolean", "isTest", "false"
resValue "string", "appName", "货主端"
}
}
// android.applicationVariants.all { variant ->
// variant.outputs.all {
// //获取渠道名称
// def isText = variant.productFlavors[0].properties.get("buildConfigFields").getAt("isTest").properties.get("value")
// def appName = null
// if (isText == "true") {
// appName = '货主端测试_'
// } else {
// appName = '货主端正式_'
// }
// outputFileName = appName + "${variant.buildType.name}_${defaultConfig.versionName}_${releaseTime()}.apk"
//
// }
// }
// packaging {
// resources {
// excludes += '/META-INF/{AL2.0,LGPL2.1}'
// }
// }
}
dependencies {
implementation 'androidx.core:core-ktx:1.10.1'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1'
implementation 'androidx.activity:activity-compose:1.7.0'
implementation platform('androidx.compose:compose-bom:2023.08.00')
implementation 'androidx.compose.ui:ui'
implementation 'androidx.compose.ui:ui-graphics'
implementation 'androidx.compose.ui:ui-tooling-preview'
implementation 'androidx.compose.material3:material3'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation platform('androidx.compose:compose-bom:2023.08.00')
androidTestImplementation 'androidx.compose.ui:ui-test-junit4'
debugImplementation 'androidx.compose.ui:ui-tooling'
debugImplementation 'androidx.compose.ui:ui-test-manifest'
//高德地图
implementation 'com.amap.api:map2d:6.0.0'
implementation project(path: ':mylibrary')
}