modernize gradle scripts

This commit is contained in:
MM20
2025-08-16 16:34:03 +02:00
parent aca734e228
commit d4549069b8
51 changed files with 316 additions and 121 deletions

View File

@@ -1,6 +1,7 @@
import android.annotation.SuppressLint
import java.time.LocalDate
import java.time.format.DateTimeFormatter
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
alias(libs.plugins.android.application)
@@ -89,8 +90,10 @@ android {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
}
}
lint {

View File

@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
@@ -37,27 +39,25 @@ android {
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs = listOf(
"-opt-in=androidx.compose.ui.ExperimentalComposeUiApi",
"-opt-in=androidx.compose.foundation.ExperimentalFoundationApi",
"-opt-in=androidx.compose.ui.text.ExperimentalTextApi",
"-opt-in=androidx.compose.ui.unit.ExperimentalUnitApi",
"-opt-in=androidx.compose.foundation.layout.ExperimentalLayoutApi",
"-opt-in=androidx.compose.material.ExperimentalMaterialApi",
"-opt-in=androidx.compose.material3.ExperimentalMaterial3Api",
"-opt-in=androidx.compose.material3.ExperimentalMaterial3ExpressiveApi",
"-opt-in=androidx.compose.animation.graphics.ExperimentalAnimationGraphicsApi",
"-opt-in=androidx.compose.animation.ExperimentalAnimationApi",
"-opt-in=com.google.accompanist.pager.ExperimentalPagerApi",
"-opt-in=androidx.compose.animation.ExperimentalSharedTransitionApi",
"-Xwhen-guards",
)
kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
optIn.add("androidx.compose.ui.ExperimentalComposeUiApi")
optIn.add("androidx.compose.foundation.ExperimentalFoundationApi")
optIn.add("androidx.compose.ui.text.ExperimentalTextApi")
optIn.add("androidx.compose.ui.unit.ExperimentalUnitApi")
optIn.add("androidx.compose.foundation.layout.ExperimentalLayoutApi")
optIn.add("androidx.compose.material.ExperimentalMaterialApi")
optIn.add("androidx.compose.material3.ExperimentalMaterial3Api")
optIn.add("androidx.compose.material3.ExperimentalMaterial3ExpressiveApi")
optIn.add("androidx.compose.animation.graphics.ExperimentalAnimationGraphicsApi")
optIn.add("androidx.compose.animation.ExperimentalAnimationApi")
optIn.add("com.google.accompanist.pager.ExperimentalPagerApi")
optIn.add("androidx.compose.animation.ExperimentalSharedTransitionApi")
}
}
buildFeatures {
// Enables Jetpack Compose for this module
compose = true
viewBinding = true
}
@@ -68,6 +68,7 @@ android {
namespace = "de.mm20.launcher2.ui"
}
dependencies {
implementation(libs.bundles.kotlin)