Skip to content

Commit c6b9201

Browse files
committed
ci: build the engine without the fonts artifact; install fonts for consumer jobs
Why: the bundled-fonts split made every engine CI build red. The engine declared a TEST-scope dependency on io.github.demchaav:graph-compose-fonts, which is not on Central yet — and Maven resolves declared dependencies before running (or skipping) tests, so even -DskipTests jobs (japicmp, CodeQL) failed at "Could not resolve dependencies … graph-compose-fonts:jar:1.0.0 (test)". What: - The engine no longer depends on the fonts artifact at all. Its visual / snapshot suite gets the bundled fonts on the TEST classpath directly from the sibling module's source via a <testResources> entry pointing at fonts/src/main/resources. This fully decouples the engine build from the fonts artifact: an engine-only build needs no fonts jar published or installed, and contributors no longer need a bootstrap install. The fonts are excluded from the tests-jar so they don't bloat it (the benchmarks module gets fonts from the artifact). The engine pom drops the now-unused graphcompose.fonts.version property. - VersionConsistencyGuardTest now checks the fonts version agrees between the aggregator and the bundle (the two modules that pin the artifact); the engine no longer carries the property. - Consumer CI jobs that build the examples / benchmarks modules (which DO depend on the fonts artifact) install graph-compose-fonts into the local repo first (ci.yml examples / perf-smoke / weekly-diff, benchmarks-jmh.yml). The now-unnecessary fonts bootstrap is removed from publish.yml. - release-process.md §2.D updated to match (no engine fonts.version; no engine bootstrap). Verification: with graph-compose-fonts removed from the local ~/.m2, ./mvnw clean verify -pl . is green (1398 tests) — replicating the CI environment; the main jar stays 2.54 MB with no fonts/google entries and the tests-jar carries the test classes but no fonts.
1 parent 2fbf820 commit c6b9201

6 files changed

Lines changed: 81 additions & 53 deletions

File tree

.github/workflows/benchmarks-jmh.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ jobs:
4141
java-version: '17'
4242
cache: maven
4343

44+
- name: Install graph-compose-fonts (the benchmarks render with the bundled families)
45+
run: ./mvnw -B -ntp -f fonts/pom.xml -DskipTests install
46+
4447
- name: Install root artifact (graph-compose + test-jar)
4548
run: ./mvnw -B -ntp -DskipTests install -pl .
4649

.github/workflows/ci.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ jobs:
9999
java-version: '17'
100100
cache: maven
101101

102+
- name: Install graph-compose-fonts (consumed by the examples / benchmarks modules)
103+
# The engine itself does not depend on the fonts artifact, but the
104+
# examples and benchmarks modules render with the bundled families, so
105+
# install graph-compose-fonts into the local repo before building them.
106+
run: ./mvnw -B -ntp -f fonts/pom.xml -DskipTests install
107+
102108
- name: Install root artifact
103109
run: ./mvnw -B -ntp -DskipTests install -pl .
104110

@@ -202,6 +208,12 @@ jobs:
202208
java-version: '17'
203209
cache: maven
204210

211+
- name: Install graph-compose-fonts (consumed by the examples / benchmarks modules)
212+
# The engine itself does not depend on the fonts artifact, but the
213+
# examples and benchmarks modules render with the bundled families, so
214+
# install graph-compose-fonts into the local repo before building them.
215+
run: ./mvnw -B -ntp -f fonts/pom.xml -DskipTests install
216+
205217
- name: Install root artifact
206218
run: ./mvnw -B -ntp -DskipTests install -pl .
207219

@@ -264,6 +276,12 @@ jobs:
264276
benchmark-current-speed-${{ github.ref_name }}-
265277
benchmark-current-speed-
266278
279+
- name: Install graph-compose-fonts (consumed by the examples / benchmarks modules)
280+
# The engine itself does not depend on the fonts artifact, but the
281+
# examples and benchmarks modules render with the bundled families, so
282+
# install graph-compose-fonts into the local repo before building them.
283+
run: ./mvnw -B -ntp -f fonts/pom.xml -DskipTests install
284+
267285
- name: Install root artifact
268286
run: ./mvnw -B -ntp -DskipTests install -pl .
269287

.github/workflows/publish.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,6 @@ jobs:
7979
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
8080
gpg-passphrase: MAVEN_GPG_PASSPHRASE
8181

