Commit efd2617f authored by shiyuelong's avatar shiyuelong

add 将公共参数的配置信息统一放gradle中配置

parent 886a400b
...@@ -6,19 +6,21 @@ plugins { ...@@ -6,19 +6,21 @@ plugins {
} }
android { android {
compileSdkVersion 30 compileSdkVersion build_versions.compileSdkVersion
buildToolsVersion "30.0.2" buildToolsVersion "30.0.2"
publishNonDefault true publishNonDefault true
defaultConfig { defaultConfig {
minSdkVersion 21 minSdkVersion build_versions.minSdkVersion
targetSdkVersion 30 targetSdkVersion build_versions.targetSdkVersion
versionCode 1 versionCode rootProject.ext.android.versionCode
versionName "1.0" versionName rootProject.ext.android.versionName
buildConfigField("String", "SERVICE_VERSION", rootProject.ext.android.serviceVersion)
buildConfigField("boolean", "IS_ENCRYPT", rootProject.ext.android.isEncrypt)
javaCompileOptions { javaCompileOptions {
annotationProcessorOptions { annotationProcessorOptions {
arguments = [ setAttributeClassName : 'YdSubwaySetAttributeMethodProvider', arguments = [setAttributeClassName: 'YdSubwaySetAttributeMethodProvider',
bindingDataClassName : 'YdSubwayBindingDataMethodProvider'] bindingDataClassName : 'YdSubwayBindingDataMethodProvider']
} }
} }
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
...@@ -41,13 +43,13 @@ android { ...@@ -41,13 +43,13 @@ android {
kotlinOptions { kotlinOptions {
jvmTarget = '1.8' jvmTarget = '1.8'
} }
androidExtensions{ androidExtensions {
experimental = true experimental = true
} }
viewBinding{ viewBinding {
enabled = true enabled = true
} }
kapt{ kapt {
generateStubs = true generateStubs = true
} }
repositories { repositories {
......
...@@ -2,16 +2,24 @@ package com.yidian.common ...@@ -2,16 +2,24 @@ package com.yidian.common
class AppConfig { class AppConfig {
companion object { companion object {
//生活圈项目 // 是否开启加密
const val IS_ENCRYPT = false const val IS_ENCRYPT = BuildConfig.IS_ENCRYPT
const val KUANGSHI_ALIVE_API_KEY = "32f9XIsReV4S15Ck_Sa3ky43XgAHUB9v" const val KUANGSHI_ALIVE_API_KEY = "32f9XIsReV4S15Ck_Sa3ky43XgAHUB9v"
const val KUANGSHI_SECRET = "usZbQYdI4PQeXhMftsRfHK2msj0DmSIl" const val KUANGSHI_SECRET = "usZbQYdI4PQeXhMftsRfHK2msj0DmSIl"
// 渠道
const val appid = "merchant-b" const val appid = "merchant-b"
const val cv = "1.0.0"
const val version = "000100" // 客户端版本号
const val cv = BuildConfig.VERSION_NAME
// 服务端版本号
const val version = BuildConfig.SERVICE_VERSION
// 分发
const val distribution = "official" const val distribution = "official"
// 平台
const val platform = "1" const val platform = "1"
...@@ -33,6 +41,7 @@ class AppConfig { ...@@ -33,6 +41,7 @@ class AppConfig {
const val UMTestChannel = "ANDROID_CHANNEL" const val UMTestChannel = "ANDROID_CHANNEL"
const val UMTestType = "metro" const val UMTestType = "metro"
const val UMTestSecret = "e78446e86d153e2891ae7523e1532f13" const val UMTestSecret = "e78446e86d153e2891ae7523e1532f13"
// 友盟线上环境配置 // 友盟线上环境配置
const val UMAppKey = "60c8479fe044530ff0a49936"//umeng统计key注释 const val UMAppKey = "60c8479fe044530ff0a49936"//umeng统计key注释
const val UMChannel = "ANDROID_CHANNEL" const val UMChannel = "ANDROID_CHANNEL"
......
...@@ -65,7 +65,7 @@ android { ...@@ -65,7 +65,7 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
applicationVariants.all { variant -> applicationVariants.all { variant ->
variant.outputs.all { output -> variant.outputs.all { output ->
outputFileName = "business-${variant.name}-${defaultConfig.versionName}-${defaultConfig.versionCode}.apk" outputFileName = "merchant-b-${variant.name}-${defaultConfig.versionName}-${defaultConfig.versionCode}.apk"
} }
} }
} }
......
ext { ext {
android = [ android = [
applicationId : "com.shenghuoquan.business", applicationId : "com.shenghuoquan.business",
versionCode : 100, versionCode : 100,
versionName : "1.0.0", versionName : "1.0.0",
isApplication : false serviceVersion: '"000100"',// 上线前需要和服务端确认并更新
] isEncrypt : 'true',// 上线前需要开启加密
buildParams = [ isApplication : false
debug : [ ]
API_URL: '"http://bp-dev.go2yd.com"', buildParams = [
], debug : [
release: [ // API_URL: '"http://bp-dev.go2yd.com"',
API_URL: '"http://bp-dev.go2yd.com"', API_URL: '"http://bp-test.go2yd.com"',
] ],
] release: [
API_URL: '"http://bp-dev.go2yd.com"',
]
]
} }
ext.dependencies = [ ext.dependencies = [
publicImplementation :[ publicImplementation : [
'androidx.core:core-ktx:$kotlin_version', 'androidx.core:core-ktx:$kotlin_version',
'androidx.appcompat:appcompat:1.2.0', 'androidx.appcompat:appcompat:1.2.0',
'com.google.android.material:material:1.2.1', 'com.google.android.material:material:1.2.1',
...@@ -81,15 +83,15 @@ ext.dependencies = [ ...@@ -81,15 +83,15 @@ ext.dependencies = [
'com.loopj.android:android-async-http:1.4.9' 'com.loopj.android:android-async-http:1.4.9'
], ],
other:[ other : [
':CommonLib:Common' ':CommonLib:Common'
], ],
video:'com.yidian.framework.mobile:ydvideo:1.0.0-SNAPSHOT', video : 'com.yidian.framework.mobile:ydvideo:1.0.0-SNAPSHOT',
androidTestImplementation:[ androidTestImplementation: [
'androidx.test.ext:junit:1.1.2', 'androidx.test.ext:junit:1.1.2',
'androidx.test.espresso:espresso-core:3.3.0' 'androidx.test.espresso:espresso-core:3.3.0'
], ],
testImplementation : 'junit:junit:4.13.1' testImplementation : 'junit:junit:4.13.1'
] ]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment