Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 8 additions & 26 deletions core/src/main/kotlin/com/mitteloupe/cag/core/Generator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,13 @@ class Generator(
val featureNameLowerCase = request.featureName.lowercase()
val dependencyConfiguration =
DependencyConfiguration(
versions =
buildList {
addAll(VersionCatalogConstants.KOTLIN_VERSIONS + VersionCatalogConstants.ANDROID_VERSIONS)
if (request.enableCompose) {
addAll(VersionCatalogConstants.COMPOSE_VERSIONS)
}
if (request.enableKtlint) {
addAll(VersionCatalogConstants.KTLINT_VERSIONS)
}
if (request.enableDetekt) {
addAll(VersionCatalogConstants.DETEKT_VERSIONS)
}
versions = VersionCatalogConstants.ANDROID_VERSIONS,
libraries =
if (request.enableCompose) {
LibraryConstants.COMPOSE_LIBRARIES
} else {
emptyList()
},
libraries = if (request.enableCompose) LibraryConstants.COMPOSE_LIBRARIES else emptyList(),
plugins =
buildList {
addAll(PluginConstants.KOTLIN_PLUGINS + PluginConstants.ANDROID_PLUGINS)
Expand Down Expand Up @@ -270,7 +263,7 @@ class Generator(

val dependencyConfiguration =
DependencyConfiguration(
versions = VersionCatalogConstants.KOTLIN_VERSIONS + VersionCatalogConstants.ANDROID_VERSIONS,
versions = VersionCatalogConstants.ANDROID_VERSIONS,
libraries = emptyList(),
plugins = PluginConstants.KOTLIN_PLUGINS + PluginConstants.ANDROID_PLUGINS
)
Expand Down Expand Up @@ -421,17 +414,6 @@ class Generator(
throw GenerationException("Failed to create project directory.")
}

val versions =
buildList {
addAll(
VersionCatalogConstants.KOTLIN_VERSIONS +
VersionCatalogConstants.ANDROID_VERSIONS +
VersionCatalogConstants.TESTING_VERSIONS
)
if (request.enableCompose) {
addAll(VersionCatalogConstants.COMPOSE_VERSIONS)
}
}
val libraries =
LibraryConstants.CORE_ANDROID_LIBRARIES + LibraryConstants.TESTING_LIBRARIES +
if (request.enableCompose) {
Expand All @@ -454,7 +436,7 @@ class Generator(
}
val dependencyConfiguration =
DependencyConfiguration(
versions = versions,
versions = VersionCatalogConstants.ANDROID_VERSIONS,
libraries = libraries,
plugins = plugins
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,6 @@ class ArchitectureModulesContentGenerator(
throw GenerationException("Failed to create directories for architecture package '$architecturePackageName'.")
}

val versions =
buildList {
addAll(VersionCatalogConstants.KOTLIN_VERSIONS + VersionCatalogConstants.ANDROID_VERSIONS)
if (enableCompose) {
addAll(VersionCatalogConstants.COMPOSE_VERSIONS)
}
if (enableKtlint) {
addAll(VersionCatalogConstants.KTLINT_VERSIONS)
}
if (enableDetekt) {
addAll(VersionCatalogConstants.DETEKT_VERSIONS)
}
}
val libraries =
LibraryConstants.CORE_ANDROID_LIBRARIES +
if (enableCompose) {
Expand Down Expand Up @@ -94,7 +81,7 @@ class ArchitectureModulesContentGenerator(
}
val dependencyConfiguration =
DependencyConfiguration(
versions = versions,
versions = VersionCatalogConstants.ANDROID_VERSIONS,
libraries = libraries,
plugins = plugins
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ class CoroutineModuleContentGenerator(

val dependencyConfiguration =
DependencyConfiguration(
versions = VersionCatalogConstants.KOTLIN_VERSIONS + VersionCatalogConstants.ANDROID_VERSIONS,
libraries = LibraryConstants.CORE_ANDROID_LIBRARIES,
versions = VersionCatalogConstants.ANDROID_VERSIONS,
libraries = listOf(LibraryConstants.KOTLINX_COROUTINES_CORE),
plugins = PluginConstants.KOTLIN_PLUGINS + PluginConstants.ANDROID_PLUGINS
)
catalogUpdater.updateVersionCatalogIfPresent(
Expand Down
Loading