Skip to content

Commit f1da732

Browse files
committed
build: source module coordinates from gradle.properties and document 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.
1 parent 5c15858 commit f1da732

4 files changed

Lines changed: 20 additions & 9 deletions

File tree

CLAUDE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ Layered, from the bottom up:
105105
public entry point (e.g. only `OkioIoProvider` is public in `sdk-io-okio3`).
106106
- **`sdk-core` has zero non-SLF4J runtime deps** — I/O, Jackson, and concurrency libraries live only in
107107
adapter modules. SLF4J is `compileOnly` (added by the root build to every Kotlin module).
108+
- **Published modules apply `id("dexpace.published-module")`** — the convention plugin in the `build-logic`
109+
included build (`build-logic/src/main/kotlin/dexpace.published-module.gradle.kts`) carries the
110+
`maven-publish` + `signing` setup, shared POM, staging repo, and CI-gated signing. Do not re-inline a
111+
`publishing {}`/`signing {}` block in a module; a new publishable module just applies the plugin, and a
112+
module that must not be published simply omits it. Coordinates (`group`/`version`) come from
113+
`gradle.properties` and apply to every project.
108114
- **Commit style:** `feat:` / `test:` / `docs:` / `chore:` prefixes; `merge:` for work-unit merge commits.
109115

110116
## Things That Will Bite You

build-logic/src/main/kotlin/dexpace.published-module.gradle.kts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,10 @@ plugins {
2121
signing
2222
}
2323

24-
// Coordinates. The group and version are the same for every published module and match the
25-
// values declared on the root project; keeping the single literal here makes a coordinate
26-
// change a one-file edit instead of a nine-file edit. The root `build.gradle.kts` still declares
27-
// its own `group`/`version`, so a version bump must update both literals until they are sourced
28-
// from one place (e.g. a `gradle.properties` entry read by both).
29-
group = "org.dexpace"
30-
version = "0.0.1-alpha.1"
24+
// Coordinates (`group`/`version`) are not set here. Gradle applies them from the repository-root
25+
// `gradle.properties` to the root project and every subproject, so each consuming module already
26+
// carries the shared `org.dexpace` coordinates and current version by the time this plugin runs —
27+
// a coordinate bump is a one-line edit in that file.
3128

3229
// The `library` publication is built from the `java` software component, which only exists once a
3330
// `java`/`java-library`/`kotlin("jvm")` plugin is applied. Every current consumer applies

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ plugins {
3838
alias(libs.plugins.detekt)
3939
}
4040

41-
group = "org.dexpace"
42-
version = "0.0.1-alpha.1"
41+
// `group` and `version` are set once in `gradle.properties` and applied by Gradle to the root
42+
// project and every subproject — see that file.
4343

4444
// Coverage: aggregate every Kover-enabled subproject through this root project's reports.
4545
dependencies {

gradle.properties

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
11
kotlin.code.style=official
2+
3+
# Project coordinates. Gradle applies `group` and `version` from gradle.properties to every
4+
# project in this build, so the root and all published modules share one source of truth — no
5+
# per-module or per-script literal. A coordinate bump is a one-line edit here. (The `build-logic`
6+
# included build is a separate build with its own scope and does not read these; it needs no
7+
# coordinates of its own.)
8+
group=org.dexpace
9+
version=0.0.1-alpha.1

0 commit comments

Comments
 (0)