Skip to content

build: split bundled fonts into a separate artifact and slim the v1.8.0 publication#211

Merged
DemchaAV merged 3 commits into
developfrom
chore/v1.8.0-lean-publication-fonts-split
Jun 18, 2026
Merged

build: split bundled fonts into a separate artifact and slim the v1.8.0 publication#211
DemchaAV merged 3 commits into
developfrom
chore/v1.8.0-lean-publication-fonts-split

Conversation

@DemchaAV

Copy link
Copy Markdown
Owner

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 (now >200 MB across releases) and forced an engine-only upgrade to re-download fonts.

What changed

  • New io.github.demchaav:graph-compose-fonts module (fonts/, independent 1.0.0 version line) carries the fonts/google/** binaries. Classpath paths are preserved byte-for-byte, so DefaultFonts resolves them unchanged. The engine depends on it at test scope only, so it never propagates to consumers — upgrading the engine never drags fonts along.
  • New io.github.demchaav:graph-compose-bundle (bundle/, pom) aggregates engine + fonts for a one-line "batteries-included" install; tracks the engine version.
  • Leaner publication: the release build no longer attaches/deploys the -tests jar (kept as a local build aid for benchmarks/); with fonts gone the -sources.jar is lean too. Main jar drops ~20 MB → 2.6 MB, sources ~18 MB → 1.7 MB.
  • A missing fonts/google/... resource now fails with an actionable message naming the graph-compose-fonts dependency (FontFamilyDefinition).
  • Release wiring: 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 .1398 tests, 0 failures (incl. two new font-degradation tests + the bundle/fonts version guards).
  • fonts and bundle modules build; bundle resolves graph-compose + graph-compose-fonts.
  • Release jar contains no fonts/google/** and no -tests classifier.
  • CvSidebarPortrait example 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, 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.

DemchaAV added 3 commits June 18, 2026 09:12
…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.
@DemchaAV DemchaAV merged commit 803a710 into develop Jun 18, 2026
11 checks passed
@DemchaAV DemchaAV deleted the chore/v1.8.0-lean-publication-fonts-split branch June 18, 2026 11:37
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