129 lines
3.9 KiB
Groovy
129 lines
3.9 KiB
Groovy
plugins {
|
|
id 'com.android.application'
|
|
id 'org.jetbrains.kotlin.android'
|
|
id 'kotlin-kapt'
|
|
}
|
|
|
|
gradle.ext {
|
|
httpVersion = '2.3.4'
|
|
}
|
|
|
|
android {
|
|
namespace 'com.newsdk.ams.httpdns.demo'
|
|
compileSdk 34
|
|
|
|
defaultConfig {
|
|
applicationId "com.newsdk.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", "\"replace-with-your-accountId\""
|
|
buildConfigField "String", "SECRET_KEY", "\"replace-with-your-secret\""
|
|
buildConfigField "String", "AES_SECRET_KEY", "\"replace-with-your-aes-secret\""
|
|
buildConfigField "String", "SERVICE_URL", "\"\""
|
|
}
|
|
|
|
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 {
|
|
// Keep this flavor to avoid BuildVariants errors when switching httpdns-sdk to end2end tests.
|
|
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 {
|
|
// Keep this flavor to avoid BuildVariants errors when switching httpdns-sdk to end2end tests.
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
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.newsdk: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.newsdk.ams:new-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'
|
|
}
|