61 lines
2.1 KiB
Groovy
Raw Normal View History

2025-07-31 14:43:31 +08:00
plugins {
id 'com.android.library'
}
android {
compileSdkVersion 30
defaultConfig {
minSdkVersion 23
targetSdkVersion 30
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
//指定room.schemaLocation生成的文件路径
javaCompileOptions {
annotationProcessorOptions {
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}
}
buildTypes {
release {
buildConfigField "boolean", "LOG_DEBUG", "false" //不显示log
minifyEnabled false //混淆-混淆目前有问题,会闪退
shrinkResources false //资源压缩
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
buildConfigField ("String","ENVIR_NAME","\"${ENVIR_NAME}\"")
}
debug {
buildConfigField "boolean", "LOG_DEBUG", "true" //不显示log
buildConfigField ("String","ENVIR_NAME","\"${ENVIR_NAME_DEBUG}\"")
}
demo {
buildConfigField "boolean", "LOG_DEBUG", "false" //不显示log
buildConfigField ("String","ENVIR_NAME","\"${ENVIR_NAME_DEMO}\"")
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
namespace 'com.airkoon.locallib'
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
/*google官方数据库框架 ROOM*/
def room_version = "2.2.6"
api "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
api "androidx.room:room-rxjava2:$room_version"
api "androidx.room:room-guava:$room_version"
testImplementation "androidx.room:room-testing:$room_version"
}