Skip to content

Commit

Permalink
add nav safe args plugin for xml template
Browse files Browse the repository at this point in the history
  • Loading branch information
cnrture committed Dec 17, 2024
1 parent 53ac5f0 commit 573652c
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ fun getDependencies(
if (isKtLintEnable) addLibsPlugin(Plugin.KtLint)
if (isDetektEnable) addLibsPlugin(Plugin.Detekt)
if (isFirebaseEnable) addLibsPlugin(Plugin.GoogleServices)
if (!isCompose && isNavigationEnable) addLibsPlugin(Plugin.NavigationSafeArgs)
}

private fun StringBuilder.addDefaultVersions() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ fun getGradleKts(
if (isKtLintEnable) addGradlePlugin(Plugin.KtLint)
if (isDetektEnable) addGradlePlugin(Plugin.Detekt)
if (isFirebaseEnable) addGradlePlugin(Plugin.GoogleServices)
if (!isCompose && isNavigationEnable) addGradlePlugin(Plugin.NavigationSafeArgs)
append("}\n\n")

addAndroidBlock(packagePath, minApi, javaJvmVersion, isCompose)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ sealed class Plugin(val name: String, val id: String, val verRef: String) {
data object KtLint : Plugin("ktlint", "org.jlleitschuh.gradle.ktlint", "ktlint")
data object Detekt : Plugin("detekt-plugin", "io.gitlab.arturbosch.detekt", "detekt")
data object GoogleServices : Plugin("google-services", "com.google.gms.google-services", "googleServices")
data object NavigationSafeArgs : Plugin("navigation-safe-args", "androidx.navigation.safeargs.kotlin", "navigation")
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ fun getProjectGradleKts(
isKtLintEnable: Boolean,
isDetektEnable: Boolean,
isFirebaseEnable: Boolean,
isNavigationEnable: Boolean,
selectedImageLibrary: ImageLibrary,
) = StringBuilder().apply {
append("// Top-level build file where you can add configuration options common to all sub-projects/modules.\n")
Expand All @@ -22,5 +23,6 @@ fun getProjectGradleKts(
if (isKtLintEnable) addGradlePlugin(Plugin.KtLint, true)
if (isDetektEnable) addGradlePlugin(Plugin.Detekt, true)
if (isFirebaseEnable) addGradlePlugin(Plugin.GoogleServices, true)
append("}\n\n")
if (!isCompose && isNavigationEnable) addGradlePlugin(Plugin.NavigationSafeArgs, true)
append("}")
}
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ private fun addDependenciesAndGradle(
isKtLintEnable,
isDetektEnable,
isFirebaseEnable,
isNavigationEnable,
selectedImageLibrary,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ private fun addDependenciesAndGradle(
isKtLintEnable,
isDetektEnable,
isFirebaseEnable,
isNavigationEnable,
selectedImageLibrary,
)

Expand Down

0 comments on commit 573652c

Please sign in to comment.