You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
105 lines
3.6 KiB
Groovy
105 lines
3.6 KiB
Groovy
2 years ago
|
apply plugin: 'com.android.application'
|
||
|
apply plugin: 'kotlin-android'
|
||
|
apply plugin: 'kotlin-kapt'
|
||
|
apply plugin: 'com.huawei.agconnect'
|
||
|
|
||
|
|
||
|
def rely = rootProject.ext.relyOn
|
||
|
def androidId = rootProject.ext.defaultSetting
|
||
|
def url = rootProject.ext.url
|
||
|
def imagePrefix =rootProject.ext.image_preifx
|
||
|
|
||
|
android {
|
||
|
compileSdkVersion androidId.compileSdk
|
||
|
buildToolsVersion androidId.buildToolsVersion
|
||
|
|
||
|
defaultConfig {
|
||
|
applicationId androidId.appId
|
||
|
minSdkVersion androidId.minSdk
|
||
|
targetSdkVersion androidId.targetSdk
|
||
|
versionCode androidId.versionCode
|
||
|
versionName androidId.versionName
|
||
|
|
||
|
kapt {
|
||
|
arguments {
|
||
|
arg("AROUTER_MODULE_NAME", project.getName())
|
||
|
}
|
||
|
}
|
||
|
|
||
|
manifestPlaceholders = [
|
||
|
JPUSH_PKGNAME : applicationId,
|
||
|
JPUSH_APPKEY : "7f6d979240babce41b3625ab",
|
||
|
//暂时填写默认值即可.
|
||
|
JPUSH_CHANNEL : "developer-default",
|
||
|
|
||
|
OPPO_APPKEY : "OP-28e45f61f683472c9033a98c02818171", // OPPO平台注册的appkey
|
||
|
OPPO_APPID : "OP-30804697", // OPPO平台注册的appid
|
||
|
OPPO_APPSECRET: "OP-2ea09012e6a746dfbc503877916ba342",//OPPO平台注册的appsecret
|
||
|
|
||
|
XIAOMI_APPKEY : "MI-5232015762943",// 小米平台注册的appkey
|
||
|
XIAOMI_APPID : "MI-2882303761520157943", // 小米平台注册的appid
|
||
|
|
||
|
VIVO_APPKEY:"8e9bb7cc764a56a6862e97ef99c03a61",
|
||
|
VIVO_APPID:"105558697",
|
||
|
HONOR_APPID:"220761795"
|
||
|
]
|
||
|
// 配置 APK 输出路径
|
||
|
applicationVariants.all { variant ->
|
||
|
if (variant.buildType.name == "release") {
|
||
|
def date = new Date().format("yyyyMMddHHmmss")
|
||
|
variant.outputs.all {
|
||
|
outputFileName = "HealthUser-${variant.name}-${versionName}-${date}.apk"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
buildConfigField("String" ,"appid" ,"\"${rootProject.ext.wx.appid}\"")
|
||
|
buildConfigField("String" ,"appSecret" ,"\"${rootProject.ext.wx.appSecret}\"")
|
||
|
|
||
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||
|
}
|
||
|
|
||
|
signingConfigs{
|
||
|
release {
|
||
|
keyAlias 'healthUser'
|
||
|
keyPassword '123456'
|
||
|
storeFile file('./HealthUser.keyStore')
|
||
|
storeFile file('C:/Users/anyu-android/Desktop/user_keystore/HealthUser.keyStore')
|
||
|
storePassword '123456'
|
||
|
}
|
||
|
}
|
||
|
|
||
|
buildTypes {
|
||
|
release {
|
||
|
buildConfigField("String", "url", "\"${url.release_url}\"")
|
||
|
buildConfigField("String", "image_prefix","\"${imagePrefix.release_url}\"")
|
||
|
buildConfigField("Boolean","isRelease",String.valueOf(true))
|
||
|
minifyEnabled false
|
||
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||
|
// signingConfig signingConfigs.release
|
||
|
}
|
||
|
debug {
|
||
|
buildConfigField("String", "url", "\"${url.debug_url}\"")
|
||
|
buildConfigField("Boolean","isRelease",String.valueOf(false))
|
||
|
buildConfigField("String", "image_prefix","\"${imagePrefix.debug_url}\"")
|
||
|
// signingConfig signingConfigs.release
|
||
|
}
|
||
|
}
|
||
|
compileOptions {
|
||
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||
|
targetCompatibility JavaVersion.VERSION_1_8
|
||
|
}
|
||
|
kotlinOptions {
|
||
|
jvmTarget = '1.8'
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
dependencies {
|
||
|
|
||
|
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||
|
implementation 'com.google.android.material:material:1.2.1'
|
||
|
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
|
||
|
|
||
|
implementation rely.arouter_compiler
|
||
|
|
||
|
}
|