diff --git a/Prezel/app/.gitignore b/Prezel/app/.gitignore index 42afabfd..796b96d1 100644 --- a/Prezel/app/.gitignore +++ b/Prezel/app/.gitignore @@ -1 +1 @@ -/build \ No newline at end of file +/build diff --git a/Prezel/app/build.gradle.kts b/Prezel/app/build.gradle.kts index a0b2ea1d..8b216b84 100644 --- a/Prezel/app/build.gradle.kts +++ b/Prezel/app/build.gradle.kts @@ -1,64 +1,14 @@ plugins { - alias(libs.plugins.android.application) - alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.compose) - alias(libs.plugins.ktlint) + alias(libs.plugins.prezel.android.application) + alias(libs.plugins.prezel.android.application.compose) } android { namespace = "com.team.prezel" - compileSdk { - version = release(36) - } - - defaultConfig { - applicationId = "com.team.prezel" - minSdk = 28 - targetSdk = 36 - versionCode = 1 - versionName = "1.0" - - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - } - - buildTypes { - release { - isMinifyEnabled = false - proguardFiles( - getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro", - ) - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_21 - targetCompatibility = JavaVersion.VERSION_21 - } - buildFeatures { - compose = true - } -} - -kotlin { - compilerOptions { - jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_21) - } } dependencies { + implementation(libs.androidx.activity.ktx) implementation(libs.androidx.core.ktx) implementation(libs.androidx.lifecycle.runtime.ktx) - implementation(libs.androidx.activity.compose) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.androidx.compose.ui) - implementation(libs.androidx.compose.ui.graphics) - implementation(libs.androidx.compose.ui.tooling.preview) - implementation(libs.androidx.compose.material3) - testImplementation(libs.junit) - androidTestImplementation(libs.androidx.junit) - androidTestImplementation(libs.androidx.espresso.core) - androidTestImplementation(platform(libs.androidx.compose.bom)) - androidTestImplementation(libs.androidx.compose.ui.test.junit4) - debugImplementation(libs.androidx.compose.ui.tooling) - debugImplementation(libs.androidx.compose.ui.test.manifest) } diff --git a/Prezel/app/proguard-rules.pro b/Prezel/app/proguard-rules.pro index 481bb434..f1b42451 100644 --- a/Prezel/app/proguard-rules.pro +++ b/Prezel/app/proguard-rules.pro @@ -18,4 +18,4 @@ # If you keep the line number information, uncomment this to # hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +#-renamesourcefileattribute SourceFile diff --git a/Prezel/app/src/main/AndroidManifest.xml b/Prezel/app/src/main/AndroidManifest.xml index 8703db2f..7162ca24 100644 --- a/Prezel/app/src/main/AndroidManifest.xml +++ b/Prezel/app/src/main/AndroidManifest.xml @@ -1,6 +1,5 @@ - + Prezel - \ No newline at end of file + diff --git a/Prezel/build-logic/convention/.gitignore b/Prezel/build-logic/convention/.gitignore new file mode 100644 index 00000000..796b96d1 --- /dev/null +++ b/Prezel/build-logic/convention/.gitignore @@ -0,0 +1 @@ +/build diff --git a/Prezel/build-logic/convention/build.gradle.kts b/Prezel/build-logic/convention/build.gradle.kts new file mode 100644 index 00000000..45d25a3e --- /dev/null +++ b/Prezel/build-logic/convention/build.gradle.kts @@ -0,0 +1,80 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget + +plugins { + `kotlin-dsl` +} + +group = "com.team.prezel.buildlogic.convention" + +java { + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 +} + +kotlin { + compilerOptions { + jvmTarget = JvmTarget.JVM_21 + } +} + +dependencies { + compileOnly(libs.android.gradleApiPlugin) + compileOnly(libs.compose.gradlePlugin) + compileOnly(libs.kotlin.gradlePlugin) + compileOnly(libs.ksp.gradlePlugin) +} + +gradlePlugin { + plugins { + register("androidApplicationCompose") { + id = libs.plugins.prezel.android.application.compose + .get() + .pluginId + implementationClass = "com.team.prezel.buildlogic.convention.plugin.AndroidApplicationComposeConventionPlugin" + } + register("androidApplication") { + id = libs.plugins.prezel.android.application + .asProvider() + .get() + .pluginId + implementationClass = "com.team.prezel.buildlogic.convention.plugin.AndroidApplicationConventionPlugin" + } + register("androidLibraryCompose") { + id = libs.plugins.prezel.android.library.compose + .get() + .pluginId + implementationClass = "com.team.prezel.buildlogic.convention.plugin.AndroidLibraryComposeConventionPlugin" + } + register("androidLibrary") { + id = libs.plugins.prezel.android.library + .asProvider() + .get() + .pluginId + implementationClass = "com.team.prezel.buildlogic.convention.plugin.AndroidLibraryConventionPlugin" + } + register("androidFeatureImpl") { + id = libs.plugins.prezel.android.feature.impl + .get() + .pluginId + implementationClass = "com.team.prezel.buildlogic.convention.plugin.AndroidFeatureImplConventionPlugin" + } + register("androidFeatureApi") { + id = libs.plugins.prezel.android.feature.api + .get() + .pluginId + implementationClass = "com.team.prezel.buildlogic.convention.plugin.AndroidFeatureApiConventionPlugin" + } + register("hilt") { + id = libs.plugins.prezel.hilt + .get() + .pluginId + implementationClass = "com.team.prezel.buildlogic.convention.plugin.HiltConventionPlugin" + } + register("jvmLibrary") { + id = libs.plugins.prezel.jvm.library + .get() + .pluginId + implementationClass = "com.team.prezel.buildlogic.convention.plugin.JvmLibraryConventionPlugin" + } + } +} diff --git a/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/AndroidCompose.kt b/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/AndroidCompose.kt new file mode 100644 index 00000000..0a57e87e --- /dev/null +++ b/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/AndroidCompose.kt @@ -0,0 +1,25 @@ +package com.team.prezel.buildlogic.convention + +import com.android.build.api.dsl.CommonExtension +import org.gradle.api.Project +import org.gradle.kotlin.dsl.dependencies + +/** + * Configure Compose-specific options + */ +internal fun Project.configureAndroidCompose(commonExtension: CommonExtension<*, *, *, *, *, *>) { + commonExtension.apply { + buildFeatures { + compose = true + } + + dependencies { + val bom = libs.findLibrary("androidx-compose-bom").get() + "implementation"(platform(bom)) + "implementation"(libs.findBundle("android-compose").get()) + "androidTestImplementation"(platform(bom)) + "implementation"(libs.findLibrary("androidx-compose-ui-tooling-preview").get()) + "debugImplementation"(libs.findLibrary("androidx-compose-ui-tooling").get()) + } + } +} diff --git a/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/KotlinAndroid.kt b/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/KotlinAndroid.kt new file mode 100644 index 00000000..661b4caa --- /dev/null +++ b/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/KotlinAndroid.kt @@ -0,0 +1,67 @@ +package com.team.prezel.buildlogic.convention + +import com.android.build.api.dsl.CommonExtension +import org.gradle.api.JavaVersion +import org.gradle.api.Project +import org.gradle.api.plugins.JavaPluginExtension +import org.gradle.kotlin.dsl.configure +import org.gradle.kotlin.dsl.dependencies +import org.jetbrains.kotlin.gradle.dsl.JvmTarget +import org.jetbrains.kotlin.gradle.dsl.KotlinAndroidProjectExtension +import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension +import org.jetbrains.kotlin.gradle.dsl.KotlinVersion + +/** + * Configure base Kotlin with Android options + */ +internal fun Project.configureKotlinAndroid(commonExtension: CommonExtension<*, *, *, *, *, *>) { + commonExtension.apply { + compileSdk = 36 + + defaultConfig { + minSdk = 29 + } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 + isCoreLibraryDesugaringEnabled = true + } + } + + extensions.configure { + compilerOptions.apply { + languageVersion.set(KotlinVersion.KOTLIN_2_3) + coreLibrariesVersion = libs.findVersion("kotlin").get().toString() + jvmTarget.set(JvmTarget.JVM_21) + allWarningsAsErrors.set(false) + freeCompilerArgs.add("-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi") + freeCompilerArgs.add("-Xconsistent-data-class-copy-visibility") + } + } + + dependencies { + "coreLibraryDesugaring"(libs.findLibrary("desugarJdk-libs").get()) + } +} + +/** + * Configure base Kotlin options for JVM (non-Android) + */ +internal fun Project.configureKotlinJvm() { + extensions.configure { + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 + } + + extensions.configure { + compilerOptions.apply { + languageVersion.set(KotlinVersion.KOTLIN_2_3) + coreLibrariesVersion = libs.findVersion("kotlin").get().toString() + jvmTarget.set(JvmTarget.JVM_21) + allWarningsAsErrors.set(false) + freeCompilerArgs.add("-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi") + freeCompilerArgs.add("-Xconsistent-data-class-copy-visibility") + } + } +} diff --git a/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/ProjectExtensions.kt b/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/ProjectExtensions.kt new file mode 100644 index 00000000..e2343036 --- /dev/null +++ b/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/ProjectExtensions.kt @@ -0,0 +1,9 @@ +package com.team.prezel.buildlogic.convention + +import org.gradle.api.Project +import org.gradle.api.artifacts.VersionCatalog +import org.gradle.api.artifacts.VersionCatalogsExtension +import org.gradle.kotlin.dsl.getByType + +val Project.libs + get(): VersionCatalog = extensions.getByType().named("libs") diff --git a/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/plugin/AndroidApplicationComposeConventionPlugin.kt b/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/plugin/AndroidApplicationComposeConventionPlugin.kt new file mode 100644 index 00000000..4c79a9b2 --- /dev/null +++ b/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/plugin/AndroidApplicationComposeConventionPlugin.kt @@ -0,0 +1,20 @@ +package com.team.prezel.buildlogic.convention.plugin + +import com.android.build.api.dsl.ApplicationExtension +import com.team.prezel.buildlogic.convention.configureAndroidCompose +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.apply +import org.gradle.kotlin.dsl.getByType + +class AndroidApplicationComposeConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + apply(plugin = "org.jetbrains.kotlin.plugin.compose") + apply(plugin = "prezel.android.application") + + val extension = extensions.getByType() + configureAndroidCompose(extension) + } + } +} diff --git a/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/plugin/AndroidApplicationConventionPlugin.kt b/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/plugin/AndroidApplicationConventionPlugin.kt new file mode 100644 index 00000000..2e796f0f --- /dev/null +++ b/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/plugin/AndroidApplicationConventionPlugin.kt @@ -0,0 +1,23 @@ +package com.team.prezel.buildlogic.convention.plugin + +import com.android.build.api.dsl.ApplicationExtension +import com.team.prezel.buildlogic.convention.configureKotlinAndroid +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.apply +import org.gradle.kotlin.dsl.configure + +class AndroidApplicationConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + apply(plugin = "com.android.application") + apply(plugin = "org.jetbrains.kotlin.android") + + extensions.configure { + configureKotlinAndroid(this) + defaultConfig.targetSdk = 36 + testOptions.animationsDisabled = true + } + } + } +} diff --git a/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/plugin/AndroidFeatureApiConventionPlugin.kt b/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/plugin/AndroidFeatureApiConventionPlugin.kt new file mode 100644 index 00000000..8aefea0a --- /dev/null +++ b/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/plugin/AndroidFeatureApiConventionPlugin.kt @@ -0,0 +1,19 @@ +package com.team.prezel.buildlogic.convention.plugin + +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.apply +import org.gradle.kotlin.dsl.dependencies + +class AndroidFeatureApiConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + apply(plugin = "prezel.android.library") + apply(plugin = "org.jetbrains.kotlin.plugin.serialization") + + dependencies { +// "api"(project(":core:navigation")) + } + } + } +} diff --git a/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/plugin/AndroidFeatureImplConventionPlugin.kt b/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/plugin/AndroidFeatureImplConventionPlugin.kt new file mode 100644 index 00000000..1ee1a460 --- /dev/null +++ b/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/plugin/AndroidFeatureImplConventionPlugin.kt @@ -0,0 +1,34 @@ +package com.team.prezel.buildlogic.convention.plugin + +import com.android.build.api.dsl.LibraryExtension +import com.team.prezel.buildlogic.convention.libs +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.apply +import org.gradle.kotlin.dsl.configure +import org.gradle.kotlin.dsl.dependencies + +class AndroidFeatureImplConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + apply(plugin = "prezel.android.library") + apply(plugin = "prezel.hilt") + + extensions.configure { + testOptions.animationsDisabled = true + } + + dependencies { +// "implementation"(project(":core:ui")) +// "implementation"(project(":core:designsystem")) + + "implementation"(libs.findLibrary("androidx.lifecycle.runtimeCompose").get()) + "implementation"(libs.findLibrary("androidx.lifecycle.viewModelCompose").get()) + + "androidTestImplementation"( + libs.findLibrary("androidx.lifecycle.runtimeTesting").get(), + ) + } + } + } +} diff --git a/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/plugin/AndroidLibraryComposeConventionPlugin.kt b/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/plugin/AndroidLibraryComposeConventionPlugin.kt new file mode 100644 index 00000000..6d10f810 --- /dev/null +++ b/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/plugin/AndroidLibraryComposeConventionPlugin.kt @@ -0,0 +1,20 @@ +package com.team.prezel.buildlogic.convention.plugin + +import com.android.build.api.dsl.LibraryExtension +import com.team.prezel.buildlogic.convention.configureAndroidCompose +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.apply +import org.gradle.kotlin.dsl.getByType + +class AndroidLibraryComposeConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + apply(plugin = "org.jetbrains.kotlin.plugin.compose") + apply(plugin = "prezel.android.library") + + val extension = extensions.getByType() + configureAndroidCompose(extension) + } + } +} diff --git a/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/plugin/AndroidLibraryConventionPlugin.kt b/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/plugin/AndroidLibraryConventionPlugin.kt new file mode 100644 index 00000000..963e6b69 --- /dev/null +++ b/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/plugin/AndroidLibraryConventionPlugin.kt @@ -0,0 +1,39 @@ +package com.team.prezel.buildlogic.convention.plugin + +import com.android.build.api.dsl.LibraryExtension +import com.team.prezel.buildlogic.convention.configureKotlinAndroid +import com.team.prezel.buildlogic.convention.libs +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.apply +import org.gradle.kotlin.dsl.configure +import org.gradle.kotlin.dsl.dependencies + +class AndroidLibraryConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + apply(plugin = "com.android.library") + apply(plugin = "org.jetbrains.kotlin.android") + + extensions.configure { + configureKotlinAndroid(this) + testOptions.targetSdk = 36 + lint.targetSdk = 36 + defaultConfig.testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + testOptions.animationsDisabled = true + resourcePrefix = + path + .split("""\W""".toRegex()) + .drop(1) + .distinct() + .joinToString(separator = "_") + .lowercase() + "_" + } + + dependencies { + "androidTestImplementation"(libs.findLibrary("kotlin.test").get()) + "testImplementation"(libs.findLibrary("kotlin.test").get()) + } + } + } +} diff --git a/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/plugin/HiltConventionPlugin.kt b/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/plugin/HiltConventionPlugin.kt new file mode 100644 index 00000000..890d6092 --- /dev/null +++ b/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/plugin/HiltConventionPlugin.kt @@ -0,0 +1,38 @@ +package com.team.prezel.buildlogic.convention.plugin + +import com.team.prezel.buildlogic.convention.libs +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.apply +import org.gradle.kotlin.dsl.dependencies + +class HiltConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + apply( + plugin = libs + .findPlugin("ksp") + .get() + .get() + .pluginId, + ) + + dependencies { + "ksp"(libs.findLibrary("hilt.compiler").get()) + } + + pluginManager.withPlugin("org.jetbrains.kotlin.jvm") { + dependencies { + "implementation"(libs.findLibrary("hilt.core").get()) + } + } + + pluginManager.withPlugin("com.android.base") { + apply(plugin = "dagger.hilt.android.plugin") + dependencies { + "implementation"(libs.findLibrary("hilt.android").get()) + } + } + } + } +} diff --git a/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/plugin/JvmLibraryConventionPlugin.kt b/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/plugin/JvmLibraryConventionPlugin.kt new file mode 100644 index 00000000..c31144c6 --- /dev/null +++ b/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/plugin/JvmLibraryConventionPlugin.kt @@ -0,0 +1,21 @@ +package com.team.prezel.buildlogic.convention.plugin + +import com.team.prezel.buildlogic.convention.configureKotlinJvm +import com.team.prezel.buildlogic.convention.libs +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.apply +import org.gradle.kotlin.dsl.dependencies + +class JvmLibraryConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + apply(plugin = "org.jetbrains.kotlin.jvm") + + configureKotlinJvm() + dependencies { + "testImplementation"(libs.findLibrary("kotlin.test").get()) + } + } + } +} diff --git a/Prezel/build-logic/gradle.properties b/Prezel/build-logic/gradle.properties new file mode 100644 index 00000000..933280d2 --- /dev/null +++ b/Prezel/build-logic/gradle.properties @@ -0,0 +1,4 @@ +org.gradle.parallel=true +org.gradle.caching=true +org.gradle.configuration-cache=true +org.gradle.configuration-cache.parallel=true diff --git a/Prezel/build-logic/settings.gradle.kts b/Prezel/build-logic/settings.gradle.kts new file mode 100644 index 00000000..0f461ae8 --- /dev/null +++ b/Prezel/build-logic/settings.gradle.kts @@ -0,0 +1,27 @@ +pluginManagement { + repositories { + gradlePluginPortal() + google() + } +} + +dependencyResolutionManagement { + repositories { + google { + content { + includeGroupByRegex("com\\.android.*") + includeGroupByRegex("com\\.google.*") + includeGroupByRegex("androidx.*") + } + } + mavenCentral() + } + versionCatalogs { + create("libs") { + from(files("../gradle/libs.versions.toml")) + } + } +} + +rootProject.name = "build-logic" +include(":convention") diff --git a/Prezel/build.gradle.kts b/Prezel/build.gradle.kts index f496cb87..71edc763 100644 --- a/Prezel/build.gradle.kts +++ b/Prezel/build.gradle.kts @@ -4,6 +4,8 @@ plugins { alias(libs.plugins.kotlin.compose) apply false alias(libs.plugins.ktlint) apply true alias(libs.plugins.detekt) apply true + alias(libs.plugins.hilt) apply false + alias(libs.plugins.ksp) apply false } subprojects { diff --git a/Prezel/gradle.properties b/Prezel/gradle.properties index 132244e5..4e5908e0 100644 --- a/Prezel/gradle.properties +++ b/Prezel/gradle.properties @@ -10,7 +10,7 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. For more details, visit # https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects -# org.gradle.parallel=true +org.gradle.parallel=true # AndroidX package structure to make it clearer which packages are bundled with the # Android operating system, and which are packaged with your app's APK # https://developer.android.com/topic/libraries/support-library/androidx-rn @@ -21,3 +21,6 @@ kotlin.code.style=official # resources declared in the library itself and none from the library's dependencies, # thereby reducing the size of the R class for that library android.nonTransitiveRClass=true +org.gradle.caching=true +org.gradle.configuration-cache=true +org.gradle.configuration-cache.parallel=true diff --git a/Prezel/gradle/libs.versions.toml b/Prezel/gradle/libs.versions.toml index 9ea415ec..3fceabbc 100644 --- a/Prezel/gradle/libs.versions.toml +++ b/Prezel/gradle/libs.versions.toml @@ -5,27 +5,47 @@ coreKtx = "1.17.0" junit = "4.13.2" junitVersion = "1.3.0" espressoCore = "3.7.0" -lifecycleRuntimeKtx = "2.10.0" activityCompose = "1.12.2" -composeBom = "2025.12.01" +androidxLifecycle = "2.10.0" +composeBom = "2026.01.00" ktlint = "14.0.1" detekt = "1.23.8" +ksp = "2.3.4" +activityKtx = "1.12.2" +hilt = "2.57.2" +desugarJdk = "2.0.3" [libraries] androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } junit = { group = "junit", name = "junit", version.ref = "junit" } androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" } androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" } -androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtx" } +androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "androidxLifecycle" } androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" } +androidx-lifecycle-runtimeCompose = { group = "androidx.lifecycle", name = "lifecycle-runtime-compose", version.ref = "androidxLifecycle" } +androidx-lifecycle-runtimeTesting = { group = "androidx.lifecycle", name = "lifecycle-runtime-testing", version.ref = "androidxLifecycle" } +androidx-lifecycle-viewModelCompose = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose", version.ref = "androidxLifecycle" } androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" } androidx-compose-ui = { group = "androidx.compose.ui", name = "ui" } androidx-compose-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" } androidx-compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" } androidx-compose-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" } androidx-compose-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" } -androidx-compose-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" } androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3" } +androidx-activity-ktx = { group = "androidx.activity", name = "activity-ktx", version.ref = "activityKtx" } +hilt-android = { group = "com.google.dagger", name = "hilt-android", version.ref = "hilt" } +hilt-android-testing = { group = "com.google.dagger", name = "hilt-android-testing", version.ref = "hilt" } +hilt-compiler = { group = "com.google.dagger", name = "hilt-compiler", version.ref = "hilt" } +hilt-core = { group = "com.google.dagger", name = "hilt-core", version.ref = "hilt" } +kotlin-test = { group = "org.jetbrains.kotlin", name = "kotlin-test", version.ref = "kotlin" } + +# Dependencies of the included build-logic +android-gradleApiPlugin = { group = "com.android.tools.build", name = "gradle-api", version.ref = "agp" } +compose-gradlePlugin = { module = "org.jetbrains.kotlin:compose-compiler-gradle-plugin", version.ref = "kotlin" } +kotlin-gradlePlugin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin" } +ksp-gradlePlugin = { group = "com.google.devtools.ksp", name = "com.google.devtools.ksp.gradle.plugin", version.ref = "ksp" } +androidx-compose-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" } +desugarJdk-libs = { module = "com.android.tools:desugar_jdk_libs", version.ref = "desugarJdk" } [plugins] android-application = { id = "com.android.application", version.ref = "agp" } @@ -33,3 +53,26 @@ kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" } detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" } +hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" } +kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } +ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } + +# Plugins defined by this project +prezel-android-application = { id = "prezel.android.application" } +prezel-android-application-compose = { id = "prezel.android.application.compose" } +prezel-android-library = { id = "prezel.android.library" } +prezel-android-library-compose = { id = "prezel.android.library.compose" } +prezel-android-feature-impl = { id = "prezel.android.feature.impl" } +prezel-android-feature-api = { id = "prezel.android.feature.api" } +prezel-hilt = { id = "prezel.hilt" } +prezel-jvm-library = { id = "prezel.jvm.library" } + +[bundles] +android-compose = [ + "androidx-compose-material3", + "androidx-activity-compose", + "androidx-compose-ui", + "androidx-compose-ui-tooling-preview", + "androidx-lifecycle-runtimeCompose", + "androidx-lifecycle-viewModelCompose" +] diff --git a/Prezel/settings.gradle.kts b/Prezel/settings.gradle.kts index 8dc16fae..a8f98851 100644 --- a/Prezel/settings.gradle.kts +++ b/Prezel/settings.gradle.kts @@ -1,4 +1,5 @@ pluginManagement { + includeBuild("build-logic") repositories { google { content { @@ -11,13 +12,22 @@ pluginManagement { gradlePluginPortal() } } + dependencyResolutionManagement { - repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositoriesMode = RepositoriesMode.FAIL_ON_PROJECT_REPOS repositories { - google() + google { + content { + includeGroupByRegex("com\\.android.*") + includeGroupByRegex("com\\.google.*") + includeGroupByRegex("androidx.*") + } + } mavenCentral() } } rootProject.name = "Prezel" + +enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") include(":app")