Skip to content

build: extract the PDF backend into graph-compose-render-pdf#303

Merged
DemchaAV merged 2 commits into
2.0-devfrom
build/2.0-extract-render-pdf
Jul 5, 2026
Merged

build: extract the PDF backend into graph-compose-render-pdf#303
DemchaAV merged 2 commits into
2.0-devfrom
build/2.0-extract-render-pdf

Conversation

@DemchaAV

@DemchaAV DemchaAV commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Why

2.0's lean-core goal: a consumer that doesn't render PDF shouldn't pull PDFBox. This
moves the entire PDF backend out of the engine into a new
graph-compose-render-pdf, leaving graph-compose-core with zero PDFBox. The
graph-compose wrapper depends on render-pdf, so a bare graph-compose still renders
PDF unchanged.

What

  • New graph-compose-render-pdf — the fixed-layout backend
    (document.backend.fixed.pdf.**) and the engine.render.pdf.** render tree (ecs,
    helpers, PdfFont), the two ServiceLoader provider impls + META-INF/services.
    PDFBox, zxing, and the commons-logging→SLF4J bridge leave the root pom and live here.
  • graph-compose-core keeps the DocumentSession API, the SPI seam
    (FixedLayoutBackendProvider / FontMetricsProvider), and the PDFBox-free
    pdf.options DTOs. It throws MissingBackendException (naming render-pdf) if asked
    to render/measure without a backend — a new MissingBackendContractTest guards this.
  • FontShowcase (a DSL preview builder) moves to document.showcase; the
    GraphCompose.renderAvailableFontsPreview() facade stays (javadoc now notes a
    backend is required).
  • Consumers: the wrapper gains render-pdf; render-docx / render-pptx gain it at
    test scope (their export lays out via the moved metrics provider); benchmarks at
    compile scope; examples transitively via the wrapper.
  • Tests: the render harness + backend tests → render-pdf (tests-classifier jar);
    the core-functionality render suites → qa (consumes the harness jar, gains javafx
    for the dev tool). Repo-root asset paths go through a shared RepoPaths walk-up
    helper.
  • Wired into the aggregator, CI gate, publish, cut-release, and the version guard.

Tests

  • Full reactor ./mvnw -f aggregator/pom.xml clean verifyBUILD SUCCESS, all 13
    modules, all tests, guards, and the javadoc gate. Core is PDFBox-free and builds
    standalone; the snapshot/visual suites pass from their new homes (renders
    byte-identical); a bare graph-compose renders PDF via the wrapper.

DemchaAV added 2 commits July 5, 2026 23:19
2.0's lean-core goal: a consumer that does not render PDF should not pull PDFBox.
Move the entire PDF backend out of the engine into a new graph-compose-render-pdf
module, leaving graph-compose-core with zero org.apache.pdfbox. The graph-compose
wrapper depends on render-pdf, so a bare graph-compose still renders PDF unchanged.

- New graph-compose-render-pdf: the fixed-layout PDF backend
  (document.backend.fixed.pdf.**) and the engine.render.pdf.** render tree (the ecs
  system, helpers, PdfFont), plus the two ServiceLoader provider implementations and
  their META-INF/services files. PDFBox, zxing (barcodes), and the
  commons-logging->SLF4J bridge leave the root pom and live here.
- graph-compose-core keeps the DocumentSession API, the ServiceLoader seam
  (FixedLayoutBackendProvider / FontMetricsProvider), and the PDFBox-free pdf.options
  value classes. It throws MissingBackendException (naming render-pdf) if asked to
  render, rasterize, or measure without a backend on the classpath.
- FontShowcase, a DSL-based preview builder, moves to
  com.demcha.compose.document.showcase (it cannot live in the backend-neutral font
  catalog); the GraphCompose.renderAvailableFontsPreview() facade stays.
- The wrapper depends on render-pdf; render-docx / render-pptx add it at test scope
  (their export lays out through the moved metrics provider); benchmarks add it at
  compile scope; examples get it transitively via the wrapper.
- Test relocation: the render harness and the backend's own tests move to
  render-pdf/src/test (which builds a tests-classifier jar); the core-functionality
  render suites move to graph-compose-qa (which consumes that jar and gains javafx
  for the dev-preview tool). MissingBackendContractTest guards the lean-core contract
  in core's backend-free scope.
- Wired into the aggregator, the CI build gate, publish, cut-release, and
  VersionConsistencyGuardTest.
The benchmarks module now depends on graph-compose-render-pdf (it calls buildPdf
and references the backend types), so the two benchmark CI jobs must install it
into the local repo after the core, or dependency resolution fails before compile —
the same pattern as the fonts/emoji/core install steps already there.
@DemchaAV DemchaAV merged commit e9135dd into 2.0-dev Jul 5, 2026
10 checks passed
@DemchaAV DemchaAV deleted the build/2.0-extract-render-pdf branch July 5, 2026 22:34
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