纸通宝SAAS工厂的Android项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

144 lines
4.5 KiB

apply plugin: 'com.android.application'
android {
compileSdkVersion project.sdk
buildToolsVersion project.buildTools
defaultConfig {
applicationId "com.qniao.ztbsaas"
minSdkVersion project.minSdk
targetSdkVersion project.sdk
versionCode 2
versionName "1.0.3"
multiDexEnabled false
ndk {
// 设置支持的 SO 库构架,注意这里要根据你的实际情况来设置
abiFilters 'armeabi-v7a'
// 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64', 'mips', 'mips64variant'
}
}
sourceSets {
main {
res.srcDirs = [
'src/main/res'
]
jniLibs.srcDir 'libs'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
tasks.whenTaskAdded { task ->
if (task.name.contains("lint")
//如果instant run不生效,把clean这行干掉
|| task.name.equals("clean")
//如果项目中有用到aidl则不可以舍弃这个任务
|| task.name.contains("Aidl")
//用不到测试的时候就可以先关闭
|| task.name.contains("mockableAndroidJar")
|| task.name.contains("UnitTest")
|| task.name.contains("AndroidTest")
) {
task.enabled = false
}
}
// recommend
dexOptions {
jumboMode = true
}
//程序在buid的时候,会执行lint检查,有任何的错误或者警告提示,都会终止构建,我们可以将其关掉
lintOptions {
abortOnError false
htmlReport true
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'LICENSE.txt'
}
signingConfigs {
debug {
keyAlias 'wastepaper'
keyPassword 'wastepaper'
storeFile file('wastepaper.jks')
storePassword 'wastepaper'
v1SigningEnabled true
v2SigningEnabled true
}
release {
keyAlias 'wastepaper'
keyPassword 'wastepaper'
storeFile file('wastepaper.jks')
storePassword 'wastepaper'
v1SigningEnabled true
v2SigningEnabled true
}
}
buildTypes {
release {
minifyEnabled true
//不显示 Log
buildConfigField "boolean", "LOG_DEBUG", "false"
//移除无用的 Resource
shrinkResources true
//资源文件按4字节对齐
zipAlignEnabled true
//关闭调试
debuggable false
signingConfig signingConfigs.release
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
buildConfigField("String", "DOMAIN_NAME", '"https://api.qniao.cn"')
buildConfigField("boolean", "RELEASE", "true")//是否输出LOG信息
}
debug {
minifyEnabled false
signingConfig signingConfigs.debug
// buildConfigField("String", "DOMAIN_NAME", '"https://api.qniao.cn"')
buildConfigField("String", "DOMAIN_NAME", '"http://192.168.0.167:9000"')
buildConfigField("boolean", "RELEASE", "false")//是否输出LOG信息
}
}
repositories {
flatDir {
dirs 'libs'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation "androidx.recyclerview:recyclerview:1.0.0"
implementation "com.google.android.material:material:1.2.0-alpha02"
implementation "com.android.support:multidex:1.0.3"
implementation project(':okgo')
implementation 'com.squareup.okhttp3:okhttp:4.2.1'
// implementation project(':keyboard')
implementation 'com.tencent.bugly:crashreport:3.1.0'
implementation 'com.google.code.gson:gson:2.6.2'
implementation 'com.github.bumptech.glide:glide:4.10.0'
implementation 'org.greenrobot:eventbus:3.0.0'
implementation 'me.jessyan:autosize:1.1.2'
// 状态栏沉浸:https://github.com/gyf-dev/ImmersionBar
implementation 'com.gyf.immersionbar:immersionbar:3.0.0'
implementation 'com.tencent:mmkv:1.0.23'
// 吐司工具类:https://github.com/getActivity/ToastUtils
implementation 'com.hjq:toast:8.0'
}