mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-05-20 16:17:08 +02:00
126 lines
3.6 KiB
Plaintext
126 lines
3.6 KiB
Plaintext
import com.android.build.gradle.internal.api.BaseVariantOutputImpl
|
|
|
|
@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
|
|
plugins {
|
|
alias(libs.plugins.androidApplication)
|
|
alias(libs.plugins.kotlinAndroid)
|
|
}
|
|
|
|
android {
|
|
namespace = rootProject.ext["applicationId"].toString()
|
|
compileSdk = 34
|
|
|
|
buildFeatures {
|
|
aidl = true
|
|
compose = true
|
|
}
|
|
|
|
composeOptions {
|
|
kotlinCompilerExtensionVersion = "1.4.8"
|
|
}
|
|
|
|
defaultConfig {
|
|
applicationId = rootProject.ext["applicationId"].toString()
|
|
minSdk = 28
|
|
targetSdk = 34
|
|
multiDexEnabled = true
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
isMinifyEnabled = true
|
|
proguardFiles += file("proguard-rules.pro")
|
|
}
|
|
debug {
|
|
isDebuggable = true
|
|
isMinifyEnabled = false
|
|
}
|
|
}
|
|
|
|
flavorDimensions += "abi"
|
|
|
|
//noinspection ChromeOsAbiSupport
|
|
productFlavors {
|
|
packaging {
|
|
jniLibs {
|
|
excludes += "**/*_neon.so"
|
|
}
|
|
resources {
|
|
excludes += "DebugProbesKt.bin"
|
|
excludes += "okhttp3/internal/publicsuffix/**"
|
|
excludes += "META-INF/*.version"
|
|
excludes += "META-INF/services/**"
|
|
excludes += "META-INF/*.kotlin_builtins"
|
|
excludes += "META-INF/*.kotlin_module"
|
|
}
|
|
}
|
|
create("armv8") {
|
|
ndk {
|
|
abiFilters += "arm64-v8a"
|
|
}
|
|
dimension = "abi"
|
|
}
|
|
|
|
create("armv7") {
|
|
ndk {
|
|
abiFilters += "armeabi-v7a"
|
|
}
|
|
dimension = "abi"
|
|
}
|
|
}
|
|
|
|
properties["debug_flavor"]?.let {
|
|
android.productFlavors[it.toString()].setIsDefault(true)
|
|
}
|
|
|
|
applicationVariants.all {
|
|
outputs.map { it as BaseVariantOutputImpl }.forEach { variant ->
|
|
variant.outputFileName = "app-${rootProject.ext["appVersionName"]}-${variant.name}.apk"
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = "1.8"
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation(project(":core"))
|
|
implementation(libs.androidx.material.icons.core)
|
|
implementation(libs.androidx.material.ripple)
|
|
implementation(libs.androidx.material.icons.extended)
|
|
implementation(libs.androidx.material3)
|
|
implementation(libs.androidx.activity.ktx)
|
|
implementation(libs.androidx.navigation.compose)
|
|
implementation(libs.androidx.documentfile)
|
|
implementation(libs.gson)
|
|
implementation(libs.coil.compose)
|
|
implementation(libs.coil.video)
|
|
implementation(libs.osmdroid.android)
|
|
|
|
debugImplementation("androidx.compose.ui:ui-tooling:1.4.3")
|
|
implementation("androidx.compose.ui:ui-tooling-preview:1.4.3")
|
|
implementation(kotlin("reflect"))
|
|
}
|
|
|
|
afterEvaluate {
|
|
properties["debug_assemble_task"]?.let { tasks.named(it.toString()) }?.orNull?.doLast {
|
|
runCatching {
|
|
val apkDebugFile = android.applicationVariants.find { it.buildType.name == "debug" && it.flavorName == properties["debug_flavor"] }?.outputs?.first()?.outputFile ?: return@doLast
|
|
exec {
|
|
commandLine("adb", "shell", "am", "force-stop", "com.snapchat.android")
|
|
}
|
|
exec {
|
|
commandLine("adb", "install", "-r", "-d", apkDebugFile.absolutePath)
|
|
}
|
|
exec {
|
|
commandLine("adb", "shell", "am", "start", "com.snapchat.android")
|
|
}
|
|
}
|
|
}
|
|
} |