Repository navigation
Expand file tree
/
Copy pathpom.xml
More file actions
268 lines (261 loc) · 11.6 KB
/
Copy pathpom.xml
File metadata and controls
268 lines (261 loc) · 11.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.metaobjects</groupId>
<artifactId>metaobjects</artifactId>
<version>8.1.0</version>
</parent>
<artifactId>metaobjects-codegen-kotlin</artifactId>
<name>MetaObjects :: Codegen :: Kotlin</name>
<description>Kotlin codegen target — emits @Serializable data classes, Exposed Tables, FR-004 payload classes, and a startup-validator stub via KotlinPoet.</description>
<properties>
<kotlin.version>2.0.21</kotlin.version>
<maven.compiler.release>21</maven.compiler.release>
</properties>
<dependencies>
<!-- production -->
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>com.metaobjects</groupId>
<artifactId>metaobjects-codegen-base</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.metaobjects</groupId>
<artifactId>metaobjects-metadata-ktx</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.squareup</groupId>
<artifactId>kotlinpoet-jvm</artifactId>
<version>1.18.1</version>
</dependency>
<!-- Shared JVM render engine. KotlinRenderHelperGenerator uses Verify/FilesystemProvider/
PayloadField at BUILD time (the mustache↔VO drift gate) and emits Kotlin that calls
Renderer/RenderRequest/EmailDocument at runtime — so render must be a COMPILE-scope
dependency of the generator (mirrors codegen-spring's render dependency). The FR-010
output-prompt conformance runner also drives these classes directly. Brings
jackson-databind transitively for spec.json parsing. -->
<dependency>
<groupId>com.metaobjects</groupId>
<artifactId>metaobjects-render</artifactId>
<version>${project.version}</version>
</dependency>
<!-- spec.json parsing for the output-prompt-conformance runner (jackson is test-scoped in
render, so it is not transitive — declare it directly). -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test-junit5</artifactId>
<version>${kotlin.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.10.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.metaobjects</groupId>
<artifactId>metaobjects-metadata</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<!-- Shared JVM runtime extract (MetaObjectExtractor, in the om module): the Kotlin
verdict proof drives it directly, proving extract assembles a typed object graph
when called from Kotlin. Kotlin adds no extract code — this is a verdict proof. -->
<dependency>
<groupId>com.metaobjects</groupId>
<artifactId>metaobjects-om</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.tschuchortdev</groupId>
<artifactId>kotlin-compile-testing</artifactId>
<version>1.6.0</version>
<scope>test</scope>
</dependency>
<!-- validation-conformance runner (SP-C Unit 5): compile the generated entity data class
and validate each corpus payload through a jakarta Validator. Hibernate Validator brings
jakarta.validation-api transitively; expressly is the jakarta EL impl the constraint-message
interpolator needs at runtime; jackson-module-kotlin binds each corpus payload JSON onto
the generated Kotlin data class (Kotlin constructor binding). -->
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>8.0.1.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.glassfish.expressly</groupId>
<artifactId>expressly</artifactId>
<version>5.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-kotlin</artifactId>
<version>2.18.1</version>
<scope>test</scope>
</dependency>
<!-- The generated typed-jsonb Exposed columns emit a shared `metaJsonbMapper` (MetaJsonbMapper.kt)
that wires jackson-datatype-jsr310 for java.time round-tripping. Test-scoped so any compile
harness that emits a typed jsonb table can resolve it. -->
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>2.18.2</version>
<scope>test</scope>
</dependency>
<!-- Required at test scope so kotlin-compile-testing can resolve @Serializable on generated code -->
<dependency>
<groupId>org.jetbrains.kotlinx</groupId>
<artifactId>kotlinx-serialization-core-jvm</artifactId>
<version>1.7.3</version>
<scope>test</scope>
</dependency>
<!-- Required at test scope so the FR-010 compile harness can resolve kotlinx.serialization.json.Json
(the JSON codec artifact; separate from the core annotations jar) -->
<dependency>
<groupId>org.jetbrains.kotlinx</groupId>
<artifactId>kotlinx-serialization-json-jvm</artifactId>
<version>1.7.3</version>
<scope>test</scope>
</dependency>
<!-- KotlinM2mTraversalCompileRunTest compiles the GENERATED Exposed Table + M:N relation
helpers against exposed-core, resolving the jar from the local m2 repo. Declaring it
test-scoped here forces Maven to resolve it into ~/.m2 during this module's build, so
the test no longer depends on a prior build (e.g. the reactor-excluded
integration-tests-kotlin) having populated the local repository first. -->
<dependency>
<groupId>org.jetbrains.exposed</groupId>
<artifactId>exposed-core</artifactId>
<version>0.55.0</version>
<scope>test</scope>
</dependency>
<!-- Same contract for exposed-java-time: KotlinAutoSetStampingTest compiles a generated
@autoSet repository whose timestamp columns use the java.time column types, so its
compile classpath needs this jar in ~/.m2 too. Without the declaration the jar only
landed there as a side effect of a prior integration-tests-kotlin build — green on a
warm developer/self-hosted repo, red on a cold hosted runner. -->
<dependency>
<groupId>org.jetbrains.exposed</groupId>
<artifactId>exposed-java-time</artifactId>
<version>0.55.0</version>
<scope>test</scope>
</dependency>
<!-- Same contract again for exposed-json: CodegenCompileConformanceTest compiles the
generated Exposed tables for the shared fitness corpus, which carries field.object
@storage:jsonb columns — those emit `jsonb(name, encode, decode)`, which lives here
and nowhere else. Without it the whole corpus failed to compile on `Unresolved
reference: jsonb`, which reads exactly like a codegen defect and is not one. -->
<dependency>
<groupId>org.jetbrains.exposed</groupId>
<artifactId>exposed-json</artifactId>
<version>0.55.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<sourceDirectory>src/main/kotlin</sourceDirectory>
<testSourceDirectory>src/test/kotlin</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
<executions>
<execution>
<id>compile</id>
<phase>compile</phase>
<goals><goal>compile</goal></goals>
</execution>
<execution>
<id>test-compile</id>
<phase>test-compile</phase>
<goals><goal>test-compile</goal></goals>
</execution>
</executions>
<configuration>
<jvmTarget>21</jvmTarget>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire.plugin.version}</version>
</plugin>
<!-- `mvn metaobjects:eject` (FR — eject in every port, JVM section) ships the
verbatim source of every ejectable generator inside the jar that owns it, as a
classpath resource under META-INF/metaobjects/reference/kotlin/. Copied at BUILD
TIME from the same src/main/kotlin files kotlinc just compiled — never a second,
hand-maintained copy — so there is nothing to drift: the resource IS the source,
one file, one owner. See
com.metaobjects.generator.kotlin.GeneratorRegistry.kt's EJECT_RESOURCE_ROOT. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>ship-eject-reference-source</id>
<phase>generate-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.outputDirectory}/META-INF/metaobjects/reference/kotlin</outputDirectory>
<resources>
<resource>
<directory>src/main/kotlin/com/metaobjects/generator/kotlin</directory>
<includes>
<include>KotlinEntityGenerator.kt</include>
<include>KotlinSpringControllerGenerator.kt</include>
<include>KotlinRepositoryGenerator.kt</include>
<include>KotlinOutputParserGenerator.kt</include>
<include>KotlinOutputPromptGenerator.kt</include>
<include>KotlinRenderHelperGenerator.kt</include>
<include>KotlinExtractorGenerator.kt</include>
<include>KotlinFilterAllowlistGenerator.kt</include>
<include>KotlinNamesGenerator.kt</include>
<include>KotlinExposedTableGenerator.kt</include>
<include>KotlinRelationsGenerator.kt</include>
<include>KotlinSpringConfigGenerator.kt</include>
<include>KotlinStoredProcGenerator.kt</include>
<include>KotlinValidatorGenerator.kt</include>
<include>KotlinRequirementTestsGenerator.kt</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jetbrains.dokka</groupId>
<artifactId>dokka-maven-plugin</artifactId>
<version>1.9.20</version>
<executions>
<execution>
<id>attach-javadoc</id>
<phase>package</phase>
<goals><goal>javadocJar</goal></goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>