init
This commit is contained in:
151
app/build.gradle
Normal file
151
app/build.gradle
Normal file
@@ -0,0 +1,151 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
def appName() {
|
||||
return "学习系统"
|
||||
}
|
||||
|
||||
def releaseTime() {
|
||||
return new Date().format("yyyyMMddHHmmss", TimeZone.getDefault())
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.uiui.os"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 29
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
zhanRui {
|
||||
storeFile file("src/doc/zhanxun.keystore")
|
||||
storePassword "123456"
|
||||
keyAlias "zhanxun"
|
||||
keyPassword "123456"
|
||||
v1SigningEnabled true
|
||||
v2SigningEnabled true
|
||||
}
|
||||
debug {
|
||||
storeFile file("src/doc/xueshibaoos.jks")
|
||||
storePassword "123456"
|
||||
keyAlias "xueshibaoos"
|
||||
keyPassword "123456"
|
||||
v2SigningEnabled false
|
||||
}
|
||||
release {// 签名文件
|
||||
storeFile file("src/doc/xueshibaoos.jks")
|
||||
storePassword "123456"
|
||||
keyAlias "xueshibaoos"
|
||||
keyPassword "123456"
|
||||
v2SigningEnabled false
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
zhanRuiRelease.initWith(release)
|
||||
zhanRuiRelease {
|
||||
manifestPlaceholders = [
|
||||
AMAP_KEY: "70f37634f84b00c5c7347c545bc2a3b9"
|
||||
]
|
||||
buildConfigField "boolean", "LOG_DEBUG", "false"
|
||||
signingConfig signingConfigs.zhanRui
|
||||
}
|
||||
|
||||
zhanRuiDebug.initWith(debug)
|
||||
zhanRuiDebug {
|
||||
manifestPlaceholders = [
|
||||
AMAP_KEY: "70f37634f84b00c5c7347c545bc2a3b9"
|
||||
]
|
||||
buildConfigField "boolean", "LOG_DEBUG", "true"
|
||||
versionNameSuffix "-debug"
|
||||
debuggable true
|
||||
signingConfig signingConfigs.zhanRui
|
||||
}
|
||||
debug {
|
||||
manifestPlaceholders = [
|
||||
AMAP_KEY: "70f37634f84b00c5c7347c545bc2a3b9"
|
||||
]
|
||||
// 显示Log
|
||||
buildConfigField "boolean", "LOG_DEBUG", "true"
|
||||
versionNameSuffix "-debug"
|
||||
minifyEnabled false
|
||||
//Zipalign优化
|
||||
zipAlignEnabled true
|
||||
signingConfig signingConfigs.debug
|
||||
applicationVariants.all { variant ->
|
||||
variant.outputs.each { output ->
|
||||
if (outputFile != null) {
|
||||
def fileName = "${appName()}-V${defaultConfig.versionName}-${releaseTime()}.apk"
|
||||
output.outputFileName = fileName
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
release {
|
||||
manifestPlaceholders = [
|
||||
AMAP_KEY: "70f37634f84b00c5c7347c545bc2a3b9"
|
||||
]
|
||||
// 不显示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()}-${buildType.name}.apk"
|
||||
output.outputFileName = new File(outputFile, fileName)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation files('libs/QWeather_Public_Android_V4.6.jar')
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.3.1'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
||||
implementation "androidx.recyclerview:recyclerview:1.2.1"
|
||||
// For control over item selection of both touch and mouse driven selection
|
||||
implementation "androidx.recyclerview:recyclerview-selection:1.1.0"
|
||||
implementation "androidx.viewpager2:viewpager2:1.0.0"
|
||||
// Java language implementation
|
||||
implementation "androidx.fragment:fragment:1.3.6"
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
||||
|
||||
implementation 'com.squareup.okhttp3:okhttp:3.12.12'
|
||||
implementation 'com.google.code.gson:gson:2.6.2'
|
||||
//bindView
|
||||
implementation 'com.jakewharton:butterknife:10.1.0'
|
||||
annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'
|
||||
//高德地图定位
|
||||
implementation 'com.amap.api:location:5.1.0'
|
||||
//MMKV
|
||||
implementation 'com.tencent:mmkv-static:1.2.10'
|
||||
//状态栏透明
|
||||
implementation 'com.gitee.zackratos:UltimateBarX:0.7.1'
|
||||
//指示器
|
||||
implementation 'com.github.hackware1993:MagicIndicator:1.7.0' // for androidx
|
||||
implementation 'com.king.view:circleprogressview:1.1.2'
|
||||
}
|
||||
Reference in New Issue
Block a user