加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
app-build.gradle 4.34 KB
一键复制 编辑 原始数据 按行查看 历史
ezy 提交于 2021-11-01 23:07 . #
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion versions.sdk_compile
buildToolsVersion versions.sdk_build
defaultConfig {
minSdkVersion versions.sdk_min
targetSdkVersion versions.sdk_target
applicationId appId
versionCode Integer.parseInt(appVersionCode)
versionName "${appVersionName}"
initFlavorConfig(it)
vectorDrawables {
useSupportLibrary = true
}
ndk {
abiFilters "arm64-v8a", "armeabi-v7a" , "armeabi" // "x86"
}
multiDexEnabled true
dimension "default"
}
compileOptions {
sourceCompatibility versions.java
targetCompatibility versions.java
}
kotlinOptions {
jvmTarget = "1.8"
}
buildFeatures {
dataBinding true
viewBinding true
buildConfig true
}
flavorDimensions "default"
productFlavors {
// dev { initFlavorConfig(it) }
qa { initFlavorConfig(it) }
// rc { initFlavorConfig(it) }
gr { initFlavorConfig(it) }
}
compileOptions {
sourceCompatibility versions.java
targetCompatibility versions.java
}
signingConfigs {
debug {
keyAlias "androiddebugkey"
keyPassword "android"
storeFile file("${System.properties['user.home']}/.android/debug.keystore")
storePassword "android"
v2SigningEnabled true
}
release {
keyAlias signingKey
keyPassword signingPass
storeFile file("$rootDir/$signingFile")
storePassword signingPass
v2SigningEnabled true
}
}
buildTypes {
debug {
signingConfig = signingConfigs.release
minifyEnabled false
shrinkResources false
proguardFiles 'r8-default.pro', 'r8-app.pro'
ext.enableCrashlytics = false
ext.alwaysUpdateBuildId = false
}
release {
signingConfig = signingConfigs.release
minifyEnabled false
shrinkResources false
zipAlignEnabled false
proguardFiles 'r8-default.pro', 'r8-app.pro', 'proguard.txt'
}
}
variantFilter { variant ->
if (variant.buildType.name == "debug") {
if (!['devDebug', 'qaDebug'].contains(variant.name)) {
variant.ignore = true
}
} else if (['devRelease', 'qaRelease'].contains(variant.name)) {
variant.ignore = true
}
}
applicationVariants.all { variant ->
variant.outputs.all { output ->
if (project.hasProperty("buildOutputFileName")) {
outputFileName = buildOutputFileName
} else {
outputFileName = "${apkName}_" + variant.versionName + "_" + variant.flavorName + ".apk"
}
}
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/notice.txt'
exclude 'META-INF/ASL2.0'
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
}
}
kapt {
arguments {
arg("moduleName", name)
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
debugImplementation "com.github.chuckerteam.chucker:library:3.3.0"
releaseImplementation "com.github.chuckerteam.chucker:library-no-op:3.3.0"
debugImplementation "com.squareup.leakcanary:leakcanary-android:2.3"
debugImplementation "com.github.markzhai:blockcanary-android:1.5.0"
releaseImplementation "com.github.markzhai:blockcanary-no-op:1.5.0"
kapt "me.reezy.init:init-compiler:0.9.0"
kapt "me.reezy.router:router-compiler:0.9.0"
kapt "androidx.lifecycle:lifecycle-compiler:2.3.0-beta01"
}
apply plugin: 'walle'
walle {
apkOutputFolder = new File("${rootDir}/apks/${appVersionName}");
apkFileNameFormat = apkName + '-${versionName}-${channel}.apk';
channelFile = new File("${rootDir}/channels.txt")
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化