82 lines
2.3 KiB
Groovy
82 lines
2.3 KiB
Groovy
import com.quyunshuo.androidbaseframemvvm.build.*
|
|
|
|
if (BuildConfig.isAppMode) {
|
|
apply plugin: 'com.android.application'
|
|
} else {
|
|
apply plugin: 'com.android.library'
|
|
}
|
|
apply plugin: 'kotlin-android'
|
|
apply plugin: 'kotlin-android-extensions'
|
|
apply plugin: 'kotlin-kapt'
|
|
|
|
android {
|
|
compileSdkVersion BuildConfig.compileSdkVersion
|
|
buildToolsVersion BuildConfig.buildToolsVersion
|
|
|
|
defaultConfig {
|
|
minSdkVersion BuildConfig.minSdkVersion
|
|
targetSdkVersion BuildConfig.targetSdkVersion
|
|
versionCode BuildConfig.versionCode
|
|
versionName BuildConfig.versionName
|
|
testInstrumentationRunner AndroidX.AndroidJUnitRunner
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = JavaVersion.VERSION_1_8.toString()
|
|
}
|
|
|
|
buildFeatures {
|
|
viewBinding = true
|
|
}
|
|
|
|
//根据不同的模式加载不同的AndroidManifest文件
|
|
sourceSets {
|
|
main {
|
|
if (BuildConfig.isAppMode) {
|
|
manifest.srcFile 'src/main/java/debug/AndroidManifest.xml'
|
|
} else {
|
|
manifest.srcFile 'src/main/AndroidManifest.xml'
|
|
java {
|
|
//排除debug文件夹下的所有文件
|
|
exclude 'debug/**'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled false
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
}
|
|
debug {
|
|
minifyEnabled false
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
}
|
|
}
|
|
}
|
|
|
|
kapt {
|
|
arguments {
|
|
arg("AROUTER_MODULE_NAME", project.name)
|
|
arg("eventBusIndex", "${BuildConfig.applicationId}.eventbus.index.${project.name.replace('Lib_', '')}EventIndex")
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
|
|
api project(path: ':Lib_Common')
|
|
|
|
testImplementation Android.Junit
|
|
androidTestImplementation AndroidX.TestExtJunit
|
|
androidTestImplementation AndroidX.TestEspresso
|
|
kapt GitHub.GlideCompiler
|
|
kapt GitHub.ARouteCompiler
|
|
kapt GitHub.EventBusAPT
|
|
} |