build: split bundled fonts into a separate artifact and slim the v1.8.0 publication#211
Merged
Merged
Conversation
…ication Why: the published graph-compose artifact set was ~40 MB per release — the ~18 MB of bundled Google fonts shipped inside the main jar AND again in the -sources jar, and the -tests classifier jar was deployed too. Fonts change rarely, so re-shipping them on every engine release wasted Maven Central storage and forced an engine-only upgrade to re-download fonts. What: - New io.github.demchaav:graph-compose-fonts module (independent 1.0.0 line) carries the fonts/google/** binaries; classpath paths preserved byte-for-byte so DefaultFonts resolves them unchanged. The engine depends on it at TEST scope only, so it never propagates to consumers. - New io.github.demchaav:graph-compose-bundle (pom) aggregates engine + fonts for a one-line "batteries-included" install; tracks the engine version. - The engine release no longer attaches or deploys the -tests jar (kept as a local build aid for the benchmarks module); with the fonts gone the -sources jar is lean too. Main jar drops from ~20 MB to ~2.6 MB. - A missing fonts/google resource now fails with an actionable message naming the graph-compose-fonts dependency. - Fonts publish on their own fonts-v* tag (publish-fonts.yml); the engine v* tag deploys engine + bundle and installs fonts first for the test-scope verify. cut-release.ps1 bumps the bundle in lockstep while fonts stays independent; VersionConsistencyGuardTest enforces both. CHANGELOG, README, and docs/migration/v1.8.0-fonts.md document the consumer-facing change. Verification: ./mvnw clean verify -pl . green (1397 tests, including two new font-degradation tests and the bundle/fonts version guards); the fonts and bundle modules build and resolve; the release jar contains no fonts/google and no -tests classifier; the CvSidebarPortrait example renders (Google fonts from the fonts jar + portrait asset from the engine jar). BREAKING CHANGE: bundled Google fonts are no longer inside graph-compose. To keep them, add io.github.demchaav:graph-compose-fonts (or depend on graph-compose-bundle). The FontName API and DefaultFonts catalog are unchanged (source- and binary-compatible); standard-14 documents render with no extra dependency. See docs/migration/v1.8.0-fonts.md.
…nsumer 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.
The "use a font that covers the range" section still claimed FontName.JETBRAINS_MONO is bundled in the engine. Since v1.8.0 the curated Google families ship in the separate io.github.demchaav:graph-compose-fonts artifact, so the page now tells the reader to add it (or the bundle) to use them, that the engine renders with standard-14 only without it (and fails fast naming the dependency when a bundled family is requested), and links the migration note.
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 published
graph-composeartifact set was ~40 MB per release: the ~18 MB of bundled Google fonts shipped inside the main jar and again in the-sources.jar, and the-testsclassifier jar was deployed too. Fonts change rarely, so re-shipping them on every engine release wasted Maven Central storage (now >200 MB across releases) and forced an engine-only upgrade to re-download fonts.What changed
io.github.demchaav:graph-compose-fontsmodule (fonts/, independent1.0.0version line) carries thefonts/google/**binaries. Classpath paths are preserved byte-for-byte, soDefaultFontsresolves them unchanged. The engine depends on it at test scope only, so it never propagates to consumers — upgrading the engine never drags fonts along.io.github.demchaav:graph-compose-bundle(bundle/, pom) aggregates engine + fonts for a one-line "batteries-included" install; tracks the engine version.-testsjar (kept as a local build aid forbenchmarks/); with fonts gone the-sources.jaris lean too. Main jar drops ~20 MB → 2.6 MB, sources ~18 MB → 1.7 MB.fonts/google/...resource now fails with an actionable message naming thegraph-compose-fontsdependency (FontFamilyDefinition).fonts-v*tag (publish-fonts.yml); the enginev*tag deploys engine + bundle and installs fonts first for the test-scope verify.cut-release.ps1bumps the bundle in lockstep while fonts stays independent;VersionConsistencyGuardTestenforces both.CHANGELOG,README, anddocs/migration/v1.8.0-fonts.mddocument the consumer-facing change.Verification
./mvnw clean verify -pl .→ 1398 tests, 0 failures (incl. two new font-degradation tests + the bundle/fonts version guards).fontsandbundlemodules build;bundleresolvesgraph-compose+graph-compose-fonts.fonts/google/**and no-testsclassifier.CvSidebarPortraitexample renders (Google fonts from the fonts jar + portrait asset from the engine jar).Breaking change (consumers)
Bundled Google fonts are no longer inside
graph-compose. To keep them, addio.github.demchaav:graph-compose-fonts(or depend ongraph-compose-bundle). TheFontNameAPI andDefaultFontscatalog are unchanged (source- and binary-compatible); standard-14 documents render with no extra dependency. See docs/migration/v1.8.0-fonts.md.