mirror of
https://github.com/d4rken-org/capod.git
synced 2026-09-15 10:46:12 -04:00
Refactor buildSrc and update dependencies
This commit refactors the `buildSrc` module by: - Removing the `setupLibraryDefaults()` extension function from `ProjectConfig.kt` as its functionality is largely covered by standard Gradle plugin configurations. - Inlining version numbers for Moshi and various testing libraries directly into `Dependencies.kt`, removing them from `Versions.kt`. This simplifies version management for these specific libraries. - Removing unused version declarations from `Versions.kt`. Additionally, this commit updates the following dependencies: - Kotlin from 2.1.21 to 2.2.10 - Android Gradle Plugin from 8.11.0 to 8.12.2 - KSP from 2.1.21-2.0.1 to 2.2.10-2.0.2 - Dagger from 2.56.2 to 2.57.1 - AndroidX Navigation from 2.8.9 to 2.9.3 The `targetSdk` was also removed from the `app-common` module's `defaultConfig` as it's typically inherited or set at the app level.
This commit is contained in:
@@ -1,7 +1,3 @@
|
||||
import com.android.build.api.dsl.Packaging
|
||||
import com.android.build.gradle.LibraryExtension
|
||||
import org.gradle.api.Action
|
||||
import org.gradle.api.JavaVersion
|
||||
import java.io.File
|
||||
import java.io.FileInputStream
|
||||
import java.time.Instant
|
||||
@@ -41,51 +37,6 @@ fun lastCommitHash(): String = Runtime.getRuntime().exec("git rev-parse --short
|
||||
|
||||
fun buildTime(): Instant = Instant.now()
|
||||
|
||||
/**
|
||||
* Configures the [kotlinOptions][org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions] extension.
|
||||
*/
|
||||
private fun LibraryExtension.kotlinOptions(configure: Action<org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions>): Unit =
|
||||
(this as org.gradle.api.plugins.ExtensionAware).extensions.configure("kotlinOptions", configure)
|
||||
|
||||
fun LibraryExtension.setupLibraryDefaults() {
|
||||
compileSdk = ProjectConfig.compileSdk
|
||||
|
||||
defaultConfig {
|
||||
minSdk = ProjectConfig.minSdk
|
||||
targetSdk = ProjectConfig.targetSdk
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles("consumer-rules.pro")
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
isCoreLibraryDesugaringEnabled = true
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = "17"
|
||||
freeCompilerArgs = freeCompilerArgs + listOf(
|
||||
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
|
||||
"-opt-in=kotlinx.coroutines.FlowPreview",
|
||||
"-opt-in=kotlin.time.ExperimentalTime",
|
||||
"-opt-in=kotlin.RequiresOptIn"
|
||||
)
|
||||
}
|
||||
|
||||
fun Packaging.() {
|
||||
resources.excludes += "DebugProbesKt.bin"
|
||||
}
|
||||
}
|
||||
|
||||
fun com.android.build.api.dsl.SigningConfig.setupCredentials(
|
||||
signingPropsPath: File? = null
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user