From 8c4c8902bb5b23a755ed2d12f1c72cc5b4bb17bc Mon Sep 17 00:00:00 2001 From: Jan Galinski Date: Sun, 22 Sep 2024 22:32:40 +0200 Subject: [PATCH 1/3] Update for next development version --- _build/parent/pom.xml | 2 +- _build/report-generator/pom.xml | 2 +- _itest/builder-itest/pom.xml | 2 +- _itest/pom.xml | 2 +- _itest/spi-itest/pom.xml | 2 +- kotlin-code-generation-bom/pom.xml | 2 +- kotlin-code-generation-test/pom.xml | 2 +- kotlin-code-generation/pom.xml | 2 +- pom.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/_build/parent/pom.xml b/_build/parent/pom.xml index d7e8785..190d75e 100644 --- a/_build/parent/pom.xml +++ b/_build/parent/pom.xml @@ -5,7 +5,7 @@ io.toolisticon.kotlin.generation._ kotlin-code-generation-root - 0.0.9 + 0.0.10-SNAPSHOT ../../pom.xml diff --git a/_build/report-generator/pom.xml b/_build/report-generator/pom.xml index f0815e2..7492b8e 100644 --- a/_build/report-generator/pom.xml +++ b/_build/report-generator/pom.xml @@ -5,7 +5,7 @@ io.toolisticon.kotlin.generation._ kotlin-code-generation-parent - 0.0.9 + 0.0.10-SNAPSHOT ../parent/pom.xml diff --git a/_itest/builder-itest/pom.xml b/_itest/builder-itest/pom.xml index 8a1d6ed..2d12d44 100644 --- a/_itest/builder-itest/pom.xml +++ b/_itest/builder-itest/pom.xml @@ -5,7 +5,7 @@ io.toolisticon.kotlin.generation._ kotlin-code-generation-itest-root - 0.0.9 + 0.0.10-SNAPSHOT io.toolisticon.kotlin.generation.itest diff --git a/_itest/pom.xml b/_itest/pom.xml index 07ec240..041799f 100644 --- a/_itest/pom.xml +++ b/_itest/pom.xml @@ -5,7 +5,7 @@ io.toolisticon.kotlin.generation._ kotlin-code-generation-parent - 0.0.9 + 0.0.10-SNAPSHOT ../_build/parent/pom.xml diff --git a/_itest/spi-itest/pom.xml b/_itest/spi-itest/pom.xml index e9ecbb6..cd7e0df 100644 --- a/_itest/spi-itest/pom.xml +++ b/_itest/spi-itest/pom.xml @@ -5,7 +5,7 @@ io.toolisticon.kotlin.generation._ kotlin-code-generation-itest-root - 0.0.9 + 0.0.10-SNAPSHOT io.toolisticon.kotlin.generation.itest diff --git a/kotlin-code-generation-bom/pom.xml b/kotlin-code-generation-bom/pom.xml index a562fff..0ce6941 100644 --- a/kotlin-code-generation-bom/pom.xml +++ b/kotlin-code-generation-bom/pom.xml @@ -5,7 +5,7 @@ io.toolisticon.kotlin.generation._ kotlin-code-generation-root - 0.0.9 + 0.0.10-SNAPSHOT io.toolisticon.kotlin.generation diff --git a/kotlin-code-generation-test/pom.xml b/kotlin-code-generation-test/pom.xml index 7c3acaf..7a2ce55 100644 --- a/kotlin-code-generation-test/pom.xml +++ b/kotlin-code-generation-test/pom.xml @@ -5,7 +5,7 @@ io.toolisticon.kotlin.generation._ kotlin-code-generation-parent - 0.0.9 + 0.0.10-SNAPSHOT ../_build/parent/pom.xml diff --git a/kotlin-code-generation/pom.xml b/kotlin-code-generation/pom.xml index cc29456..f117ae5 100644 --- a/kotlin-code-generation/pom.xml +++ b/kotlin-code-generation/pom.xml @@ -5,7 +5,7 @@ io.toolisticon.kotlin.generation._ kotlin-code-generation-parent - 0.0.9 + 0.0.10-SNAPSHOT ../_build/parent/pom.xml diff --git a/pom.xml b/pom.xml index 4f2a463..5ef5d59 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ io.toolisticon.kotlin.generation._ kotlin-code-generation-root - 0.0.9 + 0.0.10-SNAPSHOT pom: ${project.artifactId} Root of kotlin-code-generation From 121b8150abdca03954b0414dec6cb6d9f188d9ca Mon Sep 17 00:00:00 2001 From: Jan Galinski Date: Fri, 27 Sep 2024 15:44:25 +0200 Subject: [PATCH 2/3] add execute fn, fixes #56 --- .../spi/processor/KotlinFileSpecProcessor.kt | 11 +++++-- .../KotlinFileSpecEmptyInputProcessorTest.kt | 33 +++++++++++++++++++ 2 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 kotlin-code-generation/src/test/kotlin/spi/processor/KotlinFileSpecEmptyInputProcessorTest.kt diff --git a/kotlin-code-generation/src/main/kotlin/spi/processor/KotlinFileSpecProcessor.kt b/kotlin-code-generation/src/main/kotlin/spi/processor/KotlinFileSpecProcessor.kt index 8c67930..142d8a6 100644 --- a/kotlin-code-generation/src/main/kotlin/spi/processor/KotlinFileSpecProcessor.kt +++ b/kotlin-code-generation/src/main/kotlin/spi/processor/KotlinFileSpecProcessor.kt @@ -29,16 +29,15 @@ abstract class KotlinFileSpecProcessor>( contextType: KClass, order: Int = KotlinCodeGenerationSpi.DEFAULT_ORDER -) : KotlinCodeGenerationProcessorBase( +) : KotlinFileSpecProcessor( contextType = contextType, inputType = EmptyInput::class, - builderType = KotlinFileSpecBuilder::class, order = order ) { /** @@ -54,4 +53,10 @@ abstract class KotlinFileSpecEmptyInputProcessor(TestContext::class) { + override fun invoke(context: TestContext, builder: KotlinFileSpecBuilder): KotlinFileSpecBuilder { + return builder.addFileComment(KotlinCodeGeneration.format.FORMAT_STRING, "Hello World") + } + } + + AddDocProcessor().execute(TestContext(className("foo", "bar"), MutableSpiRegistry()), file) + + assertThat(file.spec().code).isEqualToIgnoringWhitespace(""" + // "Hello World" + package foo + """.trimIndent()) + } +} From 61dfa612d52a0e1c5766cfc6b7788d82751d42d7 Mon Sep 17 00:00:00 2001 From: Jan Galinski Date: Fri, 27 Sep 2024 16:30:38 +0200 Subject: [PATCH 3/3] Update for next development version --- _build/parent/pom.xml | 2 +- _build/report-generator/pom.xml | 2 +- _itest/builder-itest/pom.xml | 2 +- _itest/pom.xml | 2 +- _itest/spi-itest/pom.xml | 2 +- kotlin-code-generation-bom/pom.xml | 2 +- kotlin-code-generation-test/pom.xml | 2 +- kotlin-code-generation/pom.xml | 2 +- pom.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/_build/parent/pom.xml b/_build/parent/pom.xml index 190d75e..53d80d5 100644 --- a/_build/parent/pom.xml +++ b/_build/parent/pom.xml @@ -5,7 +5,7 @@ io.toolisticon.kotlin.generation._ kotlin-code-generation-root - 0.0.10-SNAPSHOT + 0.0.10 ../../pom.xml diff --git a/_build/report-generator/pom.xml b/_build/report-generator/pom.xml index 7492b8e..bdcc83c 100644 --- a/_build/report-generator/pom.xml +++ b/_build/report-generator/pom.xml @@ -5,7 +5,7 @@ io.toolisticon.kotlin.generation._ kotlin-code-generation-parent - 0.0.10-SNAPSHOT + 0.0.10 ../parent/pom.xml diff --git a/_itest/builder-itest/pom.xml b/_itest/builder-itest/pom.xml index 2d12d44..af55738 100644 --- a/_itest/builder-itest/pom.xml +++ b/_itest/builder-itest/pom.xml @@ -5,7 +5,7 @@ io.toolisticon.kotlin.generation._ kotlin-code-generation-itest-root - 0.0.10-SNAPSHOT + 0.0.10 io.toolisticon.kotlin.generation.itest diff --git a/_itest/pom.xml b/_itest/pom.xml index 041799f..1944d3f 100644 --- a/_itest/pom.xml +++ b/_itest/pom.xml @@ -5,7 +5,7 @@ io.toolisticon.kotlin.generation._ kotlin-code-generation-parent - 0.0.10-SNAPSHOT + 0.0.10 ../_build/parent/pom.xml diff --git a/_itest/spi-itest/pom.xml b/_itest/spi-itest/pom.xml index cd7e0df..d5b7557 100644 --- a/_itest/spi-itest/pom.xml +++ b/_itest/spi-itest/pom.xml @@ -5,7 +5,7 @@ io.toolisticon.kotlin.generation._ kotlin-code-generation-itest-root - 0.0.10-SNAPSHOT + 0.0.10 io.toolisticon.kotlin.generation.itest diff --git a/kotlin-code-generation-bom/pom.xml b/kotlin-code-generation-bom/pom.xml index 0ce6941..3cc69e9 100644 --- a/kotlin-code-generation-bom/pom.xml +++ b/kotlin-code-generation-bom/pom.xml @@ -5,7 +5,7 @@ io.toolisticon.kotlin.generation._ kotlin-code-generation-root - 0.0.10-SNAPSHOT + 0.0.10 io.toolisticon.kotlin.generation diff --git a/kotlin-code-generation-test/pom.xml b/kotlin-code-generation-test/pom.xml index 7a2ce55..5f7fc67 100644 --- a/kotlin-code-generation-test/pom.xml +++ b/kotlin-code-generation-test/pom.xml @@ -5,7 +5,7 @@ io.toolisticon.kotlin.generation._ kotlin-code-generation-parent - 0.0.10-SNAPSHOT + 0.0.10 ../_build/parent/pom.xml diff --git a/kotlin-code-generation/pom.xml b/kotlin-code-generation/pom.xml index f117ae5..685e835 100644 --- a/kotlin-code-generation/pom.xml +++ b/kotlin-code-generation/pom.xml @@ -5,7 +5,7 @@ io.toolisticon.kotlin.generation._ kotlin-code-generation-parent - 0.0.10-SNAPSHOT + 0.0.10 ../_build/parent/pom.xml diff --git a/pom.xml b/pom.xml index 5ef5d59..cb1403e 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ io.toolisticon.kotlin.generation._ kotlin-code-generation-root - 0.0.10-SNAPSHOT + 0.0.10 pom: ${project.artifactId} Root of kotlin-code-generation