128 lines
4.2 KiB
Groovy
128 lines
4.2 KiB
Groovy
plugins {
|
||
id 'com.android.application'
|
||
id 'org.jetbrains.kotlin.android'
|
||
id 'kotlin-kapt'
|
||
}
|
||
|
||
gradle.ext {
|
||
httpVersion = '2.3.4'
|
||
}
|
||
|
||
android {
|
||
namespace 'com.aliyun.ams.httpdns.demo'
|
||
compileSdk 34
|
||
|
||
defaultConfig {
|
||
applicationId "com.aliyun.ams.httpdns.demo"
|
||
minSdkVersion 26
|
||
targetSdkVersion 34
|
||
versionCode 1
|
||
versionName "1.0"
|
||
|
||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||
|
||
buildConfigField "String", "HTTPDNS_VERSION", "\"${gradle.httpVersion}\""
|
||
buildConfigField "String", "ACCOUNT_ID", "\"璇锋浛鎹负娴嬭瘯鐢ㄥ疄渚嬬殑accountId\""
|
||
buildConfigField "String", "SECRET_KEY", "\"璇锋浛鎹负娴嬭瘯鐢ㄥ疄渚嬬殑secret\""
|
||
buildConfigField "String", "AES_SECRET_KEY", "\"璇锋浛鎹负娴嬭瘯鐢ㄥ疄渚嬬殑aes\""
|
||
}
|
||
|
||
buildTypes {
|
||
|
||
debug {
|
||
minifyEnabled true
|
||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||
}
|
||
|
||
release {
|
||
minifyEnabled true
|
||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||
}
|
||
|
||
forTest {
|
||
// 娉ㄦ剰杩欓噷鐨勯厤缃紝骞朵笉鏄渶瑕佺紪璇慺orTest鐨刟pp锛岃€屾槸閬垮厤httpdns-sdk鍦ˋndroidStudio鏀逛负end2end杩愯娴嬭瘯鏃?BuildVariants鎶ラ敊
|
||
initWith release
|
||
debuggable true
|
||
}
|
||
}
|
||
|
||
variantFilter { variant ->
|
||
def names = variant.flavors*.name
|
||
def type = variant.buildType.name
|
||
// To check for a certain build type, use variant.buildType.name == "<buildType>"
|
||
if ((names.contains("normal") && type.contains("forTest"))
|
||
|| (names.contains("intl") && type.contains("forTest"))
|
||
|| (names.contains("end2end") && type.contains("release"))
|
||
|| (names.contains("end2end") && type.contains("debug"))
|
||
) {
|
||
// Gradle ignores any variants that satisfy the conditions above.
|
||
setIgnore(true)
|
||
}
|
||
}
|
||
|
||
testOptions {
|
||
unitTests {
|
||
all {
|
||
jvmArgs '-noverify'
|
||
systemProperty 'robolectric.logging.enable', true
|
||
}
|
||
}
|
||
}
|
||
compileOptions {
|
||
sourceCompatibility JavaVersion.VERSION_1_8
|
||
targetCompatibility JavaVersion.VERSION_1_8
|
||
}
|
||
kotlinOptions {
|
||
jvmTarget = '1.8'
|
||
}
|
||
buildFeatures {
|
||
viewBinding = true
|
||
dataBinding = true
|
||
}
|
||
|
||
flavorDimensions += "version"
|
||
|
||
productFlavors {
|
||
normal {
|
||
|
||
}
|
||
|
||
intl {
|
||
|
||
}
|
||
|
||
end2end {
|
||
// 娉ㄦ剰杩欓噷鐨勯厤缃紝骞朵笉鏄渶瑕佺紪璇慹nd2end鐨刟pp锛岃€屾槸閬垮厤httpdns-sdk鍦ˋndroidStudio鏀逛负end2end杩愯娴嬭瘯鏃?BuildVariants鎶ラ敊
|
||
}
|
||
}
|
||
|
||
}
|
||
|
||
dependencies {
|
||
|
||
implementation 'androidx.core:core-ktx:1.7.0'
|
||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||
implementation 'com.google.android.material:material:1.9.0'
|
||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.1'
|
||
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1'
|
||
implementation 'androidx.navigation:navigation-fragment-ktx:2.5.3'
|
||
implementation 'androidx.navigation:navigation-ui-ktx:2.5.3'
|
||
|
||
implementation("com.squareup.okhttp3:okhttp:4.10.0")
|
||
implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0'
|
||
// implementation project(path: ':httpdns-sdk')
|
||
implementation 'com.aliyun.ams:alicloud-android-httpdns:2.6.6'
|
||
|
||
implementation('com.alibaba:fastjson:1.1.73.android@jar')
|
||
// implementation('com.emas.hybrid:emas-hybrid-android:1.1.0.4-public-SNAPSHOT') {
|
||
// exclude group: 'com.android.support', module: 'appcompat-v7'
|
||
// exclude group: 'com.taobao.android', module: 'thin_so_release'
|
||
// }
|
||
|
||
implementation 'com.aliyun.ams:alicloud-android-tool:1.1.0'
|
||
|
||
testImplementation 'junit:junit:4.13.2'
|
||
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
|
||
} |