2023-05-02 21:13:18 +02:00
|
|
|
@file:Suppress("UnstableApiUsage")
|
2023-05-05 03:09:38 +02:00
|
|
|
|
2023-05-02 21:22:52 +02:00
|
|
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
2023-05-02 21:13:18 +02:00
|
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
2023-05-17 13:33:58 +02:00
|
|
|
import com.android.build.gradle.tasks.ExtractSupportedLocalesTask
|
2023-05-02 21:13:18 +02:00
|
|
|
|
2023-05-03 14:09:11 +02:00
|
|
|
val pkg: String = providers.gradleProperty("wireguardPackageName").get()
|
|
|
|
|
2023-05-02 21:13:18 +02:00
|
|
|
plugins {
|
|
|
|
alias(libs.plugins.android.application)
|
|
|
|
alias(libs.plugins.kotlin.android)
|
|
|
|
alias(libs.plugins.kotlin.kapt)
|
|
|
|
}
|
|
|
|
|
|
|
|
android {
|
|
|
|
compileSdk = 33
|
|
|
|
buildFeatures {
|
|
|
|
buildConfig = true
|
|
|
|
dataBinding = true
|
|
|
|
viewBinding = true
|
|
|
|
}
|
2023-05-03 14:09:11 +02:00
|
|
|
namespace = pkg
|
2023-05-02 21:13:18 +02:00
|
|
|
defaultConfig {
|
2023-05-03 14:09:11 +02:00
|
|
|
applicationId = pkg
|
2023-05-02 21:13:18 +02:00
|
|
|
minSdk = 21
|
|
|
|
targetSdk = 33
|
|
|
|
versionCode = providers.gradleProperty("wireguardVersionCode").get().toInt()
|
|
|
|
versionName = providers.gradleProperty("wireguardVersionName").get()
|
|
|
|
buildConfigField("int", "MIN_SDK_VERSION", minSdk.toString())
|
|
|
|
}
|
|
|
|
compileOptions {
|
2023-05-03 14:01:05 +02:00
|
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
|
|
targetCompatibility = JavaVersion.VERSION_17
|
2023-05-02 21:13:18 +02:00
|
|
|
isCoreLibraryDesugaringEnabled = true
|
|
|
|
}
|
|
|
|
buildTypes {
|
|
|
|
release {
|
|
|
|
isMinifyEnabled = true
|
|
|
|
isShrinkResources = true
|
|
|
|
proguardFiles("proguard-android-optimize.txt")
|
|
|
|
packaging {
|
|
|
|
resources {
|
|
|
|
excludes += "DebugProbesKt.bin"
|
|
|
|
excludes += "kotlin-tooling-metadata.json"
|
2023-05-10 16:49:51 +02:00
|
|
|
excludes += "META-INF/*.version"
|
2023-05-02 21:13:18 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
debug {
|
|
|
|
applicationIdSuffix = ".debug"
|
|
|
|
versionNameSuffix = "-debug"
|
|
|
|
}
|
2023-05-10 18:34:21 +02:00
|
|
|
create("googleplay") {
|
|
|
|
initWith(getByName("release"))
|
|
|
|
matchingFallbacks += "release"
|
|
|
|
}
|
2023-05-02 21:13:18 +02:00
|
|
|
}
|
2023-04-13 16:33:42 +02:00
|
|
|
androidResources {
|
|
|
|
generateLocaleConfig = true
|
|
|
|
}
|
2023-05-02 21:13:18 +02:00
|
|
|
lint {
|
2023-05-03 15:37:06 +02:00
|
|
|
disable += "LongLogTag"
|
|
|
|
warning += "MissingTranslation"
|
|
|
|
warning += "ImpliedQuantity"
|
2023-05-02 21:13:18 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
implementation(project(":tunnel"))
|
|
|
|
implementation(libs.androidx.activity.ktx)
|
|
|
|
implementation(libs.androidx.annotation)
|
|
|
|
implementation(libs.androidx.appcompat)
|
|
|
|
implementation(libs.androidx.constraintlayout)
|
|
|
|
implementation(libs.androidx.coordinatorlayout)
|
|
|
|
implementation(libs.androidx.biometric)
|
|
|
|
implementation(libs.androidx.core.ktx)
|
|
|
|
implementation(libs.androidx.fragment.ktx)
|
|
|
|
implementation(libs.androidx.preference.ktx)
|
|
|
|
implementation(libs.androidx.lifecycle.runtime.ktx)
|
|
|
|
implementation(libs.androidx.datastore.preferences)
|
|
|
|
implementation(libs.google.material)
|
|
|
|
implementation(libs.zxing.android.embedded)
|
|
|
|
implementation(libs.kotlinx.coroutines.android)
|
|
|
|
coreLibraryDesugaring(libs.desugarJdkLibs)
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.withType<JavaCompile>().configureEach {
|
|
|
|
options.compilerArgs.add("-Xlint:unchecked")
|
|
|
|
options.isDeprecation = true
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.withType<KotlinCompile>().configureEach {
|
2023-05-03 14:01:05 +02:00
|
|
|
compilerOptions.jvmTarget.set(JvmTarget.JVM_17)
|
2023-05-02 21:13:18 +02:00
|
|
|
}
|