-
-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
80 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 49 additions & 3 deletions
52
...ons-codegen/src/main/java/com/ramcosta/composedestinations/codegen/model/CodeGenConfig.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,56 @@ | ||
package com.ramcosta.composedestinations.codegen.model | ||
|
||
import com.ramcosta.composedestinations.codegen.DEFAULT_GEN_PACKAGE_NAME | ||
import com.ramcosta.composedestinations.codegen.commons.sanitizePackageName | ||
import java.util.Locale | ||
import java.util.UUID | ||
|
||
data class CodeGenConfig( | ||
val packageName: String?, | ||
val moduleName: String?, | ||
val packageName: String, | ||
val moduleName: String, | ||
val registryId: String, | ||
val generateNavGraphs: Boolean, | ||
val htmlMermaidGraph: String?, | ||
val mermaidGraph: String?, | ||
val debugModeOutputDir: String?, | ||
) | ||
val isBottomSheetDependencyPresent: Boolean | ||
) { | ||
|
||
init { | ||
com.ramcosta.composedestinations.codegen.codeGenBasePackageName = packageName | ||
com.ramcosta.composedestinations.codegen.moduleName = moduleName | ||
com.ramcosta.composedestinations.codegen.registryId = registryId | ||
} | ||
|
||
companion object { | ||
operator fun invoke( | ||
packageName: String?, | ||
moduleName: String?, | ||
generateNavGraphs: Boolean, | ||
htmlMermaidGraph: String?, | ||
mermaidGraph: String?, | ||
debugModeOutputDir: String?, | ||
isBottomSheetDependencyPresent: Boolean | ||
): CodeGenConfig { | ||
val finalModuleName = moduleName?.replaceFirstChar { it.uppercase(Locale.US) } ?: "" | ||
val defaultPackageName = if (finalModuleName.isEmpty()) { | ||
DEFAULT_GEN_PACKAGE_NAME | ||
} else { | ||
"$DEFAULT_GEN_PACKAGE_NAME.${finalModuleName.lowercase()}".sanitizePackageName() | ||
} | ||
val codeGenBasePackageName = packageName?.sanitizePackageName() ?: defaultPackageName | ||
val registryId = finalModuleName.ifEmpty { UUID.randomUUID().toString().replace("-", "_") } | ||
|
||
return CodeGenConfig( | ||
packageName = codeGenBasePackageName, | ||
moduleName = finalModuleName, | ||
registryId = registryId, | ||
generateNavGraphs = generateNavGraphs, | ||
htmlMermaidGraph = htmlMermaidGraph, | ||
mermaidGraph = mermaidGraph, | ||
debugModeOutputDir = debugModeOutputDir, | ||
isBottomSheetDependencyPresent = isBottomSheetDependencyPresent | ||
) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 0 additions & 22 deletions
22
...featurex/src/androidTest/java/com/ramcosta/playground/featurex/ExampleInstrumentedTest.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.