Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/benchmarks-jmh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ jobs:
java-version: '17'
cache: maven

- name: Install graph-compose-fonts (the benchmarks render with the bundled families)
run: ./mvnw -B -ntp -f fonts/pom.xml -DskipTests install

- name: Install root artifact (graph-compose + test-jar)
run: ./mvnw -B -ntp -DskipTests install -pl .

Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ jobs:
java-version: '17'
cache: maven

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

- name: Install root artifact
run: ./mvnw -B -ntp -DskipTests install -pl .

Expand Down Expand Up @@ -202,6 +208,12 @@ jobs:
java-version: '17'
cache: maven

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

- name: Install root artifact
run: ./mvnw -B -ntp -DskipTests install -pl .

Expand Down Expand Up @@ -264,6 +276,12 @@ jobs:
benchmark-current-speed-${{ github.ref_name }}-
benchmark-current-speed-

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

- name: Install root artifact
run: ./mvnw -B -ntp -DskipTests install -pl .

Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/publish-fonts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Publish fonts to Maven Central

# Publishes the graph-compose-fonts companion artifact to Maven Central,
# independently of the engine. The bundled Google fonts change rarely, so
# they release on their OWN tag line (fonts-v*) — pushing an engine v* tag
# never touches them, and re-publishing fonts does not require an engine
# release. This mirrors publish.yml (Track D4) but targets fonts/pom.xml.
#
# Tagging: fonts-vX.Y.Z (e.g. fonts-v1.0.0). The fonts artifact carries its
# own independent version (see fonts/pom.xml) — keep it in sync with the tag.
#
# Human prerequisites are identical to publish.yml (GPG key + Central token
# secrets). See docs/contributing/release-process.md for the runbook.

on:
push:
tags:
- 'fonts-v*'
workflow_dispatch:
inputs:
tag:
description: 'Existing fonts-v*-prefixed tag to (re-)publish'
required: true
type: string

permissions:
contents: read

jobs:
publish-fonts:
name: Publish ${{ github.ref_name }} to Maven Central
runs-on: ubuntu-latest
# Only ship plain semver tags (fonts-vX.Y.Z) to Central; pre-release
# suffixes ship nowhere from here.
if: |
github.event_name == 'workflow_dispatch' ||
(!contains(github.ref, '-rc') && !contains(github.ref, '-alpha') && !contains(github.ref, '-beta') && !contains(github.ref, '-snapshot'))
env:
JAVA_TOOL_OPTIONS: -Djava.awt.headless=true

steps:
- name: Check out repository at tag
uses: actions/checkout@v6
with:
ref: ${{ github.event.inputs.tag || github.ref }}

