diff --git a/app/build.gradle.kts b/app/build.gradle.kts new file mode 100644 index 000000000..f00f777a5 --- /dev/null +++ b/app/build.gradle.kts @@ -0,0 +1,439 @@ +import io.gitlab.arturbosch.detekt.Detekt +import io.gitlab.arturbosch.detekt.extensions.DetektExtension +import java.util.Properties +import java.io.FileInputStream + + +plugins { + alias(libs.plugins.android.application) + alias(libs.plugins.ksp) + alias(libs.plugins.detekt) + + alias(libs.plugins.compose.compiler) + alias(libs.plugins.kotlin.serialization) +} + +ksp { + arg("room.schemaLocation", "$projectDir/schemas") +} + +java { + toolchain { + languageVersion.set(JavaLanguageVersion.of(17)) + } +} + + +// apply Google Services and Firebase Crashlytics plugins conditionally +val taskNames = gradle.startParameter.taskNames.joinToString(",").lowercase() +val apkBuild = taskNames.contains("full") +val fdroidBuild = taskNames.contains("fdroid") +val fdroidBuildServer = System.getenv("fdroidserver") +val isFdroidBuildServer = !fdroidBuildServer.isNullOrEmpty() && fdroidBuildServer != "null" +val deGoogled = !apkBuild || fdroidBuild || isFdroidBuildServer + +println("app-task names: '$taskNames'") +println("gradle deGoogled? $deGoogled (fdroidBuild: $fdroidBuild, fdroidBuildServer: $isFdroidBuildServer, apkBuild: $apkBuild)") + +if (!deGoogled) { + apply(plugin = "com.google.gms.google-services") + apply(plugin = "com.google.firebase.crashlytics") + println("app firebase plugins applied") +} else { + println("app firebase plugins SKIPPED") +} + +val keystorePropertiesFile = rootProject.file("keystore.properties") +val keystoreProperties = Properties() + +val gitVersion = providers.exec { + commandLine("git", "describe", "--tags", "--always") +}.standardOutput.asText.get().trim() + +fun getVersionCode(project: Project): Int { + var code = 0 + try { + val envCode = System.getenv("VERSION_CODE") + if (envCode != null) { + code = Integer.parseInt(envCode) + project.logger.info("env version code: $code") + } + } catch (ex: NumberFormatException) { + project.logger.info("missing env version code: ${ex.message}") + } + if (code == 0) { + code = (project.properties["VERSION_CODE"] as? String)?.toIntOrNull() ?: 0 + project.logger.info("project properties version code: $code") + } + return code +} + +try { + if (keystorePropertiesFile.exists()) { + keystoreProperties.load(FileInputStream(keystorePropertiesFile)) + } +} catch (ex: Exception) { + logger.info("missing keystore prop: ${ex.message}") + keystoreProperties["keyAlias"] = "" + keystoreProperties["keyPassword"] = "" + keystoreProperties["storeFile"] = "/dev/null" + keystoreProperties["storePassword"] = "" +} + +android { + compileSdk = 36 + namespace = "com.celzero.bravedns" + + androidResources { + generateLocaleConfig = true + } + + defaultConfig { + applicationId = "com.celzero.bravedns" + minSdk = 23 + targetSdk = 36 + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + create("config") { + keyAlias = keystoreProperties["keyAlias"] as String? + keyPassword = keystoreProperties["keyPassword"] as String? + val storeFilePath = keystoreProperties["storeFile"] as String? + if (storeFilePath != null) { + storeFile = file(storeFilePath) + } + storePassword = keystoreProperties["storePassword"] as String? + } + create("alpha") { + keyAlias = System.getenv("ALPHA_KS_ALIAS") + keyPassword = System.getenv("ALPHA_KS_PASSPHRASE") + val storeFilePath = System.getenv("ALPHA_KS_FILE") + if (storeFilePath != null) { + storeFile = file(storeFilePath) + } + storePassword = System.getenv("ALPHA_KS_STORE_PASSPHRASE") + } + } + + splits { + abi { + isEnable = true + reset() + include("x86", "armeabi-v7a", "arm64-v8a", "x86_64") + isUniversalApk = true + } + } + + + + buildTypes { + getByName("release") { + isMinifyEnabled = true + isShrinkResources = true + proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") + ndk { + debugSymbolLevel = "SYMBOL_TABLE" + abiFilters += listOf("arm64-v8a", "armeabi-v7a", "x86_64") + } + if (!deGoogled) { + configure { + nativeSymbolUploadEnabled = true + } + } + } + create("leakCanary") { + initWith(getByName("debug")) + matchingFallbacks += listOf("debug") + } + create("alpha") { + applicationIdSuffix = ".alpha" + isMinifyEnabled = true + isShrinkResources = true + signingConfig = signingConfigs.getByName("alpha") + proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") + } + } + + if (!deGoogled) { + afterEvaluate { + tasks.configureEach { + if (name.contains("injectCrashlyticsBuildIds")) { + enabled = false + logger.warn("disabled build id injection for: $name") + } + if (name.contains("uploadCrashlyticsSymbolFile")) { + doFirst { + logger.info("uploading crashlytics symbols: $name") + } + } + } + } + } + + + + buildFeatures { + viewBinding = true + buildConfig = true + compose = true + } + + compileOptions { + isCoreLibraryDesugaringEnabled = true + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + packaging { + jniLibs { + keepDebugSymbols += listOf("**/*.so") + } + } + + flavorDimensions += listOf("releaseChannel", "releaseType") + productFlavors { + create("play") { + dimension = "releaseChannel" + } + create("fdroid") { + dimension = "releaseChannel" + } + create("website") { + dimension = "releaseChannel" + } + create("full") { + dimension = "releaseType" + versionCode = getVersionCode(project) + versionName = gitVersion + vectorDrawables.useSupportLibrary = true + } + } + + lint { + abortOnError = true + warningsAsErrors = true + checkDependencies = true + baseline = file("lint-baseline.xml") + xmlReport = true + htmlReport = true + sarifReport = true + } +} + +configure { + parallel = true + buildUponDefaultConfig = true + allRules = false + config.setFrom("$rootDir/config/detekt/detekt.yml") + baseline = file("$rootDir/config/detekt/baseline.xml") + source.setFrom( + files( + "src/main/java", + "src/full/java" + ) + ) +} + +tasks.withType().configureEach { + jvmTarget = "17" + reports { + html.required.set(true) + xml.required.set(true) + sarif.required.set(true) + txt.required.set(false) + md.required.set(false) + } +} + +val download by configurations.creating { + isTransitive = false +} + +val firestackRepo = project.findProperty("firestackRepo") as? String ?: "github" +val firestackCommit = project.findProperty("firestackCommit") as? String ?: "main" + +fun firestackDependency(suffix: String = ":debug"): String { + return when (firestackRepo) { + "jitpack", "github" -> "com.github.celzero:firestack:$firestackCommit$suffix@aar" + "ossrh" -> "com.celzero:firestack:$firestackCommit$suffix@aar" + else -> throw GradleException("Unknown firestackRepo: $firestackRepo") + } +} + +dependencies { + implementation(libs.guava) + implementation(libs.androidx.compose.foundation) + implementation(libs.androidx.compose.animation) + coreLibraryDesugaring(libs.desugar.jdk.libs) + + "fullImplementation"(libs.kotlin.stdlib.jdk8) + "fullImplementation"(libs.androidx.appcompat) + "fullImplementation"(libs.androidx.core.ktx) + implementation(libs.androidx.preference.ktx) + "fullImplementation"(libs.androidx.constraintlayout) + "fullImplementation"(libs.androidx.swiperefreshlayout) + + // Compose + val composeBom = platform(libs.androidx.compose.bom) + implementation(composeBom) + implementation(libs.androidx.ui) + implementation(libs.androidx.ui.text) + implementation(libs.androidx.ui.graphics) + implementation(libs.androidx.ui.tooling.preview) + implementation(libs.androidx.material3) + implementation(libs.androidx.compose.material.icons.extended) + implementation(libs.androidx.activity.compose) + implementation(libs.androidx.lifecycle.runtime.compose) + implementation(libs.androidx.navigation.compose) + implementation(libs.materialkolor) + debugImplementation(libs.androidx.ui.tooling) + + "fullImplementation"(libs.kotlinx.coroutines.core) + "fullImplementation"(libs.kotlinx.coroutines.android) + implementation(libs.kotlinx.serialization.json) + + implementation(libs.androidx.lifecycle.livedata.ktx) + implementation(libs.gson) + implementation(libs.napier) + + // Room + implementation(libs.androidx.room.runtime) + ksp(libs.androidx.room.compiler) + implementation(libs.androidx.room.ktx) + implementation(libs.androidx.room.paging) + + "fullImplementation"(libs.androidx.lifecycle.viewmodel.ktx) + "fullImplementation"(libs.androidx.lifecycle.runtime.ktx) + + // Paging + implementation(libs.androidx.paging.runtime.ktx) + implementation(libs.androidx.paging.compose) + "fullImplementation"(libs.androidx.fragment.ktx) + "fullImplementation"(libs.androidx.viewpager2) + + "fullImplementation"(libs.okhttp) + "fullImplementation"(libs.okhttp.dnsoverhttps) + + "fullImplementation"(libs.retrofit) + "fullImplementation"(libs.retrofit.converter.gson) + + implementation(libs.okio.jvm) + + "fullImplementation"(libs.glide) { + exclude(group = "glide-parent") + } + "fullImplementation"(libs.glide.okhttp3.integration) { + exclude(group = "glide-parent") + } + + "kspFull"(libs.glide.compiler) + + "fullImplementation"(libs.shimmer) + + download(libs.koin.core) + implementation(libs.koin.core) + download(libs.koin.android) + implementation(libs.koin.android) + + download(libs.krate) + implementation(libs.krate) + + "fullImplementation"(libs.viewbindingpropertydelegate) + "fullImplementation"(libs.viewbindingpropertydelegate.noreflection) + + download(firestackDependency()) + "websiteImplementation"(firestackDependency()) + "fdroidImplementation"(firestackDependency()) + "playImplementation"(firestackDependency()) + + implementation(libs.androidx.work.runtime.ktx) { + modules { + module("com.google.guava:listenablefuture") { + replacedBy("com.google.guava:guava", "listenablefuture is part of guava") + } + } + } + + download(libs.ipaddress) + implementation(libs.ipaddress) + + testImplementation(libs.junit) + androidTestImplementation(libs.androidx.test.ext.junit) + androidTestImplementation(libs.androidx.test.espresso.core) + androidTestImplementation(libs.androidx.test.rules) + testImplementation(libs.robolectric) + testImplementation(libs.androidx.test.core) + testImplementation(libs.androidx.test.ext.junit) + testImplementation(libs.mockito.core) + testImplementation(libs.mockk) + testImplementation(libs.mockk.android) + testImplementation(libs.androidx.arch.core.testing) + testImplementation(libs.kotlinx.coroutines.test) + testImplementation(libs.koin.test) + testImplementation(libs.koin.test.junit4) + androidTestImplementation(libs.mockk.android) + + "leakCanaryImplementation"(libs.leakcanary.android) + + "fullImplementation"(libs.androidx.navigation.fragment.ktx) + "fullImplementation"(libs.androidx.navigation.ui.ktx) + + "fullImplementation"(libs.androidx.biometric) + + "playImplementation"(libs.play.app.update) + "playImplementation"(libs.play.app.update.ktx) + + implementation(libs.androidx.security.crypto) + implementation(libs.androidx.security.app.authenticator) + androidTestImplementation(libs.androidx.security.app.authenticator) + + "fullImplementation"(libs.zxing.embedded) + "fullImplementation"(libs.recyclerview.fastscroll) + "fullImplementation"(libs.konfetti) + + // lint + lintChecks(libs.android.security.lint) + + implementation(libs.betterypermissionhelper) + + "websiteImplementation"(platform(libs.firebase.bom)) + "websiteImplementation"(libs.firebase.crashlytics) + "websiteImplementation"(libs.firebase.crashlytics.ndk) + + "playImplementation"(platform(libs.firebase.bom)) + "playImplementation"(libs.firebase.crashlytics) + "playImplementation"(libs.firebase.crashlytics.ndk) +} + +androidComponents { + onVariants { variant -> + val versionCodes = mapOf( + "armeabi-v7a" to 2, + "arm64-v8a" to 3, + "x86" to 8, + "x86_64" to 9 + ) + val mainOutput = variant.outputs.singleOrNull { + it.filters.any { filter -> filter.filterType == com.android.build.api.variant.FilterConfiguration.FilterType.ABI } + } + mainOutput?.let { output -> + val abi = output.filters.find { it.filterType == com.android.build.api.variant.FilterConfiguration.FilterType.ABI }?.identifier + val baseAbiVersionCode = versionCodes[abi] + if (baseAbiVersionCode != null) { + // Use map to calculate version code properly from the provider + val calculatedVersionCode = variant.outputs.first().versionCode.map { base -> + ((baseAbiVersionCode * 10000000) + (base ?: 0)).toInt() + } + output.versionCode.set(calculatedVersionCode) + } + } + } +} + +kotlin { + compilerOptions { + jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17) + freeCompilerArgs.add("-Xwarning-level=SENSELESS_COMPARISON:disabled") + } +} diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 000000000..47d9219ef --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,42 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { + alias(libs.plugins.android.application) apply false + alias(libs.plugins.kotlin.android) apply false + alias(libs.plugins.ksp) apply false + alias(libs.plugins.google.services) apply false + alias(libs.plugins.firebase.crashlytics) apply false + alias(libs.plugins.detekt) apply false + alias(libs.plugins.version.catalog.update) + alias(libs.plugins.ben.manes.versions) +} + +allprojects { + repositories { + google() + mavenCentral() + + val firestackRepo = project.findProperty("firestackRepo") as? String ?: "github" + + if (firestackRepo == "jitpack") { + // jitpack.io/#celzero/firestack + maven("https://jitpack.io") + } else if (firestackRepo == "github") { + // maven.pkg.github.com/celzero/firestack + maven { + name = "GitHubPackages" + url = uri("https://maven.pkg.github.com/celzero/firestack") + credentials { + username = project.findProperty("gpr.user") as? String ?: System.getenv("USERNAME_GITHUB") + password = project.findProperty("gpr.key") as? String ?: System.getenv("TOKEN_GITHUB") + } + } + } else { + // ossrh: https://central.sonatype.com/artifact/com.celzero/firestack/ + // no-op; mavenCentral is already included + } + } +} + +tasks.register("clean") { + delete(rootProject.layout.buildDirectory) +} diff --git a/gradle.properties b/gradle.properties index c79979dce..0e92aa22b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ # http://www.gradle.org/docs/current/userguide/build_environment.html # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. -org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +org.gradle.jvmargs=-Xmx4096m -Dfile.encoding=UTF-8 --enable-native-access=ALL-UNNAMED # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects diff --git a/gradle/gradle-daemon-jvm.properties b/gradle/gradle-daemon-jvm.properties new file mode 100644 index 000000000..6c1139ec0 --- /dev/null +++ b/gradle/gradle-daemon-jvm.properties @@ -0,0 +1,12 @@ +#This file is generated by updateDaemonJvm +toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/ec7520a1e057cd116f9544c42142a16b/redirect +toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/4c4f879899012ff0a8b2e2117df03b0e/redirect +toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/ec7520a1e057cd116f9544c42142a16b/redirect +toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/4c4f879899012ff0a8b2e2117df03b0e/redirect +toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/73bcfb608d1fde9fb62e462f834a3299/redirect +toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/846ee0d876d26a26f37aa1ce8de73224/redirect +toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/ec7520a1e057cd116f9544c42142a16b/redirect +toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/4c4f879899012ff0a8b2e2117df03b0e/redirect +toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/9482ddec596298c84656d31d16652665/redirect +toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/39701d92e1756bb2f141eb67cd4c660e/redirect +toolchainVersion=21 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 000000000..d811d8dfe --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,192 @@ +[versions] +activityCompose = "1.13.0" +# Plugins +agp = "9.2.1" +androidxTestCore = "1.7.0" +androidxTestExt = "1.3.0" +androidxTestRules = "1.7.0" +animation = "1.11.2" +appcompat = "1.7.1" +archCoreTesting = "2.2.0" +benManesVersions = "0.54.0" +betterypermissionhelper = "1.0.3" +biometric = "1.4.0-alpha07" +composeBom = "2026.05.01" +constraintlayout = "2.2.1" +# AndroidX +coreKtx = "1.19.0" +coroutines = "1.11.0" +crashlytics = "3.0.7" +desugarJdkLibs = "2.1.5" +detekt = "1.23.8" +espresso = "3.7.0" +fastscroll = "2.0.1" +# Firebase & Play Services +firebaseBom = "34.14.0" +foundation = "1.11.2" +fragment = "1.8.9" +glide = "5.0.7" +googleServices = "4.4.4" +gson = "2.14.0" +guava = "33.6.0-jre" +ipaddress = "5.6.2" +# Testing +junit = "4.13.2" +# DI & Utils +koin = "4.2.1" +konfetti = "2.1.0-beta01" +kotlin = "2.4.0" +kotlinxSerialization = "1.11.0" +krate = "2.0.0" +ksp = "2.3.9" +leakcanary = "3.0-alpha-8" +# Lifecycle & Coroutines +lifecycle = "2.10.0" +lifecycleRuntimeCompose = "2.10.0" +lint = "1.0.4" +# UI & Material +m3 = "1.5.0-alpha21" +materialkolor = "5.0.0-alpha07" +mockito = "5.23.0" +mockk = "1.14.11" +napier = "2.7.1" +# Navigation +navigation = "2.9.8" +# Network & Serialization +okhttp = "5.3.2" +okio = "3.17.0" +paging = "3.5.0" +playAppUpdate = "2.1.0" +preference = "1.2.1" +retrofit = "3.0.0" +robolectric = "4.16.1" +# Database & Paging +room = "2.8.4" +securityAppAuthenticator = "1.0.0" +securityCrypto = "1.1.0" +shimmer = "0.5.0" +swiperefreshlayout = "1.2.0" +versionCatalogUpdate = "1.1.0" +viewbindingpropertydelegate = "1.5.9" +viewpager2 = "1.1.0" +work = "2.11.2" +zxing = "4.3.0" + +[libraries] +android-security-lint = { module = "com.android.security.lint:lint", version.ref = "lint" } +# Compose +androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "activityCompose" } +androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" } +androidx-arch-core-testing = { module = "androidx.arch.core:core-testing", version.ref = "archCoreTesting" } +androidx-biometric = { module = "androidx.biometric:biometric", version.ref = "biometric" } +androidx-compose-animation = { module = "androidx.compose.animation:animation", version.ref = "animation" } +androidx-compose-bom = { module = "androidx.compose:compose-bom", version.ref = "composeBom" } +androidx-compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "foundation" } +androidx-compose-material-icons-extended = { module = "androidx.compose.material:material-icons-extended" } +androidx-constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintlayout" } +# AndroidX +androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "coreKtx" } +androidx-fragment-ktx = { module = "androidx.fragment:fragment-ktx", version.ref = "fragment" } +# Lifecycle +androidx-lifecycle-livedata-ktx = { module = "androidx.lifecycle:lifecycle-livedata-ktx", version.ref = "lifecycle" } +androidx-lifecycle-runtime-compose = { module = "androidx.lifecycle:lifecycle-runtime-compose", version.ref = "lifecycleRuntimeCompose" } +androidx-lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycle" } +androidx-lifecycle-viewmodel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "lifecycle" } +androidx-material3 = { module = "androidx.compose.material3:material3", version.ref = "m3" } +androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "navigation" } +# Navigation +androidx-navigation-fragment-ktx = { module = "androidx.navigation:navigation-fragment-ktx", version.ref = "navigation" } +androidx-navigation-ui-ktx = { module = "androidx.navigation:navigation-ui-ktx", version.ref = "navigation" } +androidx-paging-compose = { module = "androidx.paging:paging-compose", version.ref = "paging" } +# Paging +androidx-paging-runtime-ktx = { module = "androidx.paging:paging-runtime-ktx", version.ref = "paging" } +androidx-preference-ktx = { module = "androidx.preference:preference-ktx", version.ref = "preference" } +androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "room" } +androidx-room-ktx = { module = "androidx.room:room-ktx", version.ref = "room" } +androidx-room-paging = { module = "androidx.room:room-paging", version.ref = "room" } +# Room +androidx-room-runtime = { module = "androidx.room:room-runtime", version.ref = "room" } +androidx-security-app-authenticator = { module = "androidx.security:security-app-authenticator", version.ref = "securityAppAuthenticator" } +androidx-security-crypto = { module = "androidx.security:security-crypto", version.ref = "securityCrypto" } +androidx-swiperefreshlayout = { module = "androidx.swiperefreshlayout:swiperefreshlayout", version.ref = "swiperefreshlayout" } +androidx-test-core = { module = "androidx.test:core", version.ref = "androidxTestCore" } +androidx-test-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espresso" } +androidx-test-ext-junit = { module = "androidx.test.ext:junit", version.ref = "androidxTestExt" } +androidx-test-rules = { module = "androidx.test:rules", version.ref = "androidxTestRules" } +androidx-ui = { module = "androidx.compose.ui:ui" } +androidx-ui-graphics = { module = "androidx.compose.ui:ui-graphics" } +androidx-ui-text = { module = "androidx.compose.ui:ui-text" } +androidx-ui-tooling = { module = "androidx.compose.ui:ui-tooling" } +androidx-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" } +androidx-viewpager2 = { module = "androidx.viewpager2:viewpager2", version.ref = "viewpager2" } +androidx-work-runtime-ktx = { module = "androidx.work:work-runtime-ktx", version.ref = "work" } +betterypermissionhelper = { module = "com.waseemsabir:betterypermissionhelper", version.ref = "betterypermissionhelper" } +# Desugar +desugar-jdk-libs = { module = "com.android.tools:desugar_jdk_libs", version.ref = "desugarJdkLibs" } +# Firebase & Play +firebase-bom = { module = "com.google.firebase:firebase-bom", version.ref = "firebaseBom" } +firebase-crashlytics = { module = "com.google.firebase:firebase-crashlytics" } +firebase-crashlytics-ndk = { module = "com.google.firebase:firebase-crashlytics-ndk" } +# Glide +glide = { module = "com.github.bumptech.glide:glide", version.ref = "glide" } +glide-compiler = { module = "com.github.bumptech.glide:compiler", version.ref = "glide" } +glide-okhttp3-integration = { module = "com.github.bumptech.glide:okhttp3-integration", version.ref = "glide" } +# Google Material +gson = { module = "com.google.code.gson:gson", version.ref = "gson" } +guava = { module = "com.google.guava:guava", version.ref = "guava" } +ipaddress = { module = "com.github.seancfoley:ipaddress", version.ref = "ipaddress" } +# Testing +junit = { module = "junit:junit", version.ref = "junit" } +koin-android = { module = "io.insert-koin:koin-android", version.ref = "koin" } +# DI - Koin +koin-core = { module = "io.insert-koin:koin-core", version.ref = "koin" } +koin-test = { module = "io.insert-koin:koin-test", version.ref = "koin" } +koin-test-junit4 = { module = "io.insert-koin:koin-test-junit4", version.ref = "koin" } +konfetti = { module = "nl.dionsegijn:konfetti-xml", version.ref = "konfetti" } +# Kotlin +kotlin-stdlib-jdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" } +kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines" } +kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" } +kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" } +kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerialization" } +# Utils +krate = { module = "hu.autsoft:krate", version.ref = "krate" } +leakcanary-android = { module = "com.squareup.leakcanary:leakcanary-android", version.ref = "leakcanary" } +materialkolor = { module = "com.materialkolor:material-kolor-android", version.ref = "materialkolor" } +mockito-core = { module = "org.mockito:mockito-core", version.ref = "mockito" } +mockk = { module = "io.mockk:mockk", version.ref = "mockk" } +mockk-android = { module = "io.mockk:mockk-android", version.ref = "mockk" } +napier = { module = "io.github.aakira:napier", version.ref = "napier" } +# Network +okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" } +okhttp-dnsoverhttps = { module = "com.squareup.okhttp3:okhttp-dnsoverhttps", version.ref = "okhttp" } +okio-jvm = { module = "com.squareup.okio:okio-jvm", version.ref = "okio" } +play-app-update = { module = "com.google.android.play:app-update", version.ref = "playAppUpdate" } +play-app-update-ktx = { module = "com.google.android.play:app-update-ktx", version.ref = "playAppUpdate" } +recyclerview-fastscroll = { module = "com.simplecityapps:recyclerview-fastscroll", version.ref = "fastscroll" } +retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" } +retrofit-converter-gson = { module = "com.squareup.retrofit2:converter-gson", version.ref = "retrofit" } +robolectric = { module = "org.robolectric:robolectric", version.ref = "robolectric" } +# UI Libs +shimmer = { module = "com.facebook.shimmer:shimmer", version.ref = "shimmer" } +viewbindingpropertydelegate = { module = "com.github.kirich1409:viewbindingpropertydelegate", version.ref = "viewbindingpropertydelegate" } +viewbindingpropertydelegate-noreflection = { module = "com.github.kirich1409:viewbindingpropertydelegate-noreflection", version.ref = "viewbindingpropertydelegate" } +zxing-embedded = { module = "com.journeyapps:zxing-android-embedded", version.ref = "zxing" } + +[plugins] +android-application = { id = "com.android.application", version.ref = "agp" } +ben-manes-versions = { id = "com.github.ben-manes.versions", version.ref = "benManesVersions" } +compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } +detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" } +firebase-crashlytics = { id = "com.google.firebase.crashlytics", version.ref = "crashlytics" } +google-services = { id = "com.google.gms.google-services", version.ref = "googleServices" } +kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } +kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } +ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } +version-catalog-update = { id = "nl.littlerobots.version-catalog-update", version.ref = "versionCatalogUpdate" } + +[bundles] +paging = [ + "androidx-paging-compose", + "androidx-paging-runtime-ktx", +] diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index c93368e56..d1ef516b1 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Mon Apr 17 17:05:36 IST 2023 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 000000000..e48d8322d --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,13 @@ +pluginManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} +plugins { + id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0" +} + +rootProject.name = "Bravedns" +include(":app", ":tun2socks")