- 移除未使用的 FileNotFoundException 导入 - 修复 CrashHandler 单例模式的双重检查锁定实现 - 使用 try-with-resources 语句简化文件流管理 - 添加详细的崩溃日志写入错误日志记录 - 重构 OfflineCmdServiceHelper 使用 CopyOnWriteArrayList 替代 - 提取各页面语音命令为常量列表避免重复创建对象 - 简化页面语音命令注册和移除方法的实现逻辑 - 重构 TaskListActivity 语音命令分发逻辑 - 使用映射表和解析函数替代大量重复的条件判断 - 提取语音命令常量配置便于维护 - 在 WelcomeVM 中使用 try-with-resources 管理资源 - 修改 NetworkModule 构造函数参数命名规范 - 修复 AppManager logout 方法中的循环清理逻辑 - 从本地属性文件读取仓库认证凭据避免提交到版本控制
100 行
3.1 KiB
Groovy
100 行
3.1 KiB
Groovy
apply plugin: 'com.android.library'
|
|
apply plugin: 'kotlin-android'
|
|
apply plugin: 'maven-publish'
|
|
|
|
// 声明aar包的版本号
|
|
def aarVersion = "0.0.1.101"
|
|
|
|
|
|
android {
|
|
compileSdkVersion versions.compileSdk
|
|
buildToolsVersion versions.buildTools
|
|
|
|
defaultConfig {
|
|
minSdkVersion versions.minSdk
|
|
targetSdkVersion versions.targetSdk
|
|
flavorDimensions "versioncode"
|
|
buildConfigField("String", "APP_ID", "\"" + apps.applicationId + "\"")
|
|
}
|
|
|
|
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled false
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
}
|
|
}
|
|
productFlavors productF
|
|
namespace 'com.xuqm.base'
|
|
}
|
|
|
|
dependencies {
|
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
|
|
api androidxDependencies
|
|
implementation 'androidx.appcompat:appcompat:1.3.0'
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
|
|
|
|
|
implementation 'org.jetbrains.anko:anko-commons:0.10.5'
|
|
|
|
annotationProcessor compilerDependencies
|
|
commonDependencies.each { k, v ->
|
|
api(v) {
|
|
//去除第三方的重复support库
|
|
exclude group: 'com.android.support'
|
|
}
|
|
}
|
|
//扫码二维码
|
|
api 'com.huawei.hms:scanplus:1.1.1.301'
|
|
}
|
|
// 这个是把源码打入aar包中的任务
|
|
task sourceJar(type: Jar) {
|
|
archiveClassifier.set('sources')
|
|
from android.sourceSets.main.java.srcDirs
|
|
}
|
|
afterEvaluate {
|
|
publishing {
|
|
publications {
|
|
// 这里的debug名字是自己起的
|
|
release(MavenPublication) {
|
|
groupId = 'cn.org.bjca.trust.android'
|
|
artifactId = 'base'
|
|
version = aarVersion
|
|
// 这里除了有debug 还有release
|
|
from components.release
|
|
// 运行任务,把源码打进去
|
|
artifact sourceJar
|
|
}
|
|
}
|
|
// 添加仓库地址
|
|
repositories {
|
|
// 本地仓库
|
|
// mavenLocal()
|
|
// 当上传到远端仓库
|
|
// maven {
|
|
// allowInsecureProtocol true
|
|
// url("http://nexus.51trust.net/repository/android-hosted/")
|
|
// credentials {
|
|
// username = "deployment"
|
|
// password = "deployment123"
|
|
// }
|
|
// }
|
|
maven {
|
|
allowInsecureProtocol true
|
|
url("http://xuqinmin.com.cn:8081/repository/android-releases/")
|
|
credentials {
|
|
// 从 local.properties 读取,避免凭据提交到版本控制
|
|
def props = new Properties()
|
|
def localPropertiesFile = rootProject.file("local.properties")
|
|
if (localPropertiesFile.exists()) {
|
|
localPropertiesFile.withInputStream { props.load(it) }
|
|
}
|
|
username = props.getProperty("nexus.username", "")
|
|
password = props.getProperty("nexus.password", "")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |