GLDriver/app/build.gradle

110 lines
4.2 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 {
compileSdk rootProject.ext.android["compileSdkVersion"]
defaultConfig {
applicationId rootProject.ext.android["applicationId"]
minSdkVersion rootProject.ext.android["minSdkVersion"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
versionCode rootProject.ext.android["versionCode"]
versionName rootProject.ext.android["versionName"]
flavorDimensions "CHANNEL_VALUE"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = '11'
}
buildFeatures {
viewBinding = true
}
sourceSets {
main {
jniLibs.srcDir 'libs'
//说明so的路径为该libs路径关联所有地图SDK的so文件
}
}
productFlavors {
dev {
applicationId "com.dahe.gldriver"
manifestPlaceholders = [CHANNEL_VALUE: "审核端(测试)",
// app_icon : "@drawable/head_defaut",
JPUSH_PKGNAME: applicationId,
//JPush 上注册的包名对应的 Appkey.
JPUSH_APPKEY : "5d63ef6fdf58ada352bb8f07",
//暂时填写默认值即可.
JPUSH_CHANNEL: "developer-n"]
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi-staging.alct56.com\"")
buildConfigField("String", "BASE_URL", "\"http://app.test.dahehuoyun.com/api/\"")
buildConfigField "boolean", "isTest", "true"
//APP名称可以在androidMainfest中引用
resValue "string", "appName", "审核测试"
}
prod {
applicationId "com.dahe.gldriver"
manifestPlaceholders = [CHANNEL_VALUE: "审核端",
// app_icon : "@drawable/ysxy",
JPUSH_PKGNAME: applicationId,
//JPush 上注册的包名对应的 Appkey.
JPUSH_APPKEY : "5d63ef6fdf58ada352bb8f07",
//暂时填写默认值即可.
JPUSH_CHANNEL: "developer-default"]
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi.alct56.com\"")
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"
}
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.annotation:annotation:1.2.0'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation project(path: ':mylibrary')
}