codegen-kotlin: Deprecate method toKotlinCodegenOptions without replacement (#810)

Motivation:
`CliKotlinCodeGeneratorOptions.toKotlinCodegenOptions` is an internal method that isn't useful to clients.
This commit is contained in:
translatenix
2024-11-14 12:21:07 -08:00
committed by GitHub
parent 51df2f3aa4
commit 0c6808566f
2 changed files with 6 additions and 2 deletions

View File

@@ -34,7 +34,7 @@ class CliKotlinCodeGenerator(private val options: CliKotlinCodeGeneratorOptions)
builder.build().use { evaluator ->
for (moduleUri in options.base.normalizedSourceModules) {
val schema = evaluator.evaluateSchema(ModuleSource.uri(moduleUri))
val codeGenerator = KotlinCodeGenerator(schema, options.toKotlinCodegenOptions())
val codeGenerator = KotlinCodeGenerator(schema, options.toKotlinCodeGeneratorOptions())
try {
for ((fileName, fileContents) in codeGenerator.output) {
val outputFile = options.outputDir.resolve(fileName)

View File

@@ -47,7 +47,11 @@ data class CliKotlinCodeGeneratorOptions(
*/
val renames: Map<String, String> = emptyMap()
) {
fun toKotlinCodegenOptions(): KotlinCodeGeneratorOptions =
@Suppress("DeprecatedCallableAddReplaceWith")
@Deprecated("deprecated without replacement")
fun toKotlinCodegenOptions(): KotlinCodeGeneratorOptions = toKotlinCodeGeneratorOptions()
internal fun toKotlinCodeGeneratorOptions(): KotlinCodeGeneratorOptions =
KotlinCodeGeneratorOptions(
indent,
generateKdoc,