75 lines
2.8 KiB
Groovy
75 lines
2.8 KiB
Groovy
import java.text.SimpleDateFormat
|
|
|
|
plugins {
|
|
id 'com.android.library'
|
|
}
|
|
|
|
ext.MTL_buildId = getEnvValue("MUPP_BUILD_ID", 'localbuild')
|
|
ext.MTL_buildTimestamp = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date())
|
|
// special configurations, only used for test.
|
|
ext.Interactive_AppID = getEnvValue("INTERACTIVE_APP_ID", '')
|
|
ext.Interactive_AppKey = getEnvValue("INTERACTIVE_APP_KEY", '')
|
|
ext.Interactive_PlayDomain = getEnvValue("INTERACTIVE_PLAY_DOMAIN", '')
|
|
ext.isAllInOne = allInOne
|
|
|
|
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 {
|
|
compileSdkVersion androidCompileSdkVersion
|
|
buildToolsVersion androidBuildToolsVersion
|
|
|
|
defaultConfig {
|
|
minSdkVersion androidMinSdkVersion
|
|
targetSdkVersion androidTargetSdkVersion
|
|
versionCode 1
|
|
versionName "1.0"
|
|
|
|
consumerProguardFiles "consumer-rules.pro"
|
|
|
|
Properties properties = new Properties()
|
|
if (project.rootProject.file('local.properties').canRead()) {
|
|
properties.load(project.rootProject.file("local.properties").newDataInputStream())
|
|
}
|
|
resValue "string", "test_push_url", properties.getProperty("push.url", "")
|
|
resValue "string", "test_pull_url", properties.getProperty("pull.url", "")
|
|
resValue "string", "interactive_appid", properties.getProperty("interactive.appid", "")
|
|
resValue "string", "interactive_appkey", properties.getProperty("interactive.appkey", "")
|
|
resValue "string", "interactive_push_domain", properties.getProperty("interactive.push.domain", "")
|
|
resValue "string", "interactive_play_domain", properties.getProperty("interactive.play.domain", "")
|
|
}
|
|
|
|
buildTypes {
|
|
all {
|
|
buildConfigField "String", "MTL_BUILD_ID", "\"${MTL_buildId}\""
|
|
buildConfigField "String", "MTL_BUILD_TIMESTAMP", "\"${MTL_buildTimestamp}\""
|
|
buildConfigField "String", "INTERACTIVE_APP_ID", "\"${Interactive_AppID}\""
|
|
buildConfigField "String", "INTERACTIVE_APP_KEY", "\"${Interactive_AppKey}\""
|
|
buildConfigField "String", "INTERACTIVE_PLAY_DOMAIN", "\"${Interactive_PlayDomain}\""
|
|
buildConfigField "Boolean", "MTL_BUILD_FOR_AIO", "${isAllInOne}"
|
|
}
|
|
release {
|
|
minifyEnabled false
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
}
|
|
}
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation externalAndroidDesign
|
|
implementation 'commons-net:commons-net:3.8.0'
|
|
api project(':LiveCommon:live_commonui')
|
|
} |