Skip to content

build: extract publishing config into a build-logic convention plugin#105

Merged
OmarAlJarrah merged 4 commits into
mainfrom
build/publishing-convention-plugin
Jun 16, 2026
Merged

build: extract publishing config into a build-logic convention plugin#105
OmarAlJarrah merged 4 commits into
mainfrom
build/publishing-convention-plugin

Conversation

@OmarAlJarrah

Copy link
Copy Markdown
Member

Summary

All nine publishable modules carried a byte-identical ~45-line block of publishing configuration — a publishing {} publication with the full POM (name, description, url, MIT license, developer, SCM) and the local staging repo, a CI-gated signing {} block using in-memory PGP keys, and repeated group/version lines. The only "module-specific" parts (POM name/description) were already derived from project.name, so nothing was genuinely per-module.

This extracts that block into a build-logic included build with a single precompiled script plugin, dexpace.published-module. Each module now applies id("dexpace.published-module") instead of repeating the configuration; module-specific bits (the JDK-11/21 toolchain overrides, detekt-disable blocks) are left untouched. Net −469/+148 across 13 files. The plugin is opt-in, so a future non-publishing module (e.g. the example module on another branch) simply won't apply it.

Published output is unchanged

Regenerated POMs for sdk-core, sdk-async-virtualthreads, and sdk-serde-jackson are byte-identical to the baseline from main, and the published .pom/.module in the local repo carry the same org.dexpace / 0.0.1-alpha.1 coordinates. CI-gated signing is wired identically — skipped locally without keys (isRequired = CI == "true"), engaging under CI with SIGNING_KEY/SIGNING_PASSWORD.

Validation

./gradlew build green (all gates, including ktlint over the module .kts scripts and the build-logic compile); ./gradlew publishToMavenLocal and publishAllPublicationsToLocalRepository both green with the full artifact sets.

Touches settings.gradle.kts and every module build script, so expect a rebase against the example-module PR (#102) and the R8 module PR depending on merge order.

Closes #71

Every publishable module repeated the same ~45-line maven-publish + signing
+ POM block, so any change to the Sonatype coordinates, license, SCM, or
signing setup meant editing nine build scripts in lockstep.

Introduce a `build-logic` included build with a single precompiled script
plugin, `dexpace.published-module`, that owns the publication, POM metadata,
staging repository, coordinates (group `org.dexpace`, version
`0.0.1-alpha.1`), and the CI-gated in-memory signing configuration. Each of
the nine modules now applies `id("dexpace.published-module")` and keeps only
its module-specific dependencies and toolchain overrides; the POM name and
description continue to derive from `project.name`, so no module needs any
further publishing configuration. A module that should not be published
simply does not apply the plugin.

The generated POMs, Gradle module metadata, coordinates, artifacts, and
signing behaviour are unchanged: the per-module POMs are byte-identical to
those produced before the change, and `publishToMavenLocal` continues to skip
signing when no PGP key is present (signing is required only under CI).
…the publishing convention

Set group/version once in gradle.properties, which Gradle applies to the
root project and every subproject, removing the duplicated literals from
the root build script and the published-module convention plugin. A
coordinate bump is now a single one-line edit. Published POM coordinates
are unchanged (org.dexpace / 0.0.1-alpha.1).

Document the dexpace.published-module convention in CLAUDE.md so new
modules apply the plugin rather than re-inlining a publishing block.
…ention-plugin

# Conflicts:
#	gradle.properties
@OmarAlJarrah OmarAlJarrah merged commit a9b6b5d into main Jun 16, 2026
1 check passed
@OmarAlJarrah OmarAlJarrah deleted the build/publishing-convention-plugin branch June 16, 2026 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extract a build-logic convention plugin to remove duplicated publishing config

1 participant