build: consume bundled fonts/emoji as test-scope artifacts instead of sibling source#295
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-emojimodules. Until now the root pom put them on the test classpath by pointing<testResources>at${project.basedir}/fonts|emoji/src/main/resourcesby 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.xmlonly)graph-compose-fonts:1.0.0andgraph-compose-emoji:1.0.0at test scope (via newgraphcompose.fonts.version/graphcompose.emoji.versionproperties, pinned to the independent 1.0.0 line and kept in step withbundle/pom.xml).<testResource>entries (fonts|emoji/src/main/resources); the defaultsrc/test/resourcesstays. The artifacts package the samesrc/main/resourceslayout, so classpath lookups are unchanged.fonts/**/emoji/**attach-test-jarexcludes — nothing is copied intotarget/test-classesany 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. Becausecleanwipestarget/test-classesfirst, 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'sbuild-and-testjob runs.-pl :graph-compose -am clean verify) — build order isgraph-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.0andgraph-compose-emoji:1.0.0are on Maven Central and identical to the in-repo source (no commits tofonts/src/emoji/srcsince their-v1.0.0tags), 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.src/mainis untouched, so the engine's published bytecode is unchanged.