240 lines
9.3 KiB
Groovy
240 lines
9.3 KiB
Groovy
apply plugin: 'com.android.application'
|
||
|
||
def appName() {
|
||
return "DeviceInfo"
|
||
}
|
||
|
||
def releaseTime() {
|
||
return new Date().format("yyyyMMdd", TimeZone.getDefault())
|
||
}
|
||
|
||
android {
|
||
compileSdkVersion 29
|
||
defaultConfig {
|
||
applicationId "com.jiaoguanyi.appstore"
|
||
minSdkVersion 20
|
||
targetSdkVersion 29
|
||
|
||
// versionCode 105
|
||
// versionName "3.1.0"//测试jiaoguanyi.cn
|
||
// versionCode 1008
|
||
// versionName "2.0.1.8"// 正式jiaoguanyi.com 双数正式 单数测试
|
||
multiDexEnabled true
|
||
|
||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||
packagingOptions {
|
||
exclude 'META-INF/rxjava.properties'
|
||
}
|
||
|
||
|
||
}
|
||
lintOptions {
|
||
checkReleaseBuilds false
|
||
}
|
||
dexOptions {
|
||
jumboMode true
|
||
}
|
||
//多版本
|
||
productFlavors {
|
||
official {
|
||
flavorDimensions "default"
|
||
versionCode 1025
|
||
versionName "2.0.2.5"// 正式jiaoguanyi.com 双数正式 单数测试
|
||
/*********************************极光推送************************************/
|
||
manifestPlaceholders = [
|
||
JPUSH_PKGNAME: "com.jiaoguanyi.appstore",
|
||
JPUSH_APPKEY : "20f70bbeb78bad23eddd08d0", //JPush上注册的包名对应的appkey.
|
||
JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
|
||
]
|
||
signingConfig signingConfigs.debug
|
||
/*********************************极光推送end************************************/
|
||
buildConfigField "String", "ROOT_URL", '"https://partner.jiaoguanyi.com/api/"'
|
||
buildConfigField "String", "WebsocketURL", '"ws://47.107.133.19:1234"'
|
||
|
||
}
|
||
|
||
beta {
|
||
flavorDimensions "default"
|
||
versionCode 108
|
||
versionName "3.1.3"//测试jiaoguanyi.cn
|
||
/*********************************极光推送************************************/
|
||
manifestPlaceholders = [
|
||
JPUSH_PKGNAME: "com.jiaoguanyi.appstore",
|
||
JPUSH_APPKEY : "52d81643665bb2cadacf0e9e", //JPush上注册的包名对应的appkey.
|
||
JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
|
||
]
|
||
signingConfig signingConfigs.debug
|
||
/*********************************极光推送end************************************/
|
||
buildConfigField "String", "ROOT_URL", '"http://www.jiaoguanyi.cn/api/"'
|
||
buildConfigField "String", "WebsocketURL", '"ws://47.107.133.19:2345"'
|
||
|
||
}
|
||
|
||
//中优
|
||
zhongyou {
|
||
flavorDimensions "default"
|
||
versionCode 1
|
||
versionName "1.0"//测试jiaoguanyi.cn
|
||
/*********************************极光推送************************************/
|
||
manifestPlaceholders = [
|
||
JPUSH_PKGNAME: "com.jiaoguanyi.appstore",
|
||
JPUSH_APPKEY : "a98c8a210687b4bb43c39c39", //JPush上注册的包名对应的appkey.
|
||
JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
|
||
]
|
||
signingConfig signingConfigs.debug
|
||
/*********************************极光推送end************************************/
|
||
buildConfigField "String", "ROOT_URL", '"https://jgy.jundunxueyuan.com/api/"'
|
||
buildConfigField "String", "WebsocketURL", '"ws://39.98.59.202:2345"'
|
||
}
|
||
newl {
|
||
flavorDimensions "default"
|
||
versionCode 159
|
||
versionName "1.1.4"
|
||
/*********************************极光推送************************************/
|
||
manifestPlaceholders = [
|
||
JPUSH_PKGNAME: "com.jiaoguanyi.appstore",
|
||
JPUSH_APPKEY : "52d81643665bb2cadacf0e9e", //JPush上注册的包名对应的appkey.
|
||
JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
|
||
]
|
||
signingConfig signingConfigs.debug
|
||
/*********************************极光推送end************************************/
|
||
buildConfigField "String", "ROOT_URL", '"http://name.uiuios.com/api/"'
|
||
buildConfigField "String", "WebsocketURL", '"ws://39.108.116.195:2345"'
|
||
}
|
||
}
|
||
sourceSets {
|
||
beta.res.srcDirs = ['src/beta/res']
|
||
newl.res.srcDirs = ['src/beta/res']
|
||
|
||
}
|
||
|
||
//签名
|
||
signingConfigs {
|
||
debug {
|
||
storeFile file("src/main/doc/xueshibaoos.jks")
|
||
storePassword "123456"
|
||
keyAlias "xueshibaoos"
|
||
keyPassword "123456"
|
||
v2SigningEnabled false
|
||
}
|
||
release {// 签名文件
|
||
storeFile file("src/main/doc/xueshibaoos.jks")
|
||
storePassword "123456"
|
||
keyAlias "xueshibaoos"
|
||
keyPassword "123456"
|
||
v2SigningEnabled false
|
||
}
|
||
}
|
||
|
||
buildTypes {
|
||
debug {
|
||
// 显示Log
|
||
buildConfigField "boolean", "LOG_DEBUG", "true"
|
||
versionNameSuffix "-debug"
|
||
minifyEnabled false
|
||
//Zipalign优化
|
||
zipAlignEnabled true
|
||
signingConfig signingConfigs.debug
|
||
applicationVariants.all { variant ->
|
||
variant.outputs.each { output ->
|
||
def outputFile = output.outputFile
|
||
if (outputFile != null) {
|
||
def fileName = "${appName()}-${variant.versionCode}-V${variant.versionName}-${releaseTime()}-${buildType.name}.apk"
|
||
output.outputFileName = new File(outputFile.parent, fileName)
|
||
}
|
||
}
|
||
}
|
||
}
|
||
release {
|
||
// 不显示Log
|
||
buildConfigField "boolean", "LOG_DEBUG", "false"
|
||
//混淆
|
||
minifyEnabled false
|
||
//Zipalign优化
|
||
zipAlignEnabled true
|
||
//前一部分代表系统默认的android程序的混淆文件,该文件已经包含了基本的混淆声明,后一个文件是自己的定义混淆文件
|
||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||
//签名
|
||
signingConfig signingConfigs.release
|
||
// 将release版本的包名重命名,加上版本及日期
|
||
applicationVariants.all { variant ->
|
||
variant.outputs.each { output ->
|
||
def outputFile = ""
|
||
if (outputFile != null) {
|
||
def fileName = "${appName()}-${variant.versionCode}-V${variant.versionName}-${releaseTime()}-${productFlavors[0].name}-${buildType.name}.apk"
|
||
output.outputFileName = new File(outputFile, fileName)
|
||
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
dependencies {
|
||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||
implementation 'com.android.support:appcompat-v7:26.1.0'
|
||
implementation 'com.android.support:recyclerview-v7:26.1.0'
|
||
implementation 'com.android.support:cardview-v7:26.1.0'
|
||
implementation 'com.android.support:multidex:1.0.1'
|
||
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
|
||
testImplementation 'junit:junit:4.12'
|
||
configurations.all {
|
||
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
|
||
def requested = details.requested
|
||
if (requested.group == 'com.android.support') {
|
||
if (!requested.name.startsWith("multidex")) {
|
||
details.useVersion '27.1.1'
|
||
}
|
||
}
|
||
}
|
||
}
|
||
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
|
||
|
||
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
|
||
|
||
// implementation 'me.grantland:autofittextview:0.2.1'
|
||
|
||
// implementation 'com.github.bumptech.glide:glide:4.0.0'
|
||
// annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0'
|
||
|
||
implementation 'com.alibaba:fastjson:1.2.70'
|
||
|
||
implementation 'com.lzy.net:okgo:2.1.4'
|
||
implementation 'com.lzy.net:okrx:0.1.2'
|
||
implementation 'com.lzy.net:okserver:1.1.3'
|
||
|
||
// implementation 'de.greenrobot:eventbus:2.4.1'
|
||
|
||
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
|
||
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
|
||
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
|
||
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
|
||
implementation 'io.reactivex.rxjava2:rxjava:2.0.7'
|
||
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
|
||
implementation 'com.google.code.gson:gson:2.8.0'
|
||
|
||
// implementation 'cn.jiguang:jpush:2.2.0'
|
||
implementation 'cn.jiguang.sdk:jpush:3.7.0' // 此处以JPush 3.5.6 版本为例。
|
||
implementation 'cn.jiguang.sdk:jcore:2.4.2' // 此处以JCore 2.2.8 版本为例。
|
||
|
||
implementation "com.github.yjfnypeu:UpdatePlugin:3.0.1"
|
||
|
||
implementation 'com.blankj:utilcode:1.23.7'
|
||
|
||
implementation 'com.arialyy.aria:core:3.8.5'
|
||
annotationProcessor 'com.arialyy.aria:compiler:3.8.5'
|
||
|
||
// implementation 'com.github.tianma8023:NetDetector:v0.2.0'
|
||
|
||
implementation "org.java-websocket:Java-WebSocket:1.4.1"
|
||
|
||
implementation 'com.google.zxing:core:3.2.1'
|
||
|
||
implementation 'com.hjq:xxpermissions:6.0'
|
||
|
||
implementation 'com.amap.api:location:5.1.0'
|
||
//高德地图地位
|
||
}
|