Bump version v5.11.0
Signed-off-by: Teddysun <i@teddysun.com>
This commit is contained in:
parent
61c874e6f9
commit
e055452bd3
1 changed files with 86 additions and 86 deletions
|
@ -1,86 +1,86 @@
|
||||||
import com.android.build.gradle.internal.api.ApkVariantOutputImpl
|
import com.android.build.gradle.internal.api.ApkVariantOutputImpl
|
||||||
import com.android.build.VariantOutput
|
import com.android.build.VariantOutput
|
||||||
import org.apache.tools.ant.taskdefs.condition.Os
|
import org.apache.tools.ant.taskdefs.condition.Os
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("com.android.application")
|
id("com.android.application")
|
||||||
kotlin("android")
|
kotlin("android")
|
||||||
}
|
}
|
||||||
|
|
||||||
val flavorRegex = "(assemble|generate)\\w*(Release|Debug)".toRegex()
|
val flavorRegex = "(assemble|generate)\\w*(Release|Debug)".toRegex()
|
||||||
val currentFlavor get() = gradle.startParameter.taskRequests.toString().let { task ->
|
val currentFlavor get() = gradle.startParameter.taskRequests.toString().let { task ->
|
||||||
flavorRegex.find(task)?.groupValues?.get(2)?.toLowerCase(Locale.ROOT) ?: "debug".also {
|
flavorRegex.find(task)?.groupValues?.get(2)?.toLowerCase(Locale.ROOT) ?: "debug".also {
|
||||||
println("Warning: No match found for $task")
|
println("Warning: No match found for $task")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
val javaVersion = JavaVersion.VERSION_1_8
|
val javaVersion = JavaVersion.VERSION_1_8
|
||||||
compileSdkVersion(30)
|
compileSdkVersion(30)
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility = javaVersion
|
sourceCompatibility = javaVersion
|
||||||
targetCompatibility = javaVersion
|
targetCompatibility = javaVersion
|
||||||
}
|
}
|
||||||
kotlinOptions.jvmTarget = javaVersion.toString()
|
kotlinOptions.jvmTarget = javaVersion.toString()
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId = "com.github.shadowsocks.plugin.v2ray"
|
applicationId = "com.github.shadowsocks.plugin.v2ray"
|
||||||
minSdkVersion(23)
|
minSdkVersion(23)
|
||||||
targetSdkVersion(30)
|
targetSdkVersion(30)
|
||||||
versionCode = 5010000
|
versionCode = 5011000
|
||||||
versionName = "5.10.0"
|
versionName = "5.11.0"
|
||||||
testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
getByName("release") {
|
getByName("release") {
|
||||||
isShrinkResources = true
|
isShrinkResources = true
|
||||||
isMinifyEnabled = true
|
isMinifyEnabled = true
|
||||||
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
|
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
splits {
|
splits {
|
||||||
abi {
|
abi {
|
||||||
isEnable = true
|
isEnable = true
|
||||||
isUniversalApk = true
|
isUniversalApk = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sourceSets.getByName("main") {
|
sourceSets.getByName("main") {
|
||||||
jniLibs.setSrcDirs(jniLibs.srcDirs + files("$projectDir/build/go"))
|
jniLibs.setSrcDirs(jniLibs.srcDirs + files("$projectDir/build/go"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register<Exec>("goBuild") {
|
tasks.register<Exec>("goBuild") {
|
||||||
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
||||||
println("Warning: Building on Windows is not supported")
|
println("Warning: Building on Windows is not supported")
|
||||||
} else {
|
} else {
|
||||||
executable("/bin/bash")
|
executable("/bin/bash")
|
||||||
args("go-build.bash", 23)
|
args("go-build.bash", 23)
|
||||||
environment("ANDROID_HOME", android.sdkDirectory)
|
environment("ANDROID_HOME", android.sdkDirectory)
|
||||||
environment("ANDROID_NDK_HOME", android.ndkDirectory)
|
environment("ANDROID_NDK_HOME", android.ndkDirectory)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.whenTaskAdded {
|
tasks.whenTaskAdded {
|
||||||
when (name) {
|
when (name) {
|
||||||
"mergeDebugJniLibFolders", "mergeReleaseJniLibFolders" -> dependsOn("goBuild")
|
"mergeDebugJniLibFolders", "mergeReleaseJniLibFolders" -> dependsOn("goBuild")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(kotlin("stdlib-jdk8", rootProject.extra.get("kotlinVersion").toString()))
|
implementation(kotlin("stdlib-jdk8", rootProject.extra.get("kotlinVersion").toString()))
|
||||||
implementation("androidx.preference:preference:1.1.1")
|
implementation("androidx.preference:preference:1.1.1")
|
||||||
implementation("com.github.shadowsocks:plugin:2.0.1")
|
implementation("com.github.shadowsocks:plugin:2.0.1")
|
||||||
implementation("com.takisoft.preferencex:preferencex-simplemenu:1.1.0")
|
implementation("com.takisoft.preferencex:preferencex-simplemenu:1.1.0")
|
||||||
testImplementation("junit:junit:4.13.2")
|
testImplementation("junit:junit:4.13.2")
|
||||||
androidTestImplementation("androidx.test:runner:1.3.0")
|
androidTestImplementation("androidx.test:runner:1.3.0")
|
||||||
androidTestImplementation("androidx.test.espresso:espresso-core:3.3.0")
|
androidTestImplementation("androidx.test.espresso:espresso-core:3.3.0")
|
||||||
}
|
}
|
||||||
|
|
||||||
val abiCodes = mapOf("armeabi-v7a" to 1, "arm64-v8a" to 2, "x86" to 3, "x86_64" to 4)
|
val abiCodes = mapOf("armeabi-v7a" to 1, "arm64-v8a" to 2, "x86" to 3, "x86_64" to 4)
|
||||||
if (currentFlavor == "release") android.applicationVariants.all {
|
if (currentFlavor == "release") android.applicationVariants.all {
|
||||||
for (output in outputs) {
|
for (output in outputs) {
|
||||||
abiCodes[(output as ApkVariantOutputImpl).getFilter(VariantOutput.ABI)]?.let { offset ->
|
abiCodes[(output as ApkVariantOutputImpl).getFilter(VariantOutput.ABI)]?.let { offset ->
|
||||||
output.versionCodeOverride = versionCode + offset
|
output.versionCodeOverride = versionCode + offset
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue