111 lines
2.9 KiB
Groovy
111 lines
2.9 KiB
Groovy
import java.text.SimpleDateFormat
|
||
|
||
apply plugin: 'com.android.application'
|
||
apply from: './dependencies.gradle'
|
||
|
||
ext.MTL_buildId = getEnvValue("MUPP_BUILD_ID", 'localbuild')
|
||
ext.MTL_buildTimestamp = new SimpleDateFormat("yyMMddHHmmss").format(new Date())
|
||
|
||
//@keria:cannot make method static
|
||
String getEnvValue(key, defValue) {
|
||
def val = System.getProperty(key)
|
||
if (null != val) {
|
||
return val
|
||
}
|
||
val = System.getenv(key)
|
||
if (null != val) {
|
||
return val
|
||
}
|
||
return defValue
|
||
}
|
||
|
||
android {
|
||
lintOptions {
|
||
checkReleaseBuilds false
|
||
abortOnError false
|
||
}
|
||
signingConfigs {
|
||
release {
|
||
keyAlias 'key0'
|
||
keyPassword 'livepush'
|
||
storeFile file('livepush.jks')
|
||
storePassword 'livepush'
|
||
}
|
||
debug {
|
||
keyAlias 'key0'
|
||
keyPassword 'livepush'
|
||
storeFile file('livepush.jks')
|
||
storePassword 'livepush'
|
||
}
|
||
}
|
||
dexOptions {
|
||
javaMaxHeapSize "3g"
|
||
}
|
||
compileSdkVersion androidCompileSdkVersion
|
||
buildToolsVersion androidBuildToolsVersion
|
||
defaultConfig {
|
||
applicationId "com.alivc.live.pusher.demo"
|
||
minSdkVersion androidMinSdkVersion
|
||
targetSdkVersion androidTargetSdkVersion
|
||
versionCode 1
|
||
versionName "1.0"
|
||
|
||
javaCompileOptions {
|
||
annotationProcessorOptions {
|
||
arguments = [AROUTER_MODULE_NAME: 'live']
|
||
}
|
||
}
|
||
}
|
||
buildTypes {
|
||
release {
|
||
debuggable false
|
||
minifyEnabled true
|
||
shrinkResources true
|
||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||
signingConfig signingConfigs.release
|
||
}
|
||
}
|
||
compileOptions {
|
||
sourceCompatibility JavaVersion.VERSION_1_8
|
||
targetCompatibility JavaVersion.VERSION_1_8
|
||
}
|
||
|
||
packagingOptions {
|
||
exclude 'META-INF/NOTICE'
|
||
exclude 'META-INF/LICENSE'
|
||
exclude 'META-INF/notice.txt'
|
||
exclude 'META-INF/license.txt'
|
||
// 解决animoji和queen库so重复问题
|
||
pickFirst '**/libc++_shared.so'
|
||
pickFirst '**/libMNN.so'
|
||
pickFirst '**/libMNN_CL.so'
|
||
pickFirst '**/libalivcffmpeg.so'
|
||
}
|
||
publishNonDefault true
|
||
lintOptions {
|
||
checkReleaseBuilds false
|
||
abortOnError false
|
||
disable 'MissingTranslation'
|
||
}
|
||
applicationVariants.all { variant ->
|
||
variant.outputs.all { output ->
|
||
outputFileName = "${project.name}-${sdk_type.split('_').last()}-${variant.buildType.name}-${MTL_buildId}.apk"
|
||
}
|
||
}
|
||
allprojects {
|
||
repositories {
|
||
flatDir {
|
||
dirs 'src/main/libs'
|
||
}
|
||
}
|
||
}
|
||
resourcePrefix "push_"
|
||
}
|
||
|
||
dependencies {
|
||
implementation externalAndroidDesign
|
||
|
||
// 手动集成:本地依赖SDK
|
||
// implementation fileTree(dir: 'src/main/libs', include: ['*.jar', '*.aar'])
|
||
}
|