82-
- name: Install graph-compose-fonts into the local repo
83-
# The engine's visual / snapshot suite renders with the bundled
84-
# Google fonts, which now live in the separately-versioned
85-
# graph-compose-fonts artifact (engine depends on it at test
86-
# scope). Build + install it locally so the verify step below can
87-
# resolve it even before it (or this engine version) is on Central.
88-
run: ./mvnw -B -ntp -f fonts/pom.xml clean install
89-
9082
- name: Verify (full canonical suite green at tagged commit)
9183
# Re-verify the tagged commit before publishing — defence in
9284
# depth against a tag pushed from a broken branch by mistake.

docs/contributing/release-process.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,16 @@ is a convenience aggregate `io.github.demchaav:graph-compose-bundle` (under
121121
`<version>`, push a `fonts-vX.Y.Z` tag. That tag triggers
122122
[`publish-fonts.yml`](../../.github/workflows/publish-fonts.yml), which deploys
123123
only `graph-compose-fonts` to Central. Then bump
124-
`<graphcompose.fonts.version>` in the engine `pom.xml`, `aggregator/pom.xml`,
125-
and `bundle/pom.xml` to the new fonts version so the next engine release pins
126-
it (the engine→fonts dependency is test-scope; examples/benchmarks/bundle pin
127-
it for real).
128-
- **First-time bootstrap.** The engine verify depends on `graph-compose-fonts`
129-
at test scope. `publish.yml` installs it locally first
130-
(`./mvnw -f fonts/pom.xml install`); for a local full-reactor build run that
131-
once before building the engine standalone (`./mvnw clean verify -pl .`).
124+
`<graphcompose.fonts.version>` in `aggregator/pom.xml` (inherited by
125+
examples + benchmarks) and `bundle/pom.xml` to the new fonts version so those
126+
consumers pin it. The engine `pom.xml` does **not** carry this property — the
127+
engine has no dependency on the fonts artifact (its tests read the fonts from
128+
the sibling module's source via `<testResources>`).
129+
- **No fonts bootstrap for the engine.** Because the engine does not depend on
130+
the fonts artifact, `./mvnw clean verify -pl .` builds standalone without the
131+
fonts jar being published or installed. Only the consumer modules (examples,
132+
benchmarks) need `graph-compose-fonts` in the local repo — their CI jobs run
133+
`./mvnw -f fonts/pom.xml install` before building.
132134

133135
---
134136

pom.xml

Lines changed: 40 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,6 @@
6262
<mockito.version>5.23.0</mockito.version>
6363
<byteBuddy.version>1.18.10</byteBuddy.version>
6464

65-
<!--
66-
Bundled Google fonts moved to the independently-versioned
67-
io.github.demchaav:graph-compose-fonts artifact in v1.8.0 so an
68-
engine upgrade never re-ships ~18 MB of fonts. The engine depends
69-
on it at TEST scope only (the visual / snapshot suite renders with
70-
the bundled families); it never propagates to consumers, who add
71-
graph-compose-fonts (or graph-compose-bundle) themselves. Its
72-
version is an independent line — do NOT fold it into the engine
73-
lockstep `versions:set`. Keep in lockstep with the same property in
74-
aggregator/pom.xml and bundle/pom.xml (no shared parent to
75-
single-source it; VersionConsistencyGuardTest enforces agreement).
76-
-->
77-
<graphcompose.fonts.version>1.0.0</graphcompose.fonts.version>
78-
7965
<!-- Build plugins -->
8066
<central.publishing.plugin.version>0.10.0</central.publishing.plugin.version>
8167
<maven.compiler.plugin.version>3.15.0</maven.compiler.plugin.version>
@@ -232,19 +218,15 @@
232218

233219
<!-- Test dependencies -->
234220
<!--
235-
The bundled Google font binaries (graph-compose-fonts) are no
236-
longer part of the main artifact. The engine's visual / snapshot
237-
suite still renders with them, so they are pulled at test scope.
238-
Test scope is deliberate: it keeps fonts off the consumer-facing
239-
classpath, so upgrading the engine never drags fonts along.
221+
The bundled Google fonts (graph-compose-fonts) are NOT a dependency
222+
of the engine — not even at test scope. The engine's visual /
223+
snapshot suite renders with them, but they are placed on the TEST
224+
classpath directly from the sibling module's source via the
225+
<testResources> entry in <build> below. This keeps the engine fully
226+
decoupled from the fonts ARTIFACT (no Maven coordinate to resolve, so
227+
an engine-only build never needs the fonts jar published or installed
228+
first), while still exercising the real font binaries.
240229
-->
241-
<dependency>
242-
<groupId>io.github.demchaav</groupId>
243-
<artifactId>graph-compose-fonts</artifactId>
244-
<version>${graphcompose.fonts.version}</version>
245-
<scope>test</scope>
246-
</dependency>
247-
248230
<dependency>
249231
<groupId>ch.qos.logback</groupId>
250232
<artifactId>logback-classic</artifactId>
@@ -311,6 +293,26 @@
311293
</dependencies>
312294

313295
<build>
296+
<testResources>
297+
<!-- Default test resources. -->
298+
<testResource>
299+
<directory>src/test/resources</directory>
300+
</testResource>
301+
<!--
302+
Bundled Google fonts live in the sibling graph-compose-fonts
303+
module since v1.8.0. The engine's visual / snapshot suite renders
304+
with them, so put that module's resources on the TEST classpath
305+
directly from source. This decouples the engine build from the
306+
fonts ARTIFACT (no Maven dependency to resolve, so no CI/local
307+
bootstrap is needed) while still exercising the real binaries.
308+
Test-only: it never reaches the main jar (built from
309+
src/main/resources) and is excluded from the tests-jar below.
310+
-->
311+
<testResource>
312+
<directory>${project.basedir}/fonts/src/main/resources</directory>
313+
</testResource>
314+
</testResources>
315+
314316
<!--
315317
Pin the default-lifecycle plugins (clean / install / site /
316318
resources / deploy) so requirePluginVersions in the enforcer
@@ -445,6 +447,18 @@
445447
<goals>
446448
<goal>test-jar</goal>
447449
</goals>
450+
<configuration>
451+
<!--
452+
The bundled fonts are on the test classpath via
453+
<testResources> for the engine's own suite; keep
454+
them OUT of the tests-jar. The benchmarks module
455+
(the only consumer of this jar) gets fonts from
456+
the graph-compose-fonts artifact instead.
457+
-->
458+
<excludes>
459+
<exclude>fonts/**</exclude>
460+
</excludes>
461+
</configuration>
448462
</execution>
449463
</executions>
450464
</plugin>

src/test/java/com/demcha/documentation/VersionConsistencyGuardTest.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,18 @@ void everyModuleResolvesToTheRootProjectVersion() throws Exception {
7070

7171
@Test
7272
void bundledFontsVersionAgreesAcrossModules() throws Exception {
73-
// graph-compose-fonts carries an independent version line, but the
74-
// ${graphcompose.fonts.version} property that pins it is duplicated in
75-
// three poms (engine, aggregator, bundle) because there is no shared
76-
// parent to single-source it. This guards the PR-7.1 drift class: the
77-
// three must always agree, even though they differ from the engine line.
78-
String engine = fontsVersionProperty(PROJECT_ROOT.resolve("pom.xml"));
73+
// graph-compose-fonts carries an independent version line. The engine
74+
// does NOT depend on the fonts artifact (its tests read the fonts from
75+
// the sibling module's source), so the ${graphcompose.fonts.version}
76+
// property that pins the artifact lives only in the modules that consume
77+
// it: the aggregator (inherited by examples + benchmarks) and the bundle.
78+
// This guards the PR-7.1 drift class: those must always agree, even
79+
// though they differ from the engine version line.
80+
String aggregator = fontsVersionProperty(PROJECT_ROOT.resolve("aggregator/pom.xml"));
7981

80-
assertThat(fontsVersionProperty(PROJECT_ROOT.resolve("aggregator/pom.xml")))
81-
.describedAs("aggregator graphcompose.fonts.version must match the engine's (%s)", engine)
82-
.isEqualTo(engine);
8382
assertThat(fontsVersionProperty(PROJECT_ROOT.resolve("bundle/pom.xml")))
84-
.describedAs("bundle graphcompose.fonts.version must match the engine's (%s)", engine)
85-
.isEqualTo(engine);
83+
.describedAs("bundle graphcompose.fonts.version must match the aggregator's (%s)", aggregator)
84+
.isEqualTo(aggregator);
8685
}
8786

8887
@Test

0 commit comments

Comments
 (0)