diff --git a/about/build.gradle.kts b/about/build.gradle.kts index 2ec9db17b..0f523043b 100644 --- a/about/build.gradle.kts +++ b/about/build.gradle.kts @@ -7,8 +7,8 @@ android { namespace = "dev.lucasnlm.antimine.about" defaultConfig { - minSdk = 21 - compileSdk = 34 + minSdk = libs.versions.minSdk.get().toInt() + compileSdk = libs.versions.compileSdk.get().toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") @@ -22,12 +22,12 @@ android { } compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = JavaVersion.VERSION_17.toString() + jvmTarget = JavaVersion.VERSION_11.toString() } buildFeatures { @@ -37,8 +37,6 @@ android { } dependencies { - // Dependencies must be hardcoded to support F-droid - implementation(project(":core")) implementation(project(":i18n")) implementation(project(":preferences")) @@ -48,37 +46,37 @@ dependencies { implementation(project(":external")) // Google - implementation("com.google.android.material:material:1.10.0") + implementation(libs.material) // AndroidX - implementation("androidx.appcompat:appcompat:1.6.1") - implementation("androidx.activity:activity-ktx:1.8.0") - implementation("androidx.fragment:fragment-ktx:1.6.2") + implementation(libs.appcompat) + implementation(libs.activity.ktx) + implementation(libs.fragment.ktx) // RecyclerView - implementation("androidx.recyclerview:recyclerview:1.3.2") + implementation(libs.recyclerview) // Constraint - implementation("androidx.constraintlayout:constraintlayout:2.1.4") + implementation(libs.constraintlayout) // Lifecycle - implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2") + implementation(libs.lifecycle.viewmodel.ktx) // Koin - implementation("io.insert-koin:koin-android:3.1.2") - testImplementation("io.insert-koin:koin-test:3.1.2") + implementation(libs.koin.android) + testImplementation(libs.koin.test) // Coroutines - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3") - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3") - testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3") + implementation(libs.kotlinx.coroutines.core) + implementation(libs.kotlinx.coroutines.android) + testImplementation(libs.kotlinx.coroutines.test) // Kotlin Lib - implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.10") + implementation(libs.kotlin.stdlib) // Unit Tests - testImplementation("junit:junit:4.13.2") - testImplementation("org.mockito:mockito-core:4.6.1") - testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0") - testImplementation("io.mockk:mockk:1.13.5") + testImplementation(libs.junit) + testImplementation(libs.mockito.core) + testImplementation(libs.mockito.kotlin) + testImplementation(libs.mockk) } diff --git a/about/proguard-rules.pro b/about/proguard-rules.pro index ff59496d8..697e219de 100644 --- a/about/proguard-rules.pro +++ b/about/proguard-rules.pro @@ -1,21 +1,3 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle.kts. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +-dontwarn java.lang.invoke.StringConcatFactory +-dontwarn com.google.android.material.R$attr +-dontwarn dev.lucasnlm.antimine.i18n.R$string diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 57785845c..985898f74 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,7 +1,7 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat -val isGoogleBuild: Boolean by rootProject.extra -val isReleaseBuild: Boolean by rootProject.extra +val isGoogleBuild: Boolean = System.getenv("IS_GOOGLE_BUILD")?.isNotBlank() == true +val isReleaseBuild: Boolean = System.getenv("IS_RELEASE_BUILD")?.isNotBlank() == true plugins { id("com.android.application") @@ -13,11 +13,11 @@ android { defaultConfig { // versionCode and versionName must be hardcoded to support F-droid - versionCode = 1705111 - versionName = "17.5.11" - minSdk = 21 - targetSdk = 34 - compileSdk = 34 + versionCode = 1706001 + versionName = "17.6.0" + minSdk = libs.versions.minSdk.get().toInt() + targetSdk = libs.versions.targetSdk.get().toInt() + compileSdk = libs.versions.compileSdk.get().toInt() multiDexEnabled = true vectorDrawables.useSupportLibrary = true testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" @@ -56,12 +56,12 @@ android { } kotlinOptions { - jvmTarget = JavaVersion.VERSION_17.toString() + jvmTarget = JavaVersion.VERSION_11.toString() } compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } testOptions { @@ -107,6 +107,10 @@ android { versionNameSuffix = " F" } } + + lint { + lintConfig = file("$rootDir/lint.xml") + } } val googleImplementation by configurations @@ -114,8 +118,6 @@ val googleInstantImplementation by configurations val fossImplementation by configurations dependencies { - // Dependencies must be hardcoded to support F-droid - implementation(project(":external")) implementation(project(":common")) implementation(project(":control")) @@ -139,59 +141,59 @@ dependencies { googleInstantImplementation(project(":audio-low")) // AndroidX - implementation("androidx.appcompat:appcompat:1.6.1") - implementation("androidx.preference:preference-ktx:1.2.1") - implementation("androidx.recyclerview:recyclerview:1.3.2") - implementation("androidx.multidex:multidex:2.0.1") - implementation("androidx.activity:activity-ktx:1.8.0") - implementation("androidx.fragment:fragment-ktx:1.6.2") + implementation(libs.appcompat) + implementation(libs.preference.ktx) + implementation(libs.recyclerview) + implementation(libs.multidex) + implementation(libs.activity.ktx) + implementation(libs.fragment.ktx) // Lifecycle - implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2") - implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2") - implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.6.2") - implementation("androidx.lifecycle:lifecycle-common-java8:2.6.2") + implementation(libs.lifecycle.viewmodel.ktx) + implementation(libs.lifecycle.runtime.ktx) + implementation(libs.lifecycle.livedata.ktx) + implementation(libs.lifecycle.common.java8) // Constraint - implementation("androidx.constraintlayout:constraintlayout:2.1.4") + implementation(libs.constraintlayout) // Google - implementation("com.google.android.material:material:1.10.0") + implementation(libs.material) // Koin - implementation("io.insert-koin:koin-android:3.1.2") - testImplementation("io.insert-koin:koin-test:3.1.2") + implementation(libs.koin.android) + testImplementation(libs.koin.test) // Kotlin - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3") - implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.10") - testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3") + implementation(libs.kotlinx.coroutines.android) + implementation(libs.kotlin.stdlib) + testImplementation(libs.kotlinx.coroutines.test) // Konfetti - implementation("nl.dionsegijn:konfetti-xml:2.0.3") + implementation(libs.konfetti.xml) // Tests - testImplementation("junit:junit:4.13.2") - testImplementation("androidx.core:core-ktx:1.12.0") - testImplementation("androidx.test:core-ktx:1.5.0") - testImplementation("androidx.test:rules:1.5.0") - testImplementation("androidx.test:runner:1.5.2") - testImplementation("androidx.test.espresso:espresso-core:3.5.1") - testImplementation("androidx.fragment:fragment-testing:1.6.2") - testImplementation("org.robolectric:robolectric:4.5.1") - testImplementation("androidx.test.ext:junit:1.1.5") - testImplementation("io.mockk:mockk:1.13.5") + testImplementation(libs.junit) + testImplementation(libs.core.ktx) + testImplementation(libs.test.core.ktx) + testImplementation(libs.rules) + testImplementation(libs.runner) + testImplementation(libs.espresso.core) + testImplementation(libs.fragment.testing) + testImplementation(libs.robolectric) + testImplementation(libs.ext.junit) + testImplementation(libs.mockk) // Core library - androidTestImplementation("androidx.test:core:1.5.0") + androidTestImplementation(libs.test.core) // AndroidJUnitRunner and JUnit Rules - androidTestImplementation("androidx.test:core:1.5.0") - androidTestImplementation("androidx.test:core-ktx:1.5.0") - androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") - androidTestImplementation("androidx.test:runner:1.5.2") - androidTestImplementation("androidx.test:rules:1.5.0") - androidTestUtil("androidx.test:orchestrator:1.4.2") + androidTestImplementation(libs.test.core) + androidTestImplementation(libs.test.core.ktx) + androidTestImplementation(libs.espresso.core) + androidTestImplementation(libs.runner) + androidTestImplementation(libs.rules) + androidTestUtil(libs.orchestrator) } tasks.withType().configureEach { @@ -221,7 +223,7 @@ tasks.withType().configureEach { } // The following code disables Google Services when building for F-Droid -if (isGoogleBuild) { +if (!isGoogleBuild) { android.applicationVariants.configureEach { if (flavorName == "foss") { project diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 8561fbbdd..485711dbb 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -81,3 +81,7 @@ -dontwarn javax.annotation.processing.AbstractProcessor -dontwarn javax.annotation.processing.SupportedOptions +-dontwarn java.lang.invoke.StringConcatFactory +-dontwarn com.google.android.material.R$attr +-dontwarn dev.lucasnlm.antimine.i18n.R$string + diff --git a/audio-low/build.gradle.kts b/audio-low/build.gradle.kts index 0acdabf5a..b8d880e12 100644 --- a/audio-low/build.gradle.kts +++ b/audio-low/build.gradle.kts @@ -7,8 +7,8 @@ android { namespace = "dev.lucasnlm.antimine.audio" defaultConfig { - minSdk = 21 - compileSdk = 34 + minSdk = libs.versions.minSdk.get().toInt() + compileSdk = libs.versions.compileSdk.get().toInt() } buildTypes { @@ -19,12 +19,12 @@ android { } compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = JavaVersion.VERSION_17.toString() + jvmTarget = JavaVersion.VERSION_11.toString() } buildFeatures { diff --git a/audio-low/proguard-rules.pro b/audio-low/proguard-rules.pro index ff59496d8..697e219de 100644 --- a/audio-low/proguard-rules.pro +++ b/audio-low/proguard-rules.pro @@ -1,21 +1,3 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle.kts. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +-dontwarn java.lang.invoke.StringConcatFactory +-dontwarn com.google.android.material.R$attr +-dontwarn dev.lucasnlm.antimine.i18n.R$string diff --git a/audio/build.gradle.kts b/audio/build.gradle.kts index 0acdabf5a..b8d880e12 100644 --- a/audio/build.gradle.kts +++ b/audio/build.gradle.kts @@ -7,8 +7,8 @@ android { namespace = "dev.lucasnlm.antimine.audio" defaultConfig { - minSdk = 21 - compileSdk = 34 + minSdk = libs.versions.minSdk.get().toInt() + compileSdk = libs.versions.compileSdk.get().toInt() } buildTypes { @@ -19,12 +19,12 @@ android { } compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = JavaVersion.VERSION_17.toString() + jvmTarget = JavaVersion.VERSION_11.toString() } buildFeatures { diff --git a/audio/proguard-rules.pro b/audio/proguard-rules.pro index ff59496d8..697e219de 100644 --- a/audio/proguard-rules.pro +++ b/audio/proguard-rules.pro @@ -1,21 +1,3 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle.kts. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +-dontwarn java.lang.invoke.StringConcatFactory +-dontwarn com.google.android.material.R$attr +-dontwarn dev.lucasnlm.antimine.i18n.R$string diff --git a/build.gradle.kts b/build.gradle.kts index a419e61c5..090b53cdc 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,9 +1,4 @@ buildscript { - extra.apply{ - set("isGoogleBuild", System.getenv("IS_GOOGLE_BUILD")?.isNotBlank() == true) - set("isReleaseBuild", System.getenv("IS_RELEASE_BUILD")?.isNotBlank() == true) - } - dependencies { if (System.getenv("IS_GOOGLE_BUILD") == "1") { classpath("com.bugsnag:bugsnag-android-gradle-plugin:8.1.0") @@ -12,10 +7,13 @@ buildscript { } plugins { - id("com.android.application") version "8.1.3" apply false - id("com.android.library") version "8.1.3" apply false - id("org.jetbrains.kotlin.android") version "1.9.10" apply false - id("com.google.gms.google-services") version "4.4.0" apply false + alias(libs.plugins.android) apply false + alias(libs.plugins.android.library) apply false + alias(libs.plugins.kotlin.android) apply false + + if (System.getenv("IS_GOOGLE_BUILD")?.isNotBlank() == true) { + alias(libs.plugins.google.services) apply false + } } allprojects { diff --git a/common/build.gradle.kts b/common/build.gradle.kts index 76d2b0764..b94603d55 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -7,27 +7,26 @@ android { namespace = "dev.lucasnlm.antimine.common" defaultConfig { - // versionCode and versionName must be hardcoded to support F-droid - minSdk = 21 - compileSdk = 34 + minSdk = libs.versions.minSdk.get().toInt() + compileSdk = libs.versions.compileSdk.get().toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") } buildTypes { release { - isMinifyEnabled = true + isMinifyEnabled = false setProguardFiles(listOf(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")) } } compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = JavaVersion.VERSION_17.toString() + jvmTarget = JavaVersion.VERSION_11.toString() } buildFeatures { @@ -37,8 +36,6 @@ android { } dependencies { - // Dependencies must be hardcoded to support F-droid - implementation(project(":core")) implementation(project(":external")) implementation(project(":i18n")) @@ -50,44 +47,44 @@ dependencies { implementation(project(":control")) // AndroidX - implementation("androidx.appcompat:appcompat:1.6.1") - implementation("androidx.preference:preference-ktx:1.2.1") - implementation("androidx.recyclerview:recyclerview:1.3.2") - implementation("androidx.activity:activity-ktx:1.8.0") - implementation("androidx.fragment:fragment-ktx:1.6.2") + implementation(libs.appcompat) + implementation(libs.preference.ktx) + implementation(libs.recyclerview) + implementation(libs.activity.ktx) + implementation(libs.fragment.ktx) // Google - implementation("com.google.android.material:material:1.10.0") + implementation(libs.material) // Constraint - implementation("androidx.constraintlayout:constraintlayout:2.1.4") + implementation(libs.constraintlayout) // Lifecycle - implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2") + implementation(libs.lifecycle.viewmodel.ktx) // Koin - implementation("io.insert-koin:koin-android:3.1.2") - testImplementation("io.insert-koin:koin-test:3.1.2") + implementation(libs.koin.android) + testImplementation(libs.koin.test) // Coroutines - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3") - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3") - testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3") + implementation(libs.kotlinx.coroutines.core) + implementation(libs.kotlinx.coroutines.android) + testImplementation(libs.kotlinx.coroutines.test) // Kotlin Lib - implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.10") + implementation(libs.kotlin.stdlib) // Unit Tests - testImplementation("junit:junit:4.13.2") - testImplementation("org.mockito:mockito-core:4.6.1") - testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0") - testImplementation("io.mockk:mockk:1.13.5") + testImplementation(libs.junit) + testImplementation(libs.mockito.core) + testImplementation(libs.mockito.kotlin) + testImplementation(libs.mockk) // Core library - androidTestImplementation("androidx.test:core:1.5.0") + androidTestImplementation(libs.test.core) // AndroidJUnitRunner and JUnit Rules - androidTestImplementation("androidx.test:runner:1.5.2") - androidTestImplementation("androidx.test:rules:1.5.0") - androidTestUtil("androidx.test:orchestrator:1.4.2") + androidTestImplementation(libs.runner) + androidTestImplementation(libs.rules) + androidTestUtil(libs.orchestrator) } diff --git a/common/proguard-rules.pro b/common/proguard-rules.pro index ff59496d8..697e219de 100644 --- a/common/proguard-rules.pro +++ b/common/proguard-rules.pro @@ -1,21 +1,3 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle.kts. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +-dontwarn java.lang.invoke.StringConcatFactory +-dontwarn com.google.android.material.R$attr +-dontwarn dev.lucasnlm.antimine.i18n.R$string diff --git a/control/build.gradle.kts b/control/build.gradle.kts index 335eb227c..6766b7755 100644 --- a/control/build.gradle.kts +++ b/control/build.gradle.kts @@ -7,8 +7,8 @@ android { namespace = "dev.lucasnlm.antimine.control" defaultConfig { - minSdk = 21 - compileSdk = 34 + minSdk = libs.versions.minSdk.get().toInt() + compileSdk = libs.versions.compileSdk.get().toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") @@ -16,18 +16,18 @@ android { buildTypes { release { - isMinifyEnabled = true + isMinifyEnabled = false setProguardFiles(listOf(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")) } } compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = JavaVersion.VERSION_17.toString() + jvmTarget = JavaVersion.VERSION_11.toString() } buildFeatures { @@ -37,8 +37,6 @@ android { } dependencies { - // Dependencies must be hardcoded to support F-droid - implementation(project(":core")) implementation(project(":i18n")) implementation(project(":preferences")) @@ -46,37 +44,37 @@ dependencies { implementation(project(":utils")) // Google - implementation("com.google.android.material:material:1.10.0") + implementation(libs.material) // AndroidX - implementation("androidx.appcompat:appcompat:1.6.1") - implementation("androidx.activity:activity-ktx:1.8.0") - implementation("androidx.fragment:fragment-ktx:1.6.2") + implementation(libs.appcompat) + implementation(libs.activity.ktx) + implementation(libs.fragment.ktx) // RecyclerView - implementation("androidx.recyclerview:recyclerview:1.3.2") + implementation(libs.recyclerview) // Constraint - implementation("androidx.constraintlayout:constraintlayout:2.1.4") + implementation(libs.constraintlayout) // Lifecycle - implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2") + implementation(libs.lifecycle.viewmodel.ktx) // Koin - implementation("io.insert-koin:koin-android:3.1.2") - testImplementation("io.insert-koin:koin-test:3.1.2") + implementation(libs.koin.android) + testImplementation(libs.koin.test) // Coroutines - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3") - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3") - testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3") + implementation(libs.kotlinx.coroutines.core) + implementation(libs.kotlinx.coroutines.android) + testImplementation(libs.kotlinx.coroutines.test) // Kotlin Lib - implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.10") + implementation(libs.kotlin.stdlib) // Unit Tests - testImplementation("junit:junit:4.13.2") - testImplementation("org.mockito:mockito-core:4.6.1") - testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0") - testImplementation("io.mockk:mockk:1.13.5") + testImplementation(libs.junit) + testImplementation(libs.mockito.core) + testImplementation(libs.mockito.kotlin) + testImplementation(libs.mockk) } diff --git a/control/proguard-rules.pro b/control/proguard-rules.pro index ff59496d8..697e219de 100644 --- a/control/proguard-rules.pro +++ b/control/proguard-rules.pro @@ -1,21 +1,3 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle.kts. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +-dontwarn java.lang.invoke.StringConcatFactory +-dontwarn com.google.android.material.R$attr +-dontwarn dev.lucasnlm.antimine.i18n.R$string diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 602362868..d8962544e 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -7,8 +7,8 @@ android { namespace = "dev.lucasnlm.antimine.core" defaultConfig { - minSdk = 21 - compileSdk = 34 + minSdk = libs.versions.minSdk.get().toInt() + compileSdk = libs.versions.compileSdk.get().toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") @@ -16,18 +16,18 @@ android { buildTypes { release { - isMinifyEnabled = true + isMinifyEnabled = false setProguardFiles(listOf(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")) } } compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = JavaVersion.VERSION_17.toString() + jvmTarget = JavaVersion.VERSION_11.toString() } buildFeatures { @@ -37,26 +37,24 @@ android { } dependencies { - // Dependencies must be hardcoded to support F-droid - implementation(project(":preferences")) implementation(project(":utils")) // Kotlin - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3") - implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.10") - testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3") + implementation(libs.kotlinx.coroutines.android) + implementation(libs.kotlin.stdlib) + testImplementation(libs.kotlinx.coroutines.test) // Koin - implementation("io.insert-koin:koin-android:3.1.2") - testImplementation("io.insert-koin:koin-test:3.1.2") + implementation(libs.koin.android) + testImplementation(libs.koin.test) // AndroidX - implementation("androidx.appcompat:appcompat:1.6.1") + implementation(libs.appcompat) // Lifecycle - implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2") - implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2") - implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.6.2") - implementation("androidx.lifecycle:lifecycle-common-java8:2.6.2") + implementation(libs.lifecycle.viewmodel.ktx) + implementation(libs.lifecycle.runtime.ktx) + implementation(libs.lifecycle.livedata.ktx) + implementation(libs.lifecycle.common.java8) } diff --git a/core/proguard-rules.pro b/core/proguard-rules.pro index ff59496d8..697e219de 100644 --- a/core/proguard-rules.pro +++ b/core/proguard-rules.pro @@ -1,21 +1,3 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle.kts. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +-dontwarn java.lang.invoke.StringConcatFactory +-dontwarn com.google.android.material.R$attr +-dontwarn dev.lucasnlm.antimine.i18n.R$string diff --git a/donation/build.gradle.kts b/donation/build.gradle.kts index dcba3c2e7..533e16852 100644 --- a/donation/build.gradle.kts +++ b/donation/build.gradle.kts @@ -7,8 +7,8 @@ android { namespace = "dev.lucasnlm.antimine.donation" defaultConfig { - minSdk = 21 - compileSdk = 34 + minSdk = libs.versions.minSdk.get().toInt() + compileSdk = libs.versions.compileSdk.get().toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") @@ -16,18 +16,18 @@ android { buildTypes { release { - isMinifyEnabled = true + isMinifyEnabled = false setProguardFiles(listOf(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")) } } compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = JavaVersion.VERSION_17.toString() + jvmTarget = JavaVersion.VERSION_11.toString() } buildFeatures { @@ -37,8 +37,6 @@ android { } dependencies { - // Dependencies must be hardcoded to support F-droid - implementation(project(":core")) implementation(project(":external")) implementation(project(":i18n")) @@ -47,37 +45,37 @@ dependencies { implementation(project(":utils")) // AndroidX - implementation("androidx.appcompat:appcompat:1.6.1") - implementation("androidx.activity:activity-ktx:1.8.0") - implementation("androidx.fragment:fragment-ktx:1.6.2") + implementation(libs.appcompat) + implementation(libs.activity.ktx) + implementation(libs.fragment.ktx) // Google - implementation("com.google.android.material:material:1.10.0") + implementation(libs.material) // RecyclerView - implementation("androidx.recyclerview:recyclerview:1.3.2") + implementation(libs.recyclerview) // Constraint - implementation("androidx.constraintlayout:constraintlayout:2.1.4") + implementation(libs.constraintlayout) // Lifecycle - implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2") + implementation(libs.lifecycle.viewmodel.ktx) // Koin - implementation("io.insert-koin:koin-android:3.1.2") - testImplementation("io.insert-koin:koin-test:3.1.2") + implementation(libs.koin.android) + testImplementation(libs.koin.test) // Coroutines - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3") - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3") - testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3") + implementation(libs.kotlinx.coroutines.core) + implementation(libs.kotlinx.coroutines.android) + testImplementation(libs.kotlinx.coroutines.test) // Kotlin Lib - implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.10") + implementation(libs.kotlin.stdlib) // Unit Tests - testImplementation("junit:junit:4.13.2") - testImplementation("org.mockito:mockito-core:4.6.1") - testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0") - testImplementation("io.mockk:mockk:1.13.5") + testImplementation(libs.junit) + testImplementation(libs.mockito.core) + testImplementation(libs.mockito.kotlin) + testImplementation(libs.mockk) } diff --git a/donation/proguard-rules.pro b/donation/proguard-rules.pro index ff59496d8..697e219de 100644 --- a/donation/proguard-rules.pro +++ b/donation/proguard-rules.pro @@ -1,21 +1,3 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle.kts. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +-dontwarn java.lang.invoke.StringConcatFactory +-dontwarn com.google.android.material.R$attr +-dontwarn dev.lucasnlm.antimine.i18n.R$string diff --git a/external/build.gradle.kts b/external/build.gradle.kts index 48c6d2b6b..fd8f63852 100644 --- a/external/build.gradle.kts +++ b/external/build.gradle.kts @@ -7,8 +7,8 @@ android { namespace = "dev.lucasnlm.external" defaultConfig { - minSdk = 21 - compileSdk = 34 + minSdk = libs.versions.minSdk.get().toInt() + compileSdk = libs.versions.compileSdk.get().toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") @@ -16,18 +16,18 @@ android { buildTypes { release { - isMinifyEnabled = true + isMinifyEnabled = false setProguardFiles(listOf(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")) } } compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = JavaVersion.VERSION_17.toString() + jvmTarget = JavaVersion.VERSION_11.toString() } buildFeatures { @@ -37,13 +37,11 @@ android { } dependencies { - // Dependencies must be hardcoded to support F-droid - implementation(project(":core")) implementation(project(":utils")) // Kotlin - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3") - implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.10") - testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3") + implementation(libs.kotlinx.coroutines.android) + implementation(libs.kotlin.stdlib) + testImplementation(libs.kotlinx.coroutines.test) } diff --git a/foss/build.gradle.kts b/foss/build.gradle.kts index 6f18dac1a..1a2a9fa24 100644 --- a/foss/build.gradle.kts +++ b/foss/build.gradle.kts @@ -7,8 +7,8 @@ android { namespace = "dev.lucasnlm.foss" defaultConfig { - minSdk = 21 - compileSdk = 34 + minSdk = libs.versions.minSdk.get().toInt() + compileSdk = libs.versions.compileSdk.get().toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") @@ -16,18 +16,18 @@ android { buildTypes { release { - isMinifyEnabled = true + isMinifyEnabled = false setProguardFiles(listOf(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")) } } compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = JavaVersion.VERSION_17.toString() + jvmTarget = JavaVersion.VERSION_11.toString() } buildFeatures { @@ -37,23 +37,21 @@ android { } dependencies { - // Dependencies must be hardcoded to support F-droid - implementation(project(":external")) implementation(project(":i18n")) // Kotlin - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3") - implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.10") - testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3") + implementation(libs.kotlinx.coroutines.android) + implementation(libs.kotlin.stdlib) + testImplementation(libs.kotlinx.coroutines.test) // Koin - implementation("io.insert-koin:koin-android:3.1.2") - testImplementation("io.insert-koin:koin-test:3.1.2") + implementation(libs.koin.android) + testImplementation(libs.koin.test) // Acra - implementation("ch.acra:acra-core:5.11.2") - implementation("ch.acra:acra-mail:5.11.2") - implementation("ch.acra:acra-toast:5.11.2") - implementation("ch.acra:acra-limiter:5.11.2") + implementation(libs.acra.core) + implementation(libs.acra.mail) + implementation(libs.acra.toast) + implementation(libs.acra.limiter) } diff --git a/foss/proguard-rules.pro b/foss/proguard-rules.pro index 2f9dc5a47..fcc08df98 100644 --- a/foss/proguard-rules.pro +++ b/foss/proguard-rules.pro @@ -1,21 +1,2 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle.kts. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile +-dontwarn com.google.android.material.R$attr +-dontwarn dev.lucasnlm.antimine.i18n.R$string diff --git a/gdx/build.gradle.kts b/gdx/build.gradle.kts index b88c4db33..ac2f93d2e 100644 --- a/gdx/build.gradle.kts +++ b/gdx/build.gradle.kts @@ -9,8 +9,8 @@ android { namespace = "dev.lucasnlm.antimine.gdx" defaultConfig { - minSdk = 21 - compileSdk = 34 + minSdk = libs.versions.minSdk.get().toInt() + compileSdk = libs.versions.compileSdk.get().toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") @@ -18,18 +18,18 @@ android { buildTypes { release { - isMinifyEnabled = true + isMinifyEnabled = false setProguardFiles(listOf(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")) } } compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = JavaVersion.VERSION_17.toString() + jvmTarget = JavaVersion.VERSION_11.toString() } buildFeatures { @@ -53,21 +53,22 @@ dependencies { implementation(project(":utils")) // AndroidX - implementation("androidx.appcompat:appcompat:1.6.1") - implementation("androidx.activity:activity-ktx:1.8.0") - implementation("androidx.fragment:fragment-ktx:1.6.2") + implementation(libs.appcompat) + implementation(libs.activity.ktx) + implementation(libs.fragment.ktx) // Koin - implementation("io.insert-koin:koin-android:3.1.2") - testImplementation("io.insert-koin:koin-test:3.1.2") + implementation(libs.koin.android) + testImplementation(libs.koin.test) // LibGDX - api("com.badlogicgames.gdx:gdx-backend-android:1.11.0") - api("com.badlogicgames.gdx:gdx:1.11.0") - natives("com.badlogicgames.gdx:gdx-platform:1.11.0:natives-armeabi-v7a") - natives("com.badlogicgames.gdx:gdx-platform:1.11.0:natives-arm64-v8a") - natives("com.badlogicgames.gdx:gdx-platform:1.11.0:natives-x86") - natives("com.badlogicgames.gdx:gdx-platform:1.11.0:natives-x86_64") + val gdxVersion = libs.versions.gdx.get() + api(libs.libgdx.backend.android) + api(libs.libgdx) + natives("com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a") + natives("com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a") + natives("com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86") + natives("com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64") } tasks.register("copyAndroidNatives") { @@ -98,16 +99,4 @@ tasks.register("copyAndroidNatives") { } } -// -// tasks.register("copyAndroidNatives") { -// doFirst { - -// -// configurations.natives.files.each { jar -> - -// } -// } -// } -// -// preBuild.dependsOn copyAndroidNatives project.tasks.preBuild.dependsOn("copyAndroidNatives") diff --git a/gdx/proguard-rules.pro b/gdx/proguard-rules.pro index ff59496d8..697e219de 100644 --- a/gdx/proguard-rules.pro +++ b/gdx/proguard-rules.pro @@ -1,21 +1,3 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle.kts. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +-dontwarn java.lang.invoke.StringConcatFactory +-dontwarn com.google.android.material.R$attr +-dontwarn dev.lucasnlm.antimine.i18n.R$string diff --git a/gradle.properties b/gradle.properties index ef67cae03..d848be56d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -26,7 +26,6 @@ android.useAndroidX=true android.nonTransitiveRClass=true android.suppressUnsupportedCompileSdk=34 - # Cache org.gradle.caching=true org.gradle.configureondemand=true \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 000000000..c4bf080ed --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,108 @@ +[versions] +minSdk = "21" +targetSdk = "34" +wearTargetSdk = "33" +wearMinSdk = "25" +compileSdk = "34" + +acra = "5.11.2" +activityKtx = "1.8.0" +amplitude = "2.32.1" +appcompat = "1.6.1" +billingKtx = "6.0.1" +bugsnagAndroid = "5.31.2" +constraintlayout = "2.1.4" +coreKtx = "1.12.0" +coreKtxVersion = "1.5.0" +coreSplashscreen = "1.1.0-alpha02" +espressoCore = "3.5.1" +fragmentKtx = "1.6.2" +gdx = "1.11.0" +google-coreKtx = "1.8.1" +junit = "4.13.2" +junitVersion = "1.1.5" +koinAndroid = "3.1.2" +konfettiXml = "2.0.3" +kotlinxCoroutinesCore = "1.7.3" +lifecycleViewmodelKtx = "2.6.2" +material = "1.10.0" +mockitoCore = "4.6.1" +mockitoKotlin = "2.1.0" +mockk = "1.13.5" +multidex = "2.0.1" +okhttp = "4.10.0" +orchestrator = "1.4.2" +playServicesAds = "22.5.0" +playServicesAuth = "20.7.0" +playServicesGames = "23.1.0" +playServicesInstantapps = "18.0.1" +preferenceKtx = "1.2.1" +recyclerview = "1.3.2" +robolectric = "4.5.1" +runner = "1.5.2" + +# Plugins +bugsnag = "8.1.0" +android = "8.1.3" +kotlin = "1.9.10" +googleServices = "4.4.0" +wear = "1.3.0" + +[libraries] +acra-limiter = { module = "ch.acra:acra-limiter", version.ref = "acra" } +acra-toast = { module = "ch.acra:acra-toast", version.ref = "acra" } +acra-mail = { module = "ch.acra:acra-mail", version.ref = "acra" } +acra-core = { module = "ch.acra:acra-core", version.ref = "acra" } +activity-ktx = { module = "androidx.activity:activity-ktx", version.ref = "activityKtx" } +amplitude-sdk = { module = "com.amplitude:android-sdk", version.ref = "amplitude" } +appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" } +core-splashscreen = { module = "androidx.core:core-splashscreen", version.ref = "coreSplashscreen" } +google-billing-ktx = { module = "com.android.billingclient:billing-ktx", version.ref = "billingKtx" } +bugsnag-android = { module = "com.bugsnag:bugsnag-android", version.ref = "bugsnagAndroid" } +constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintlayout" } +libgdx = { module = "com.badlogicgames.gdx:gdx", version.ref = "gdx" } +libgdx-backend-android = { module = "com.badlogicgames.gdx:gdx-backend-android", version.ref = "gdx" } +kotlinx-coroutines-play-services = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-play-services", version.ref = "kotlinxCoroutinesCore" } +okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" } +orchestrator = { module = "androidx.test:orchestrator", version.ref = "orchestrator" } +play-core-ktx = { module = "com.google.android.play:core-ktx", version.ref = "google-coreKtx" } +play-services-ads = { module = "com.google.android.gms:play-services-ads", version.ref = "playServicesAds" } +play-services-auth = { module = "com.google.android.gms:play-services-auth", version.ref = "playServicesAuth" } +play-services-games = { module = "com.google.android.gms:play-services-games", version.ref = "playServicesGames" } +play-services-instantapps = { module = "com.google.android.gms:play-services-instantapps", version.ref = "playServicesInstantapps" } +test-core = { module = "androidx.test:core", version.ref = "coreKtxVersion" } +core-ktx = { module = "androidx.core:core-ktx", version.ref = "coreKtx" } +espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espressoCore" } +ext-junit = { module = "androidx.test.ext:junit", version.ref = "junitVersion" } +fragment-ktx = { module = "androidx.fragment:fragment-ktx", version.ref = "fragmentKtx" } +fragment-testing = { module = "androidx.fragment:fragment-testing", version.ref = "fragmentKtx" } +junit = { module = "junit:junit", version.ref = "junit" } +koin-android = { module = "io.insert-koin:koin-android", version.ref = "koinAndroid" } +koin-test = { module = "io.insert-koin:koin-test", version.ref = "koinAndroid" } +konfetti-xml = { module = "nl.dionsegijn:konfetti-xml", version.ref = "konfettiXml" } +kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" } +kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinxCoroutinesCore" } +kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinxCoroutinesCore" } +kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinxCoroutinesCore" } +lifecycle-common-java8 = { module = "androidx.lifecycle:lifecycle-common-java8", version.ref = "lifecycleViewmodelKtx" } +lifecycle-livedata-ktx = { module = "androidx.lifecycle:lifecycle-livedata-ktx", version.ref = "lifecycleViewmodelKtx" } +lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycleViewmodelKtx" } +lifecycle-viewmodel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "lifecycleViewmodelKtx" } +material = { module = "com.google.android.material:material", version.ref = "material" } +mockito-core = { module = "org.mockito:mockito-core", version.ref = "mockitoCore" } +mockito-kotlin = { module = "com.nhaarman.mockitokotlin2:mockito-kotlin", version.ref = "mockitoKotlin" } +mockk = { module = "io.mockk:mockk", version.ref = "mockk" } +multidex = { module = "androidx.multidex:multidex", version.ref = "multidex" } +preference-ktx = { module = "androidx.preference:preference-ktx", version.ref = "preferenceKtx" } +recyclerview = { module = "androidx.recyclerview:recyclerview", version.ref = "recyclerview" } +robolectric = { module = "org.robolectric:robolectric", version.ref = "robolectric" } +rules = { module = "androidx.test:rules", version.ref = "coreKtxVersion" } +runner = { module = "androidx.test:runner", version.ref = "runner" } +test-core-ktx = { module = "androidx.test:core-ktx", version.ref = "coreKtxVersion" } +wear = { module = "androidx.wear:wear", version.ref = "wear" } + +[plugins] +android = { id = "com.android.application", version.ref = "android" } +android-library = { id = "com.android.library", version.ref = "android" } +kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } +google-services = { id = "com.google.gms.google-services", version.ref = "googleServices" } diff --git a/i18n/build.gradle.kts b/i18n/build.gradle.kts index 5f37e3ad4..01b304e7f 100644 --- a/i18n/build.gradle.kts +++ b/i18n/build.gradle.kts @@ -7,8 +7,8 @@ android { namespace = "dev.lucasnlm.antimine.i18n" defaultConfig { - minSdk = 21 - compileSdk = 34 + minSdk = libs.versions.minSdk.get().toInt() + compileSdk = libs.versions.compileSdk.get().toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") @@ -16,18 +16,18 @@ android { buildTypes { release { - isMinifyEnabled = true + isMinifyEnabled = false setProguardFiles(listOf(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")) } } compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = JavaVersion.VERSION_17.toString() + jvmTarget = JavaVersion.VERSION_11.toString() } buildFeatures { diff --git a/i18n/proguard-rules.pro b/i18n/proguard-rules.pro index ff59496d8..697e219de 100644 --- a/i18n/proguard-rules.pro +++ b/i18n/proguard-rules.pro @@ -1,21 +1,3 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle.kts. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +-dontwarn java.lang.invoke.StringConcatFactory +-dontwarn com.google.android.material.R$attr +-dontwarn dev.lucasnlm.antimine.i18n.R$string diff --git a/instant/build.gradle.kts b/instant/build.gradle.kts index 8c24611c2..8ef7d504d 100644 --- a/instant/build.gradle.kts +++ b/instant/build.gradle.kts @@ -7,24 +7,24 @@ android { namespace = "dev.lucasnlm.antimine.instant" defaultConfig { - minSdk = 21 - compileSdk = 34 + minSdk = libs.versions.minSdk.get().toInt() + compileSdk = libs.versions.compileSdk.get().toInt() } buildTypes { release { - isMinifyEnabled = true + isMinifyEnabled = false setProguardFiles(listOf(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")) } } compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = JavaVersion.VERSION_17.toString() + jvmTarget = JavaVersion.VERSION_11.toString() } buildFeatures { diff --git a/instant/proguard-rules.pro b/instant/proguard-rules.pro index ff59496d8..697e219de 100644 --- a/instant/proguard-rules.pro +++ b/instant/proguard-rules.pro @@ -1,21 +1,3 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle.kts. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +-dontwarn java.lang.invoke.StringConcatFactory +-dontwarn com.google.android.material.R$attr +-dontwarn dev.lucasnlm.antimine.i18n.R$string diff --git a/lint.xml b/lint.xml new file mode 100644 index 000000000..f5ccd7c3b --- /dev/null +++ b/lint.xml @@ -0,0 +1,3 @@ + + + diff --git a/preferences/build.gradle.kts b/preferences/build.gradle.kts index 9a7f1aa01..733bafc0e 100644 --- a/preferences/build.gradle.kts +++ b/preferences/build.gradle.kts @@ -7,8 +7,8 @@ android { namespace = "dev.lucasnlm.antimine.preferences" defaultConfig { - minSdk = 21 - compileSdk = 34 + minSdk = libs.versions.minSdk.get().toInt() + compileSdk = libs.versions.compileSdk.get().toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") @@ -16,18 +16,18 @@ android { buildTypes { release { - isMinifyEnabled = true + isMinifyEnabled = false setProguardFiles(listOf(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")) } } compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = JavaVersion.VERSION_17.toString() + jvmTarget = JavaVersion.VERSION_11.toString() } buildFeatures { @@ -37,15 +37,13 @@ android { } dependencies { - // Dependencies must be hardcoded to support F-droid - // AndroidX - implementation("androidx.appcompat:appcompat:1.6.1") - implementation("androidx.preference:preference-ktx:1.2.1") + implementation(libs.appcompat) + implementation(libs.preference.ktx) // Unit Tests - testImplementation("junit:junit:4.13.2") - testImplementation("org.mockito:mockito-core:4.6.1") - testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0") - testImplementation("io.mockk:mockk:1.13.5") + testImplementation(libs.junit) + testImplementation(libs.mockito.core) + testImplementation(libs.mockito.kotlin) + testImplementation(libs.mockk) } diff --git a/preferences/proguard-rules.pro b/preferences/proguard-rules.pro index ff59496d8..697e219de 100644 --- a/preferences/proguard-rules.pro +++ b/preferences/proguard-rules.pro @@ -1,21 +1,3 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle.kts. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +-dontwarn java.lang.invoke.StringConcatFactory +-dontwarn com.google.android.material.R$attr +-dontwarn dev.lucasnlm.antimine.i18n.R$string diff --git a/proprietary/build.gradle.kts b/proprietary/build.gradle.kts index ffcede454..0a7d2342e 100644 --- a/proprietary/build.gradle.kts +++ b/proprietary/build.gradle.kts @@ -7,8 +7,8 @@ android { namespace = "dev.lucasnlm.antimine.proprietary" defaultConfig { - minSdk = 21 - compileSdk = 34 + minSdk = libs.versions.minSdk.get().toInt() + compileSdk = libs.versions.compileSdk.get().toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") @@ -16,18 +16,18 @@ android { buildTypes { release { - isMinifyEnabled = true + isMinifyEnabled = false setProguardFiles(listOf(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")) } } compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = JavaVersion.VERSION_17.toString() + jvmTarget = JavaVersion.VERSION_11.toString() } buildFeatures { @@ -37,34 +37,32 @@ android { } dependencies { - // Dependencies must be hardcoded to support F-droid - implementation(project(":external")) // Amplitude - implementation("com.amplitude:android-sdk:2.32.1") - implementation("com.squareup.okhttp3:okhttp:4.10.0") + implementation(libs.amplitude.sdk) + implementation(libs.okhttp) // Bugsnag - implementation("com.bugsnag:bugsnag-android:5.31.2") + implementation(libs.bugsnag.android) // Google - implementation("com.android.billingclient:billing-ktx:6.0.1") - implementation("com.google.android.gms:play-services-instantapps:18.0.1") - implementation("com.google.android.gms:play-services-games:23.1.0") - implementation("com.google.android.gms:play-services-auth:20.7.0") - implementation("com.google.android.gms:play-services-ads:22.4.0") - implementation("com.google.android.play:core-ktx:1.8.1") + implementation(libs.google.billing.ktx) + implementation(libs.play.services.instantapps) + implementation(libs.play.services.games) + implementation(libs.play.services.auth) + implementation(libs.play.services.ads) + implementation(libs.play.core.ktx) // Jetbrains - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.7.3") + implementation(libs.kotlinx.coroutines.play.services) // Kotlin - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3") - implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.10") - testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3") + implementation(libs.kotlinx.coroutines.android) + implementation(libs.kotlin.stdlib) + testImplementation(libs.kotlinx.coroutines.test) // Koin - implementation("io.insert-koin:koin-android:3.1.2") - testImplementation("io.insert-koin:koin-test:3.1.2") + implementation(libs.koin.android) + testImplementation(libs.koin.test) } diff --git a/proprietary/proguard-rules.pro b/proprietary/proguard-rules.pro index 86fa63dd2..9d525a1ce 100644 --- a/proprietary/proguard-rules.pro +++ b/proprietary/proguard-rules.pro @@ -1,24 +1,7 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle.kts. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html +-dontwarn java.lang.invoke.StringConcatFactory +-dontwarn com.google.android.material.R$attr +-dontwarn dev.lucasnlm.antimine.i18n.R$string -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile # The native PGS library wraps the Java PGS SDK using reflection. -dontobfuscate diff --git a/settings.gradle.kts b/settings.gradle.kts index f57a2f0db..130f27322 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -29,4 +29,3 @@ include( ":audio-low", ":utils", ) - diff --git a/sgtatham/build.gradle.kts b/sgtatham/build.gradle.kts index b502fb94b..e67738f21 100644 --- a/sgtatham/build.gradle.kts +++ b/sgtatham/build.gradle.kts @@ -14,8 +14,8 @@ android { } defaultConfig { - minSdk = 21 - compileSdk = 34 + minSdk = libs.versions.minSdk.get().toInt() + compileSdk = libs.versions.compileSdk.get().toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") @@ -29,18 +29,18 @@ android { buildTypes { release { - isMinifyEnabled = true + isMinifyEnabled = false setProguardFiles(listOf(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")) } } compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = JavaVersion.VERSION_17.toString() + jvmTarget = JavaVersion.VERSION_11.toString() } buildFeatures { @@ -56,7 +56,7 @@ android { } dependencies { - implementation("androidx.appcompat:appcompat:1.6.1") - androidTestImplementation("androidx.test.ext:junit:1.1.5") - androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") + implementation(libs.appcompat) + androidTestImplementation(libs.ext.junit) + androidTestImplementation(libs.espresso.core) } diff --git a/sgtatham/proguard-rules.pro b/sgtatham/proguard-rules.pro index ff59496d8..697e219de 100644 --- a/sgtatham/proguard-rules.pro +++ b/sgtatham/proguard-rules.pro @@ -1,21 +1,3 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle.kts. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +-dontwarn java.lang.invoke.StringConcatFactory +-dontwarn com.google.android.material.R$attr +-dontwarn dev.lucasnlm.antimine.i18n.R$string diff --git a/themes/build.gradle.kts b/themes/build.gradle.kts index c763c8abd..58132c381 100644 --- a/themes/build.gradle.kts +++ b/themes/build.gradle.kts @@ -7,8 +7,8 @@ android { namespace = "dev.lucasnlm.antimine.themes" defaultConfig { - minSdk = 21 - compileSdk = 34 + minSdk = libs.versions.minSdk.get().toInt() + compileSdk = libs.versions.compileSdk.get().toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") @@ -16,18 +16,18 @@ android { buildTypes { release { - isMinifyEnabled = true + isMinifyEnabled = false setProguardFiles(listOf(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")) } } compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = JavaVersion.VERSION_17.toString() + jvmTarget = JavaVersion.VERSION_11.toString() } buildFeatures { @@ -37,8 +37,6 @@ android { } dependencies { - // Dependencies must be hardcoded to support F-droid - implementation(project(":core")) implementation(project(":external")) implementation(project(":i18n")) @@ -47,37 +45,37 @@ dependencies { implementation(project(":utils")) // AndroidX - implementation("androidx.appcompat:appcompat:1.6.1") - implementation("androidx.activity:activity-ktx:1.8.0") - implementation("androidx.fragment:fragment-ktx:1.6.2") + implementation(libs.appcompat) + implementation(libs.activity.ktx) + implementation(libs.fragment.ktx) // Google - implementation("com.google.android.material:material:1.10.0") + implementation(libs.material) // RecyclerView - implementation("androidx.recyclerview:recyclerview:1.3.2") + implementation(libs.recyclerview) // Constraint - implementation("androidx.constraintlayout:constraintlayout:2.1.4") + implementation(libs.constraintlayout) // Lifecycle - implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2") + implementation(libs.lifecycle.viewmodel.ktx) // Koin - implementation("io.insert-koin:koin-android:3.1.2") - testImplementation("io.insert-koin:koin-test:3.1.2") + implementation(libs.koin.android) + testImplementation(libs.koin.test) // Coroutines - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3") - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3") - testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3") + implementation(libs.kotlinx.coroutines.core) + implementation(libs.kotlinx.coroutines.android) + testImplementation(libs.kotlinx.coroutines.test) // Kotlin Lib - implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.10") + implementation(libs.kotlin.stdlib) // Unit Tests - testImplementation("junit:junit:4.13.2") - testImplementation("org.mockito:mockito-core:4.6.1") - testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0") - testImplementation("io.mockk:mockk:1.13.5") + testImplementation(libs.junit) + testImplementation(libs.mockito.core) + testImplementation(libs.mockito.kotlin) + testImplementation(libs.mockk) } diff --git a/themes/proguard-rules.pro b/themes/proguard-rules.pro index ff59496d8..291aca5ad 100644 --- a/themes/proguard-rules.pro +++ b/themes/proguard-rules.pro @@ -1,21 +1,4 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle.kts. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html +-dontwarn java.lang.invoke.StringConcatFactory +-dontwarn com.google.android.material.R$attr +-dontwarn dev.lucasnlm.antimine.i18n.R$string -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/tutorial/build.gradle.kts b/tutorial/build.gradle.kts index 33905b7ee..2a97064c0 100644 --- a/tutorial/build.gradle.kts +++ b/tutorial/build.gradle.kts @@ -7,8 +7,8 @@ android { namespace = "dev.lucasnlm.antimine.tutorial" defaultConfig { - minSdk = 21 - compileSdk = 34 + minSdk = libs.versions.minSdk.get().toInt() + compileSdk = libs.versions.compileSdk.get().toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") @@ -23,12 +23,12 @@ android { } compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = JavaVersion.VERSION_17.toString() + jvmTarget = JavaVersion.VERSION_11.toString() } buildFeatures { @@ -38,8 +38,6 @@ android { } dependencies { - // Dependencies must be hardcoded to support F-droid - implementation(project(":core")) implementation(project(":external")) implementation(project(":i18n")) @@ -48,37 +46,37 @@ dependencies { implementation(project(":utils")) // AndroidX - implementation("androidx.appcompat:appcompat:1.6.1") - implementation("androidx.activity:activity-ktx:1.8.0") - implementation("androidx.fragment:fragment-ktx:1.6.2") + implementation(libs.appcompat) + implementation(libs.activity.ktx) + implementation(libs.fragment.ktx) // Google - implementation("com.google.android.material:material:1.10.0") + implementation(libs.material) // RecyclerView - implementation("androidx.recyclerview:recyclerview:1.3.2") + implementation(libs.recyclerview) // Constraint - implementation("androidx.constraintlayout:constraintlayout:2.1.4") + implementation(libs.constraintlayout) // Lifecycle - implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2") + implementation(libs.lifecycle.viewmodel.ktx) // Koin - implementation("io.insert-koin:koin-android:3.1.2") - testImplementation("io.insert-koin:koin-test:3.1.2") + implementation(libs.koin.android) + testImplementation(libs.koin.test) // Coroutines - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3") - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3") - testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3") + implementation(libs.kotlinx.coroutines.core) + implementation(libs.kotlinx.coroutines.android) + testImplementation(libs.kotlinx.coroutines.test) // Kotlin Lib - implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.10") + implementation(libs.kotlin.stdlib) // Unit Tests - testImplementation("junit:junit:4.13.2") - testImplementation("org.mockito:mockito-core:4.6.1") - testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0") - testImplementation("io.mockk:mockk:1.13.5") + testImplementation(libs.junit) + testImplementation(libs.mockito.core) + testImplementation(libs.mockito.kotlin) + testImplementation(libs.mockk) } diff --git a/tutorial/proguard-rules.pro b/tutorial/proguard-rules.pro index ff59496d8..697e219de 100644 --- a/tutorial/proguard-rules.pro +++ b/tutorial/proguard-rules.pro @@ -1,21 +1,3 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle.kts. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +-dontwarn java.lang.invoke.StringConcatFactory +-dontwarn com.google.android.material.R$attr +-dontwarn dev.lucasnlm.antimine.i18n.R$string diff --git a/ui/build.gradle.kts b/ui/build.gradle.kts index df9c2a002..73985c432 100644 --- a/ui/build.gradle.kts +++ b/ui/build.gradle.kts @@ -7,8 +7,8 @@ android { namespace = "dev.lucasnlm.antimine.ui" defaultConfig { - minSdk = 21 - compileSdk = 34 + minSdk = libs.versions.minSdk.get().toInt() + compileSdk = libs.versions.compileSdk.get().toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") @@ -23,12 +23,12 @@ android { } compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = JavaVersion.VERSION_17.toString() + jvmTarget = JavaVersion.VERSION_11.toString() } buildFeatures { @@ -38,45 +38,43 @@ android { } dependencies { - // Dependencies must be hardcoded to support F-droid - implementation(project(":core")) implementation(project(":i18n")) implementation(project(":preferences")) implementation(project(":utils")) // Google - implementation("com.google.android.material:material:1.10.0") + implementation(libs.material) // AndroidX - implementation("androidx.appcompat:appcompat:1.6.1") - implementation("androidx.activity:activity-ktx:1.8.0") - implementation("androidx.fragment:fragment-ktx:1.6.2") + implementation(libs.appcompat) + implementation(libs.activity.ktx) + implementation(libs.fragment.ktx) // RecyclerView - implementation("androidx.recyclerview:recyclerview:1.3.2") + implementation(libs.recyclerview) // Constraint - implementation("androidx.constraintlayout:constraintlayout:2.1.4") + implementation(libs.constraintlayout) // Lifecycle - implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2") + implementation(libs.lifecycle.viewmodel.ktx) // Koin - implementation("io.insert-koin:koin-android:3.1.2") - testImplementation("io.insert-koin:koin-test:3.1.2") + implementation(libs.koin.android) + testImplementation(libs.koin.test) // Coroutines - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3") - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3") - testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3") + implementation(libs.kotlinx.coroutines.core) + implementation(libs.kotlinx.coroutines.android) + testImplementation(libs.kotlinx.coroutines.test) // Kotlin Lib - implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.10") + implementation(libs.kotlin.stdlib) // Unit Tests - testImplementation("junit:junit:4.13.2") - testImplementation("org.mockito:mockito-core:4.6.1") - testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0") - testImplementation("io.mockk:mockk:1.13.5") + testImplementation(libs.junit) + testImplementation(libs.mockito.core) + testImplementation(libs.mockito.kotlin) + testImplementation(libs.mockk) } diff --git a/ui/proguard-rules.pro b/ui/proguard-rules.pro index ff59496d8..697e219de 100644 --- a/ui/proguard-rules.pro +++ b/ui/proguard-rules.pro @@ -1,21 +1,3 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle.kts. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +-dontwarn java.lang.invoke.StringConcatFactory +-dontwarn com.google.android.material.R$attr +-dontwarn dev.lucasnlm.antimine.i18n.R$string diff --git a/utils/build.gradle.kts b/utils/build.gradle.kts index 1d99bc992..e31c20d28 100644 --- a/utils/build.gradle.kts +++ b/utils/build.gradle.kts @@ -7,8 +7,8 @@ android { namespace = "dev.lucasnlm.antimine.utils" defaultConfig { - minSdk = 21 - compileSdk = 34 + minSdk = libs.versions.minSdk.get().toInt() + compileSdk = libs.versions.compileSdk.get().toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") @@ -25,12 +25,12 @@ android { } compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = JavaVersion.VERSION_17.toString() + jvmTarget = JavaVersion.VERSION_11.toString() } buildFeatures { @@ -41,10 +41,10 @@ android { dependencies { // Kotlin - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3") - implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.10") - testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3") + implementation(libs.kotlinx.coroutines.android) + implementation(libs.kotlin.stdlib) + testImplementation(libs.kotlinx.coroutines.test) // AndroidX - implementation("androidx.appcompat:appcompat:1.6.1") + implementation(libs.appcompat) } diff --git a/wear/build.gradle.kts b/wear/build.gradle.kts index 3395fe576..1a17d4ada 100644 --- a/wear/build.gradle.kts +++ b/wear/build.gradle.kts @@ -1,7 +1,7 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat -val isGoogleBuild: Boolean by rootProject.extra -val isReleaseBuild: Boolean by rootProject.extra +val isGoogleBuild: Boolean = System.getenv("IS_GOOGLE_BUILD")?.isNotBlank() == true +val isReleaseBuild: Boolean = System.getenv("IS_RELEASE_BUILD")?.isNotBlank() == true plugins { id("com.android.application") @@ -12,15 +12,14 @@ android { namespace = "dev.lucasnlm.antimine.wear" defaultConfig { - // versionCode and versionName must be hardcoded to support F-droid applicationId = "dev.lucasnlm.antimine" - versionCode = 1705110 - versionName = "17.5.11 W" + versionCode = 1706000 + versionName = "17.6.0 W" //noinspection OldTargetApi - targetSdk = 33 // PlayStore has different settings for Wear apps - minSdk = 25 - compileSdk = 34 + targetSdk = libs.versions.wearTargetSdk.get().toInt() + minSdk = libs.versions.wearMinSdk.get().toInt() + compileSdk = libs.versions.compileSdk.get().toInt() multiDexEnabled = true vectorDrawables.useSupportLibrary = true @@ -60,12 +59,12 @@ android { } kotlinOptions { - jvmTarget = JavaVersion.VERSION_17.toString() + jvmTarget = JavaVersion.VERSION_11.toString() } compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } testOptions { @@ -82,8 +81,6 @@ android { } dependencies { - // Dependencies must be hardcoded to support F-droid - implementation(project(":external")) implementation(project(":common")) implementation(project(":control")) @@ -95,60 +92,60 @@ dependencies { implementation(project(":utils")) // Wear OS - implementation("androidx.wear:wear:1.3.0") + implementation(libs.wear) // AndroidX - implementation("androidx.appcompat:appcompat:1.6.1") - implementation("androidx.preference:preference-ktx:1.2.1") - implementation("androidx.recyclerview:recyclerview:1.3.2") - implementation("androidx.multidex:multidex:2.0.1") - implementation("androidx.activity:activity-ktx:1.8.0") - implementation("androidx.fragment:fragment-ktx:1.6.2") - implementation("androidx.core:core-splashscreen:1.1.0-alpha02") + implementation(libs.appcompat) + implementation(libs.preference.ktx) + implementation(libs.recyclerview) + implementation(libs.multidex) + implementation(libs.activity.ktx) + implementation(libs.fragment.ktx) + implementation(libs.core.splashscreen) // Lifecycle - implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2") - implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2") - implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.6.2") - implementation("androidx.lifecycle:lifecycle-common-java8:2.6.2") + implementation(libs.lifecycle.viewmodel.ktx) + implementation(libs.lifecycle.runtime.ktx) + implementation(libs.lifecycle.livedata.ktx) + implementation(libs.lifecycle.common.java8) // Constraint - implementation("androidx.constraintlayout:constraintlayout:2.1.4") + implementation(libs.constraintlayout) // Google - implementation("com.google.android.material:material:1.10.0") + implementation(libs.material) // Koin - implementation("io.insert-koin:koin-android:3.1.2") - testImplementation("io.insert-koin:koin-test:3.1.2") + implementation(libs.koin.android) + testImplementation(libs.koin.test) // Kotlin - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3") - implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.10") - testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3") + implementation(libs.kotlinx.coroutines.android) + implementation(libs.kotlin.stdlib) + testImplementation(libs.kotlinx.coroutines.test) // Tests - testImplementation("junit:junit:4.13.2") - testImplementation("androidx.core:core-ktx:1.12.0") - testImplementation("androidx.test:core-ktx:1.5.0") - testImplementation("androidx.test:rules:1.5.0") - testImplementation("androidx.test:runner:1.5.2") - testImplementation("androidx.test.espresso:espresso-core:3.5.1") - testImplementation("androidx.fragment:fragment-testing:1.6.2") - testImplementation("org.robolectric:robolectric:4.5.1") - testImplementation("androidx.test.ext:junit:1.1.5") - testImplementation("io.mockk:mockk:1.13.5") + testImplementation(libs.junit) + testImplementation(libs.core.ktx) + testImplementation(libs.test.core.ktx) + testImplementation(libs.rules) + testImplementation(libs.runner) + testImplementation(libs.espresso.core) + testImplementation(libs.fragment.testing) + testImplementation(libs.robolectric) + testImplementation(libs.ext.junit) + testImplementation(libs.mockk) // Core library - androidTestImplementation("androidx.test:core:1.5.0") + androidTestImplementation(libs.test.core) // AndroidJUnitRunner and JUnit Rules - androidTestImplementation("androidx.test:core:1.5.0") - androidTestImplementation("androidx.test:core-ktx:1.5.0") - androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") - androidTestImplementation("androidx.test:runner:1.5.2") - androidTestImplementation("androidx.test:rules:1.5.0") - androidTestUtil("androidx.test:orchestrator:1.4.2") + androidTestImplementation(libs.test.core) + androidTestImplementation(libs.test.core.ktx) + androidTestImplementation(libs.espresso.core) + androidTestImplementation(libs.runner) + androidTestImplementation(libs.rules) + androidTestUtil(libs.orchestrator) } tasks.withType().configureEach { diff --git a/wear/proguard-rules.pro b/wear/proguard-rules.pro index 8561fbbdd..485711dbb 100644 --- a/wear/proguard-rules.pro +++ b/wear/proguard-rules.pro @@ -81,3 +81,7 @@ -dontwarn javax.annotation.processing.AbstractProcessor -dontwarn javax.annotation.processing.SupportedOptions +-dontwarn java.lang.invoke.StringConcatFactory +-dontwarn com.google.android.material.R$attr +-dontwarn dev.lucasnlm.antimine.i18n.R$string + diff --git a/wear/src/main/java/dev/lucasnlm/antimine/wear/game/WearGameActivity.kt b/wear/src/main/java/dev/lucasnlm/antimine/wear/game/WearGameActivity.kt index 82a0197e3..38becce12 100644 --- a/wear/src/main/java/dev/lucasnlm/antimine/wear/game/WearGameActivity.kt +++ b/wear/src/main/java/dev/lucasnlm/antimine/wear/game/WearGameActivity.kt @@ -21,7 +21,7 @@ import dev.lucasnlm.antimine.preferences.PreferencesRepositoryImpl import dev.lucasnlm.antimine.preferences.models.Action import dev.lucasnlm.antimine.preferences.models.ControlStyle import dev.lucasnlm.antimine.ui.ext.ThemedActivity -import dev.lucasnlm.antimine.utils.serializableNonSafe +import dev.lucasnlm.antimine.utils.BundleExt.serializableNonSafe import dev.lucasnlm.antimine.wear.databinding.ActivityGameBinding import dev.lucasnlm.antimine.wear.message.GameOverActivity import dev.lucasnlm.antimine.wear.message.VictoryActivity diff --git a/wear/src/main/java/dev/lucasnlm/antimine/wear/main/view/ThemeListAdapter.kt b/wear/src/main/java/dev/lucasnlm/antimine/wear/main/view/ThemeListAdapter.kt index 4276036fc..92a5080ba 100644 --- a/wear/src/main/java/dev/lucasnlm/antimine/wear/main/view/ThemeListAdapter.kt +++ b/wear/src/main/java/dev/lucasnlm/antimine/wear/main/view/ThemeListAdapter.kt @@ -6,8 +6,8 @@ import androidx.core.view.isVisible import androidx.recyclerview.widget.RecyclerView import com.google.android.material.color.MaterialColors import dev.lucasnlm.antimine.preferences.PreferencesRepository -import dev.lucasnlm.antimine.ui.ext.toAndroidColor -import dev.lucasnlm.antimine.ui.ext.toInvertedAndroidColor +import dev.lucasnlm.antimine.ui.ext.ColorExt.toAndroidColor +import dev.lucasnlm.antimine.ui.ext.ColorExt.toInvertedAndroidColor import dev.lucasnlm.antimine.ui.model.AppTheme import dev.lucasnlm.antimine.wear.R import dev.lucasnlm.antimine.wear.databinding.ViewThemeBinding