Files
CubeAoleyunSN/app/build.gradle
FHT 4c11814f06 version:1.2.8
update:
fix:
add:
2021-04-08 14:04:36 +08:00

255 lines
10 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.
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 24
targetSdkVersion 29
// versionCode 105
// versionName "3.1.0"//测试jiaoguanyi.cn
// versionCode 1008
// versionName "2.0.1.8"// 正式jiaoguanyi.com 双数正式 单数测试
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
packagingOptions {
exclude 'META-INF/rxjava.properties'
}
}
lintOptions {
checkReleaseBuilds false
}
dexOptions {
jumboMode true
}
// dataBinding {
// enabled = true
// }
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
//多版本
productFlavors {
official {
flavorDimensions "default"
versionCode 1035
versionName "2.0.3.5"
/*********************************极光推送************************************/
manifestPlaceholders = [
JPUSH_PKGNAME: "com.jiaoguanyi.appstore",
JPUSH_APPKEY : "20f70bbeb78bad23eddd08d0", //JPush上注册的包名对应的appkey.
JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
channel_value: "official",
]
signingConfig signingConfigs.debug
/*********************************极光推送end************************************/
buildConfigField "String", "ROOT_URL", '"http://partner.jiaoguanyi.com/api/"'
buildConfigField "String", "WebsocketURL", '"ws://47.107.133.19:1234"'
}
beta {
flavorDimensions "default"
versionCode 109
// versionCode 160//出厂版本太高
versionName "3.1.4"//测试jiaoguanyi.cn
/*********************************极光推送************************************/
manifestPlaceholders = [
JPUSH_PKGNAME: "com.jiaoguanyi.appstore",
JPUSH_APPKEY : "52d81643665bb2cadacf0e9e", //JPush上注册的包名对应的appkey.
JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
channel_value: "beta"
]
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", //暂时填写默认值即可.
channel_value: "zhongyou"
]
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 168
// versionCode 1036
versionName "1.2.8"
/*********************************极光推送************************************/
manifestPlaceholders = [
JPUSH_PKGNAME: "com.jiaoguanyi.appstore",
JPUSH_APPKEY : "52d81643665bb2cadacf0e9e", //JPush上注册的包名对应的appkey.
JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
channel_value: "newl"
]
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 = 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 = fileName
}
}
}
}
}
}
dependencies {
// implementation fileTree(include: ['*.jar'], dir: 'libs')
compileOnly files('src/main/libs/classes.jar')
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.jakewharton:butterknife:10.1.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
implementation "org.java-websocket:Java-WebSocket:1.4.1"
implementation 'com.squareup.okhttp3:okhttp:4.6.0'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
implementation 'io.reactivex.rxjava2:rxjava:2.2.5'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
// implementation "com.uber.autodispose:autodispose:1.3.0"
// implementation "com.uber.autodispose:autodispose-android-archcomponents:1.3.0"
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.google.zxing:core:3.3.0'
implementation 'cn.jiguang.sdk:jpush:3.8.6' // 此处以JPush 3.5.6 版本为例。
implementation 'cn.jiguang.sdk:jcore:2.6.0' // 此处以JCore 2.2.8 版本为例。
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 'com.blankj:utilcode:1.23.7'
implementation 'com.arialyy.aria:core:3.8.15'
annotationProcessor 'com.arialyy.aria:compiler:3.8.15'
implementation 'com.amap.api:location:5.1.0'
//高德地图定位
implementation 'org.zeroturnaround:zt-zip:1.13'
//压缩文件解压
}
preBuild {
doLast {
def imlFile = file( project.name + ".iml")
println 'Change ' + project.name + '.iml order'
try {
def parsedXml = (new XmlParser()).parse(imlFile)
def jdkNode = parsedXml.component[1].orderEntry.find { it.'@type' == 'jdk' }
parsedXml.component[1].remove(jdkNode)
def sdkString = "Android API " + android.compileSdkVersion.substring("android-".length()) + " Platform"
println 'what' + sdkString
new Node(parsedXml.component[1], 'orderEntry', ['type': 'jdk', 'jdkName': sdkString, 'jdkType': 'Android SDK'])
groovy.xml.XmlUtil.serialize(parsedXml, new FileOutputStream(imlFile))
} catch (FileNotFoundException e) {
// nop, iml not found
println "no iml found"
}
}
//https://www.pianshen.com/article/93481144911/
//使用系统编译后的framework.jar
}