Skip to content

Extract code-generation layer into its own repository #363

Open

Description

@igel-devin-ai

Follow-up of the simple-codegen extraction (#347/#348/#349): move the reusable annotation-processing/code-generation layer (package root org.javahelpers.simple.codegen, SPI ClassCodeGenerator) out of simple-builders into a dedicated repository/artifact, carrying over what we already learned here (decoupled context, injected options, neutral SPI seam). simple-builders then consumes it as a normal dependency.|

Activity

  1. igel-devin-ai commented on Nov 24, 2026

    @igel-devin-ai
    ContributorAuthor

    Investigation and rough plan

    Findings (checked on main @ 3cb0776)

    • The layer is already split into 4 self-contained modules: codegen-core, simple-processor, codegen-roaster, codegen-testing.
      • groupId is already io.github.java-helpers.codegen, and the poms have no parent.
      • No codegen source references org.javahelpers.simple.builders or the core module, so the cut is clean.
    • History before codegen: extract codegen modules (codegen-core, codegen-roaster, simple-processor, codegen-testing) #368 lives under the old paths in processor/ (e.g. processor/.../classgen, processor/.../codegen/processing), and a few files came from core//annotations/.
    • Trial run with git filter-repo on a scratch clone: following the renames of all 147 current files keeps 126 of 339 commits, back to Initiale Version, with original authors and dates. git log --follow on e.g. RoasterCodeGenerator reaches JBoss Roaster migration #139 (Roaster migration).
    • Builder-side references to codegen: root pom.xml modules and Sonar paths, fork-sonar.yml, dependency-review.yml, processor/example-custom-generator dependencies, and the docs.

    Plan

    1. Create the new repo without forking. Create java-helpers/codegen (named after the groupId io.github.java-helpers.codegen) as a normal empty repo, not via "Fork", so GitHub has no fork relation and no sync-back. The new repo never gets a remote pointing to simple-builders.
    2. Carry over the history. In a fresh clone of simple-builders:
      • git filter-repo --paths-from-file with the current module dirs plus every historical path of their files, so the history from before codegen: extract codegen modules (codegen-core, codegen-roaster, simple-processor, codegen-testing) #368 is kept.
      • --replace-message rewrites #123 to java-helpers/simple-builders#123, so old PR/issue references don't link to the wrong numbers in the new repo.
      • Builder tags (v0.x) are dropped; the first codegen release gets its own tag.
      • Push as main. Commit SHAs change; that can't be avoided when splitting a repo.
    3. Make it build on its own.
      • Add a root aggregator pom: release, central-publishing, license, fmt and jacoco config taken from the builder root pom.
      • Copy the CI workflows (maven.yml, CodeQL, dependency review, Sonar/Codecov, Central release), Dependabot and SECURITY/CONTRIBUTING/LICENSE.
      • Set up a new Sonar project, Codecov, Central publishing secrets and branch protection.
    4. Move the issues with GitHub's Transfer issue (same org, keeps comments, labels and authors, and old URLs redirect).
    5. Release codegen first. Publish io.github.java-helpers.codegen:*:0.1.0 to Central.
    6. Switch simple-builders over in one PR.
      • Delete the 4 modules and depend on the released codegen version (property codegen.version).
      • Clean up the root pom, Sonar and CI paths, dependency-review.yml and the docs, and link the new repo in the README.
      • simple-builders history is not rewritten; it keeps everything up to the cut.
    7. Development across both repos: a codegen change is released (or installed locally as a SNAPSHOT), then simple-builders bumps the version. Dependabot or Renovate can propose those bumps.

    Decisions

    Still open

    • Rename simple-processor to codegen-processor with the 0.1.0 start?

    Written by Devin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions