Maven Central publishing, CD automation - #6
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces Maven Central publishing + CD automation and adds a new Gradle plugin module that wraps the core OpenAPI parser/generator for consumer builds.
Changes:
- Add
pluginGradle module with ajustworks { specs { ... } }DSL and generation tasks (including functional tests via Gradle TestKit). - Implement/extend core OpenAPI parsing, validation, and Kotlin code generation (models, clients, shared response types) with extensive unit tests and test specs.
- Configure Maven Central publishing (via Vanniktech plugin) and add a GitHub Actions CD workflow triggered by
v*tags.
Reviewed changes
Copilot reviewed 42 out of 44 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
settings.gradle.kts |
Includes new plugin module in the multi-module build. |
build.gradle.kts |
Adds Maven publish plugin and switches versioning to tag/env-based release versions. |
.gitignore |
Adds common build/IDE output directories to ignore list. |
.github/workflows/cd.yml |
Adds tag-triggered CD workflow to publish/release artifacts to Maven Central. |
core/build.gradle.kts |
Switches to Vanniktech publishing and adds Arrow dependency + context-parameters compiler flag. |
core/src/main/kotlin/com/avsystem/justworks/core/Generator.kt |
Adds a generator entry point placeholder object. |
core/src/main/kotlin/com/avsystem/justworks/core/model/ApiSpec.kt |
Defines parsed OpenAPI model types (ApiSpec, SchemaModel, etc.). |
core/src/main/kotlin/com/avsystem/justworks/core/model/TypeRef.kt |
Defines TypeRef sealed type tree for schema typing. |
core/src/main/kotlin/com/avsystem/justworks/core/parser/SpecValidator.kt |
Adds OpenAPI validation producing errors/warnings. |
core/src/main/kotlin/com/avsystem/justworks/core/parser/SpecParser.kt |
Adds OpenAPI parsing + schema/endpoint extraction with ref resolution and combinator handling. |
core/src/main/kotlin/com/avsystem/justworks/core/gen/Names.kt |
Centralizes KotlinPoet type/member references used by generators. |
core/src/main/kotlin/com/avsystem/justworks/core/gen/NameUtils.kt |
Adds naming utilities for identifiers, enum constants, and operation names. |
core/src/main/kotlin/com/avsystem/justworks/core/gen/TypeMapping.kt |
Maps TypeRef to KotlinPoet TypeNames (incl. dates). |
core/src/main/kotlin/com/avsystem/justworks/core/gen/SerializersModuleGenerator.kt |
Generates SerializersModule registrations for polymorphic types. |
core/src/main/kotlin/com/avsystem/justworks/core/gen/InlineSchemaDeduplicator.kt |
Deduplicates inline schemas and resolves name collisions. |
core/src/main/kotlin/com/avsystem/justworks/core/gen/ModelGenerator.kt |
Generates Kotlin models (data classes, sealed interfaces, serializers) from ApiSpec. |
core/src/main/kotlin/com/avsystem/justworks/core/gen/ClientGenerator.kt |
Generates Ktor-based API clients from ApiSpec. |
core/src/main/kotlin/com/avsystem/justworks/core/gen/ApiResponseGenerator.kt |
Generates shared response wrapper types (HttpError, HttpSuccess). |
core/src/test/resources/petstore.yaml |
Adds OpenAPI 3 test spec fixture. |
core/src/test/resources/petstore-v2.json |
Adds Swagger 2.0 test fixture for auto-conversion. |
core/src/test/resources/invalid-spec.yaml |
Adds invalid spec fixture for validation/error tests. |
core/src/test/resources/refs-spec.yaml |
Adds $ref-heavy spec fixture for reference resolution tests. |
core/src/test/resources/polymorphic-spec.yaml |
Adds oneOf/allOf polymorphism fixture for parser/generator tests. |
core/src/test/resources/anyof-spec.yaml |
Adds anyOf fixture (incl. discriminator + union case). |
core/src/test/resources/anyof-valid-spec.yaml |
Adds anyOf-with-discriminator fixture. |
core/src/test/resources/mixed-combinator-spec.yaml |
Adds fixture to assert mixed oneOf/anyOf errors. |
core/src/test/kotlin/com/avsystem/justworks/core/parser/SpecValidatorTest.kt |
Unit tests for SpecValidator. |
core/src/test/kotlin/com/avsystem/justworks/core/parser/SpecParserTest.kt |
Broad parser tests for endpoints/schemas/refs/errors/v2 conversion/anyOf. |
core/src/test/kotlin/com/avsystem/justworks/core/parser/SpecParserPolymorphicTest.kt |
Parser tests focused on polymorphic handling. |
core/src/test/kotlin/com/avsystem/justworks/core/gen/TypeMappingTest.kt |
Unit tests for TypeMapping. |
core/src/test/kotlin/com/avsystem/justworks/core/gen/SerializersModuleGeneratorTest.kt |
Unit tests for serializers module generation. |
core/src/test/kotlin/com/avsystem/justworks/core/gen/NameUtilsTest.kt |
Unit tests for naming helpers. |
core/src/test/kotlin/com/avsystem/justworks/core/gen/InlineSchemaDedupTest.kt |
Unit tests for inline schema deduplication logic. |
core/src/test/kotlin/com/avsystem/justworks/core/gen/ModelGeneratorTest.kt |
Unit tests for model generation (properties, defaults, enums, aliases, etc.). |
core/src/test/kotlin/com/avsystem/justworks/core/gen/ModelGeneratorPolymorphicTest.kt |
Unit tests for polymorphic model generation and serializer behavior. |
core/src/test/kotlin/com/avsystem/justworks/core/gen/ClientGeneratorTest.kt |
Unit tests for client generation (methods, params, auth, error handling). |
core/src/test/kotlin/com/avsystem/justworks/core/gen/ApiResponseGeneratorTest.kt |
Unit tests for shared response type generation. |
plugin/build.gradle.kts |
Configures Gradle plugin publication + functional test source set. |
plugin/src/main/kotlin/com/avsystem/justworks/gradle/JustworksPlugin.kt |
Registers DSL extension and generation tasks; wires outputs into compilation. |
plugin/src/main/kotlin/com/avsystem/justworks/gradle/JustworksExtension.kt |
Defines justworks { specs { ... } } extension container. |
plugin/src/main/kotlin/com/avsystem/justworks/gradle/JustworksSpecConfiguration.kt |
Defines per-spec DSL configuration object. |
plugin/src/main/kotlin/com/avsystem/justworks/gradle/JustworksGenerateTask.kt |
Task that parses specs and runs generators into build output. |
plugin/src/main/kotlin/com/avsystem/justworks/gradle/JustworksSharedTypesTask.kt |
Task that generates shared HttpError/HttpSuccess once per build. |
plugin/src/functionalTest/kotlin/com/avsystem/justworks/gradle/JustworksPluginFunctionalTest.kt |
Gradle TestKit functional coverage for the plugin DSL/tasks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
b2abec1 to
3168d68
Compare
075769a to
5d308d5
Compare
6dd8eb9 to
ebad85e
Compare
5d308d5 to
a0ad7d8
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Configure vanniktech maven-publish plugin with Central Portal, GPG signing, and GitHub Actions workflow triggered on version tags. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replaced redundant property setters with assignment syntax. - Updated Maven Central configuration and developer information in `pom`. - Simplified ktlint version and compiler arguments setup.
…ized Maven publishing - Added Maven publish configuration for all subprojects with shared metadata. - Simplified and unified POM setup, including URLs, licenses, SCM info, and developer details. - Removed individual Maven configurations from subprojects.
Core module no longer publishes to Maven Central — only the Gradle plugin is distributed. All POM metadata now lives in plugin/build.gradle.kts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Applied shared Maven publishing setup to all subprojects. - Consolidated POM metadata including licenses, SCM details, and developer info in the root `build.gradle.kts`. - Removed duplicated Maven configurations across subprojects.
5330496 to
f654f05
Compare
|
- Add CI dependency to CD workflow to prevent publishing broken artifacts - Add --no-configuration-cache to publish command - Validate release tag with semver regex instead of naive v-prefix strip - Centralize kover plugin version in root build.gradle.kts for consistency Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
|
Improve README with publishing info and it looks good to go as far as I'm concerned |
|
- Add validate-tag job that fails fast on non-semver tags - Make publish depend on both CI and tag validation - Add workflow_call trigger to ci.yml for reusable workflow support Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Coverage Report
|
No description provided.