mirror of
https://github.com/apple/pkl.git
synced 2026-07-09 22:52:44 +02: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 ->
|
builder.build().use { evaluator ->
|
||||||
for (moduleUri in options.base.normalizedSourceModules) {
|
for (moduleUri in options.base.normalizedSourceModules) {
|
||||||
val schema = evaluator.evaluateSchema(ModuleSource.uri(moduleUri))
|
val schema = evaluator.evaluateSchema(ModuleSource.uri(moduleUri))
|
||||||
val codeGenerator = KotlinCodeGenerator(schema, options.toKotlinCodegenOptions())
|
val codeGenerator = KotlinCodeGenerator(schema, options.toKotlinCodeGeneratorOptions())
|
||||||
try {
|
try {
|
||||||
for ((fileName, fileContents) in codeGenerator.output) {
|
for ((fileName, fileContents) in codeGenerator.output) {
|
||||||
val outputFile = options.outputDir.resolve(fileName)
|
val outputFile = options.outputDir.resolve(fileName)
|
||||||
|
|||||||
+5
-1
@@ -47,7 +47,11 @@ data class CliKotlinCodeGeneratorOptions(
|
|||||||
*/
|
*/
|
||||||
val renames: Map<String, String> = emptyMap()
|
val renames: Map<String, String> = emptyMap()
|
||||||
) {
|
) {
|
||||||
fun toKotlinCodegenOptions(): KotlinCodeGeneratorOptions =
|
@Suppress("DeprecatedCallableAddReplaceWith")
|
||||||
|
@Deprecated("deprecated without replacement")
|
||||||
|
fun toKotlinCodegenOptions(): KotlinCodeGeneratorOptions = toKotlinCodeGeneratorOptions()
|
||||||
|
|
||||||
|
internal fun toKotlinCodeGeneratorOptions(): KotlinCodeGeneratorOptions =
|
||||||
KotlinCodeGeneratorOptions(
|
KotlinCodeGeneratorOptions(
|
||||||
indent,
|
indent,
|
||||||
generateKdoc,
|
generateKdoc,
|
||||||
|
|||||||
Reference in New Issue
Block a user