mirror of
https://github.com/apple/pkl.git
synced 2026-01-11 22:30:54 +01:00
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:
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user