110 lines
3.2 KiB
Groovy
110 lines
3.2 KiB
Groovy
|
|
apply plugin: 'com.android.application'
|
|||
|
|
apply plugin: 'img-optimizer'
|
|||
|
|
//打包时,记得设置true启用
|
|||
|
|
if (isNeedPackage.toBoolean() && isUseBooster.toBoolean()) {
|
|||
|
|
apply plugin: 'com.didiglobal.booster'
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
android {
|
|||
|
|
compileSdkVersion build_versions.target_sdk
|
|||
|
|
buildToolsVersion build_versions.build_tools
|
|||
|
|
|
|||
|
|
defaultConfig {
|
|||
|
|
applicationId "com.xuexiang.templateproject"
|
|||
|
|
minSdkVersion 17
|
|||
|
|
targetSdkVersion build_versions.target_sdk
|
|||
|
|
versionCode 1
|
|||
|
|
versionName "1.0.0"
|
|||
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|||
|
|
|
|||
|
|
multiDexEnabled true
|
|||
|
|
vectorDrawables.useSupportLibrary = true
|
|||
|
|
|
|||
|
|
javaCompileOptions {
|
|||
|
|
annotationProcessorOptions {
|
|||
|
|
arguments = [ moduleName : project.getName() ]
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
signingConfigs {
|
|||
|
|
if (isNeedPackage.toBoolean()) {
|
|||
|
|
release {
|
|||
|
|
storeFile file(app_release.storeFile)
|
|||
|
|
storePassword app_release.storePassword
|
|||
|
|
keyAlias app_release.keyAlias
|
|||
|
|
keyPassword app_release.keyPassword
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
debug {
|
|||
|
|
storeFile file("./debug.jks")
|
|||
|
|
storePassword "123456"
|
|||
|
|
keyAlias "debug"
|
|||
|
|
keyPassword "123456"
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
buildTypes {
|
|||
|
|
release {
|
|||
|
|
minifyEnabled true
|
|||
|
|
shrinkResources true
|
|||
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|||
|
|
if (isNeedPackage.toBoolean()) {
|
|||
|
|
signingConfig signingConfigs.release
|
|||
|
|
|
|||
|
|
Properties properties = new Properties()
|
|||
|
|
properties.load(project.rootProject.file('local.properties').newDataInputStream())
|
|||
|
|
def appID = properties.getProperty("APP_ID_UMENG")
|
|||
|
|
if (appID != null) {
|
|||
|
|
buildConfigField "String", "APP_ID_UMENG", appID
|
|||
|
|
} else {
|
|||
|
|
buildConfigField "String", "APP_ID_UMENG", '""'
|
|||
|
|
}
|
|||
|
|
} else {
|
|||
|
|
signingConfig signingConfigs.debug
|
|||
|
|
buildConfigField "String", "APP_ID_UMENG", '""'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
debug {
|
|||
|
|
debuggable true
|
|||
|
|
minifyEnabled false
|
|||
|
|
|
|||
|
|
signingConfig signingConfigs.debug
|
|||
|
|
buildConfigField "String", "APP_ID_UMENG", '""'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
lintOptions {
|
|||
|
|
abortOnError false
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
compileOptions {
|
|||
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|||
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|||
|
|
}
|
|||
|
|
buildFeatures {
|
|||
|
|
viewBinding true
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
dependencies {
|
|||
|
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|||
|
|
testImplementation deps.junit
|
|||
|
|
androidTestImplementation deps.runner
|
|||
|
|
androidTestImplementation deps.espresso.core
|
|||
|
|
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
|
|||
|
|
implementation 'com.github.HuanTanSheng:EasyPhotos:3.1.5'
|
|||
|
|
implementation 'com.github.bumptech.glide:glide:4.11.0'
|
|||
|
|
|
|||
|
|
implementation 'com.github.bumptech.glide:glide:4.12.0'
|
|||
|
|
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
|
|||
|
|
}
|
|||
|
|
//自动添加X-Library依赖
|
|||
|
|
apply from: 'x-library.gradle'
|
|||
|
|
//walle多渠道打包
|
|||
|
|
apply from: 'multiple-channel.gradle'
|
|||
|
|
|
|||
|
|
|