feat: sync httpdns sdk/platform updates without large binaries
This commit is contained in:
129
HttpDNSSDK/sdk/android/httpdns-sdk/build.gradle
Normal file
129
HttpDNSSDK/sdk/android/httpdns-sdk/build.gradle
Normal file
@@ -0,0 +1,129 @@
|
||||
plugins {
|
||||
id 'com.android.library'
|
||||
id 'maven-publish'
|
||||
}
|
||||
apply from: 'version.gradle'
|
||||
|
||||
|
||||
android {
|
||||
compileSdk 33
|
||||
defaultConfig {
|
||||
minSdkVersion 19
|
||||
targetSdkVersion 33
|
||||
versionCode 1
|
||||
versionName httpdnsDebugVersion
|
||||
setProperty("archivesBaseName", "new-android-httpdns-$versionName")
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
buildConfigField "String", "VERSION_NAME", "\"${httpdnsDebugVersion}\""
|
||||
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled true
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
|
||||
debug {
|
||||
minifyEnabled true
|
||||
proguardFiles getDefaultProguardFile("proguard-android.txt"), 'proguard-rules.pro'
|
||||
}
|
||||
|
||||
forTest {
|
||||
initWith release
|
||||
debuggable true
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules-for-test.pro'
|
||||
}
|
||||
}
|
||||
|
||||
flavorDimensions += "version"
|
||||
|
||||
productFlavors {
|
||||
normal {
|
||||
|
||||
}
|
||||
|
||||
intl {
|
||||
|
||||
}
|
||||
|
||||
end2end {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
abortOnError false
|
||||
}
|
||||
}
|
||||
|
||||
android.libraryVariants.all { variant ->
|
||||
if (variant.name == "normalRelease") {
|
||||
def sdkVersion = variant.mergedFlavor.versionName ?: httpdnsDebugVersion
|
||||
variant.outputs.all { output ->
|
||||
outputFileName = "new--android-httpdns-v${sdkVersion}.aar"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
//noinspection GradleDependency 高版本 jdk和androidx有一些依赖,暂时不升级
|
||||
testEnd2endImplementation "org.robolectric:robolectric:3.8"
|
||||
//noinspection GradleDependency
|
||||
testEnd2endImplementation 'junit:junit:4.12'
|
||||
//noinspection GradleDependency
|
||||
testEnd2endImplementation 'org.mockito:mockito-core:2.15.0'
|
||||
testEnd2endImplementation 'com.squareup.okhttp3:mockwebserver:3.9.0'
|
||||
|
||||
implementation "com.newsdk.ams:new-android-logger:${loggerVersion}"
|
||||
implementation "com.newsdk.ams:new-android-crashdefend:${crashDefendVersion}"
|
||||
implementation "com.newsdk.ams:new-android-ipdetector:${ipdetectorVersion}"
|
||||
}
|
||||
|
||||
ext.getIntlVersion = { version ->
|
||||
if (version.endsWith("-SNAPSHOT")) {
|
||||
return version.replace("-SNAPSHOT", "-intl-SNAPSHOT");
|
||||
} else {
|
||||
return version + "-intl";
|
||||
}
|
||||
}
|
||||
|
||||
task copyDependencies {
|
||||
doLast {
|
||||
def config = configurations.findByName("normalReleaseRuntimeClasspath")
|
||||
if (config != null) {
|
||||
config.resolvedConfiguration.resolvedArtifacts.each { artifact ->
|
||||
def file = artifact.file
|
||||
if (file.name.contains("new-android")) {
|
||||
copy {
|
||||
from file
|
||||
into 'build/outputs/dependencies'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user