- name: Set up Temurin JDK 17 with Central credentials and GPG key
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '17'
cache: maven
server-id: central
server-username: CENTRAL_USERNAME
server-password: CENTRAL_TOKEN
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Publish fonts to Maven Central
# Activates the fonts module's release profile (sources + javadoc +
# gpg sign + central-publishing) and flips gpg.skip=false. Blocks
# until Sonatype's validator confirms validation.
run: ./mvnw -B -ntp -f fonts/pom.xml -P release -Dgpg.skip=false deploy
env:
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
CENTRAL_TOKEN: ${{ secrets.CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
16 changes: 15 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,27 @@ jobs:
# but failing here surfaces a clearer error.
run: ./mvnw -B -ntp clean verify -pl .

- name: Publish to Maven Central
- name: Publish engine to Maven Central
# Activates the release profile (sources + javadoc + gpg sign +
# central-publishing) and flips gpg.skip=false. The deploy
# phase invokes central-publishing-maven-plugin's upload goal
# which blocks until Sonatype's validator confirms validation.
# The release profile also disables the tests-jar execution, so
# only the main + sources + javadoc + pom artefacts are uploaded.
run: ./mvnw -B -ntp -P release -DskipTests -Dgpg.skip=false deploy
env:
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
CENTRAL_TOKEN: ${{ secrets.CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

- name: Publish bundle to Maven Central
# The graph-compose-bundle convenience aggregate pins this engine
# version + a compatible graph-compose-fonts version. It tracks the
# engine line, so it ships on the same v* tag. pom-packaged → only a
# signed .pom is uploaded; engine + fonts resolve from the local repo
# (installed by the engine deploy above and the fonts step earlier).
run: ./mvnw -B -ntp -f bundle/pom.xml -P release -DskipTests -Dgpg.skip=false deploy
env:
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
CENTRAL_TOKEN: ${{ secrets.CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,32 @@ Entries land here as they merge.
node-label settings survive the toggle, `debug(none())` reliably disables
everything — and disabled debug output stays byte-identical.

### Build & distribution

- **Bundled Google fonts moved to a separate, independently-versioned
artifact** (`io.github.demchaav:graph-compose-fonts`). **Breaking for
consumers who use the bundled families.** The ~18 MB of curated Google fonts
no longer ship inside the `graph-compose` jar, so an engine upgrade never
re-downloads them and the engine artifact drops from ~40 MB to a few MB. The
public `FontName` constants and the `DefaultFonts` catalog are unchanged
(source- and binary-compatible), and the classpath layout `fonts/google/...`
is preserved byte-for-byte. To keep the bundled fonts, add
`io.github.demchaav:graph-compose-fonts` (its own version line, starting at
`1.0.0`) to your build, or depend on the new "batteries-included"
`io.github.demchaav:graph-compose-bundle` (engine + fonts at compatible
versions). With neither on the classpath, standard-14 documents render
unchanged and requesting a bundled family fails fast with a message that
names the missing dependency. See
[docs/migration/v1.8.0-fonts.md](docs/migration/v1.8.0-fonts.md).
- **Leaner Maven Central publication.** The release build no longer attaches or
uploads the `-tests` classifier jar (it stays a local-only build aid for the
benchmarks module), and with the fonts gone the `-sources.jar` no longer
carries font binaries either. The published artifact set is now just the
engine bytecode plus the small template assets.
- **`graph-compose-fonts` releases on its own `fonts-v*` tag** via a dedicated
publish workflow, so the font set ships only when it actually changes,
independent of the engine's `v*` release cadence.

### Bug fixes

- **A stray non-drawing element no longer breaks a whole SVG icon.** A
Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,25 @@ Sits between **iText** (low-level page primitives) and **JasperReports** (XML-te
dependencies { implementation("io.github.demchaav:graph-compose:1.7.1") }
```

> **Bundled fonts (from v1.8.0).** The curated Google fonts no longer ship
> inside the engine jar — they live in an independently-versioned
> companion artifact so an engine upgrade never re-downloads ~18 MB of
> fonts. Pure-text and standard-14 documents need nothing extra; to use the
> bundled families, add:
>
> ```xml
> <dependency>
> <groupId>io.github.demchaav</groupId>
> <artifactId>graph-compose-fonts</artifactId>
> <version>1.0.0</version>
> </dependency>
> ```
>
> Prefer a single "batteries-included" coordinate? Depend on
> `io.github.demchaav:graph-compose-bundle` (same version as `graph-compose`
> above) to pull the engine + fonts together. Full details and upgrade steps:
> the [v1.8.0 fonts migration note](./docs/migration/v1.8.0-fonts.md).

> **Distribution** &mdash; Maven Central is the canonical channel from **v1.6.6** onwards
> (`io.github.demchaav:graph-compose:<version>`). Hosted Javadocs auto-publish to
> [javadoc.io/doc/io.github.demchaav/graph-compose](https://javadoc.io/doc/io.github.demchaav/graph-compose)
Expand Down
30 changes: 30 additions & 0 deletions aggregator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,38 @@
mvn -f aggregator/pom.xml versions:set -DnewVersion=X # bump all modules
</description>

<!--
Belt-and-braces: nothing aggregated here is meant to be deployed via the
reactor. The published artifacts (engine, fonts, bundle) are deployed by
their own targeted `-f <module>/pom.xml ... deploy` invocations in the
publish workflows. This skip stops an accidental aggregator `deploy` from
pushing the examples / benchmarks (which have no distributionManagement)
to anywhere. The standalone engine / fonts / bundle poms do not inherit
this and manage their own publication.
-->
<properties>
<maven.deploy.skip>true</maven.deploy.skip>
<!--
Bundled-fonts version inherited by the examples and benchmarks
modules (which render with the bundled Google families). Independent
of the engine line; bump only when the font set changes.
-->
<graphcompose.fonts.version>1.0.0</graphcompose.fonts.version>
</properties>

<!--
Reactor build order only. `../fonts` and `../bundle` are listed so a
full-reactor `install` builds them in dependency order (fonts before the
engine, which depends on fonts at test scope). They are NOT children of
this aggregator (no <parent> back-reference) and carry independent
versions, so the lockstep `versions:set` does not rewrite them: fonts is
at its own 1.0.0 line, and the bundle (== engine version) is bumped with
the engine on purpose.
-->
<modules>
<module>..</module>
<module>../fonts</module>
<module>../bundle</module>
<module>../examples</module>
<module>../benchmarks</module>
</modules>
Expand Down
12 changes: 12 additions & 0 deletions benchmarks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@
<version>${graphcompose.version}</version>
</dependency>

<!--
Bundled Google fonts, split out of the engine jar in v1.8.0. The
font-embed probes (FontEmbedProbe) and canonical benchmark fixtures
render in these families, so the harness pulls the companion
artifact explicitly at its own independent version.
-->
<dependency>
<groupId>io.github.demchaav</groupId>
<artifactId>graph-compose-fonts</artifactId>
<version>${graphcompose.fonts.version}</version>
</dependency>

<!--
graph-compose's test-only fixtures (com.demcha.mock.*) used by
CanonicalBenchmarkSupport for CV / invoice / proposal sample
Expand Down
Loading