You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// The following tasks download the JSON Schema files from open-telemetry/opentelemetry-configuration and generate classes from the type definitions which are used with jackson-databind to parse JSON / YAML to the configuration schema.
52
+
// The following tasks download the JSON Schema files from open-telemetry/opentelemetry-configuration,
53
+
// generate POJOs, and write the post-processed result into src/main/java for version control.
53
54
// The sequence of tasks is:
54
55
// 1. downloadConfigurationSchema - download configuration schema from open-telemetry/opentelemetry-configuration
55
56
// 2. unzipConfigurationSchema - unzip the configuration schema archive contents to $buildDir/configuration/
56
57
// 3. generateJsonSchema2Pojo - generate java POJOs from the configuration schema
57
-
// 4. jsonSchema2PojoPostProcessing - perform various post processing on the generated POJOs, e.g. replace javax.annotation.processing.Generated with javax.annotation.Generated, add @SuppressWarning("rawtypes") annotation
58
-
// 5. overwriteJs2p - overwrite original generated classes with versions containing updated @Generated annotation
59
-
// 6. deleteJs2pTmp - delete tmp directory
60
-
// ... proceed with normal sourcesJar, compileJava, etc
58
+
// 4. syncPojoModelsToSrc - post-process the generated POJOs and write them to src/main/java
59
+
// The generated POJOs are committed to src/main/java and are NOT regenerated as part of the normal build.
60
+
// To regenerate (e.g. after a schema update), run: ./gradlew :sdk-extensions:declarative-config:syncPojoModelsToSrc
61
61
62
62
val configurationTag ="1.0.0"
63
63
val configurationRef ="refs/tags/v$configurationTag"// Replace with commit SHA to point to experiment with a specific commit
@@ -100,8 +100,8 @@ jsonSchema2Pojo {
100
100
// Clear old source files to avoid contaminated source dir when updating
101
101
removeOldOutput =true
102
102
103
-
// Include @Nullable annotation. Note: jsonSchmea2Pojo will not add @Nullable annotations on getters
104
-
// so we perform some steps in jsonSchema2PojoPostProcessing to add these.
103
+
// Include @Nullable annotation. Note: jsonSchema2Pojo will not add @Nullable annotations on getters
104
+
// so we add these in syncPojoModelsToSrc.
105
105
includeJsr305Annotations =true
106
106
107
107
// Prefer builders to setters
@@ -128,34 +128,42 @@ jsonSchema2Pojo {
128
128
val generateJsonSchema2Pojo = tasks.getByName("generateJsonSchema2Pojo")
"syncPojoModelsToSrc requires Java 21 (current: ${JavaVersion.current()}). jsonschema2pojo output is JVM-version-sensitive; using the wrong version produces spurious diffs."
138
+
}
139
+
// Copy won't remove files that no longer exist in the source. Delete first so schema type removals don't leave stale classes.
0 commit comments