Skip to content

build: consume bundled fonts/emoji as test-scope artifacts instead of sibling source#295

Merged
DemchaAV merged 1 commit into
2.0-devfrom
chore/2.0-fonts-emoji-test-deps
Jul 5, 2026
Merged

build: consume bundled fonts/emoji as test-scope artifacts instead of sibling source#295
DemchaAV merged 1 commit into
2.0-devfrom
chore/2.0-fonts-emoji-test-deps

Conversation

@DemchaAV

@DemchaAV DemchaAV commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Why

The engine's visual / snapshot / emoji suites render with the bundled Google fonts and colour-emoji glyphs, which live in the sibling graph-compose-fonts / graph-compose-emoji modules. Until now the root pom put them on the test classpath by pointing <testResources> at ${project.basedir}/fonts|emoji/src/main/resources by source path. That form is relative to the root module's basedir and will not survive the 2.0 module split — once render backends and templates become modules at other directory depths, a source-path resource entry can't reach the sibling fonts source. Consuming the published artifact is depth-independent and models the engine as a normal fonts consumer, which is the whole point of the fonts split.

What changed (root pom.xml only)

  • Depend on graph-compose-fonts:1.0.0 and graph-compose-emoji:1.0.0 at test scope (via new graphcompose.fonts.version / graphcompose.emoji.version properties, pinned to the independent 1.0.0 line and kept in step with bundle/pom.xml).
  • Remove the two source-path <testResource> entries (fonts|emoji/src/main/resources); the default src/test/resources stays. The artifacts package the same src/main/resources layout, so classpath lookups are unchanged.
  • Drop the now-moot fonts/** / emoji/** attach-test-jar excludes — nothing is copied into target/test-classes any more, so the tests-jar naturally carries only the engine's own fixtures (com.demcha.mock) that the benchmarks module consumes.

Test scope is not transitive, so the engine's own published jar stays fonts-free — an engine consumer never drags these in.

Verification

  • ./mvnw clean verify -pl . — green. Because clean wipes target/test-classes first, the fonts/emoji can only come from the test-scope artifacts; the visual/emoji suites passing is the proof the decoupling works. This is the same invocation CI's build-and-test job runs.
  • Aggregator reactor (-pl :graph-compose -am clean verify) — build order is graph-compose-fonts → graph-compose-emoji → graph-compose, all SUCCESS: the new root→fonts/emoji edge reorders correctly even though the aggregator lists the root first, and the root builds against the reactor-fresh jars.
  • graph-compose-fonts:1.0.0 and graph-compose-emoji:1.0.0 are on Maven Central and identical to the in-repo source (no commits to fonts/src / emoji/src since their -v1.0.0 tags), so a fresh CI build with an empty local repo resolves them from Central without a bootstrap install — closing the gap that made a test-scope fonts dep break CI at the original v1.8.0 split.
  • Diff is pom-only; src/main is untouched, so the engine's published bytecode is unchanged.

…tifacts

The engine's visual / snapshot / emoji suites need the bundled Google fonts
and colour-emoji glyphs, which live in the sibling graph-compose-fonts /
graph-compose-emoji modules. Until now they were placed on the test classpath
by pointing <testResources> at ${project.basedir}/fonts|emoji/src/main/resources
directly. That source-path form is relative to the root module's basedir and
will not survive the 2.0 module split, where render backends and templates sit
at other depths.

Depend on the published graph-compose-fonts:1.0.0 and graph-compose-emoji:1.0.0
at test scope instead. The artifacts package the same src/main/resources layout,
so classpath lookups are unchanged; test scope is not transitive, so the engine's
own published jar stays fonts-free. The two source-path <testResource> entries
and the now-moot fonts/**/emoji/** tests-jar excludes are removed (nothing is
copied into test-classes any more, so the tests-jar naturally carries only the
engine's own fixtures for the benchmarks module).

Verified: `./mvnw clean verify -pl .` green (clean-built, so fonts/emoji come
only from the artifacts); the aggregator reactor builds fonts and emoji before
the root and succeeds. graph-compose-fonts/-emoji 1.0.0 are on Central and match
the in-repo source, so a fresh CI build resolves them without a bootstrap step.
@DemchaAV DemchaAV merged commit 3e145e1 into 2.0-dev Jul 5, 2026
19 of 20 checks passed
@DemchaAV DemchaAV deleted the chore/2.0-fonts-emoji-test-deps branch July 5, 2026 11:17
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.

1 participant