Skip to content

fix(build): drop hand-wired assembleRequirements lifecycle - #120

Merged
jimisola merged 1 commit into
mainfrom
fix/drop-hand-wired-assemble-requirements
Sep 6, 2026
Merged

fix(build): drop hand-wired assembleRequirements lifecycle#120
jimisola merged 1 commit into
mainfrom
fix/drop-hand-wired-assemble-requirements

Conversation

@jimisola

@jimisola jimisola commented Sep 6, 2026

Copy link
Copy Markdown
Member

What & Why

This repo hand-wires assembleRequirements into the build lifecycle:

tasks.named('build') {
    finalizedBy tasks.named('assembleRequirements')
}

tasks.named('assembleRequirements') {
    dependsOn tasks.named('test')
}

The plugin does this itself, and as of 1.0.1 it wires it the other way round: build dependsOn assembleRequirements dependsOn check. This file says build finalizedBy assembleRequirements — the task runs after build — while the plugin says build needs it first. Gradle rejects the contradiction at configuration time and nothing compiles:

* What went wrong:
Circular dependency between the following tasks:
:assembleRequirements
     \--- :assembleRequirements (*)

That is the mirror image of reqstool/reqstool-java-gradle-plugin#88, which was the same collision in the opposite direction. Without this PR, the Renovate bump to 1.0.1 lands red.

Verified, both directions

Against 1.0.1 built from the plugin fix and published to mavenLocal:

current build.gradle BUILD FAILEDCircular dependency
this PR's build.gradle BUILD SUCCESSFULtest → check → assembleRequirements → build

Safe to land before the 1.0.1 bump. On the current 0.1.2 the plugin's own build finalizedBy assembleRequirements still runs the task, and build already runs test, so the removed dependsOn test was redundant there too. Confirmed with a real (not dry-run) build on 0.1.2 after removing the lines — the zip is produced intact:

reqstool-demo-0.1.0-reqstool/annotations.yml
reqstool-demo-0.1.0-reqstool/test_results/TEST-…SVCsTest.xml
reqstool-demo-0.1.0-reqstool/test_results/TEST-…DemoApplicationTestsIT.xml
reqstool-demo-0.1.0-reqstool/reqstool_config.yml
…

So this can merge now and the 1.0.1 bump will be green whenever it arrives; ordering between the two is not load-bearing.

Author checklist

  • Conventional Commit title
  • DCO sign-off
  • Verified on both the current (0.1.2) and the incoming (1.0.1) plugin
  • Artifact contents unchanged — zip still carries annotations and both test-result XMLs
  • Only build.gradle touched

Test Plan

  1. CI green on this PR (still on 0.1.2).
  2. gradle build locally: assembleRequirements runs, build/reqstool/*.zip produced with test_results/.
  3. After the 1.0.1 bump merges, gradle build configures without a circular-dependency error and orders check before assembleRequirements.

Refs: reqstool/reqstool-java-gradle-plugin#88

The plugin wires this itself, and as of 1.0.1 it wires it the other way
round: `build dependsOn assembleRequirements dependsOn check`. This file
still says `build finalizedBy assembleRequirements`, which asserts the
task runs AFTER build while the plugin asserts build needs it first.
Gradle rejects the pair at configuration time and nothing compiles --
the mirror image of reqstool/reqstool-java-gradle-plugin#88.

Verified against 1.0.1 built from that fix: with these lines the build
fails with "Circular dependency between the following tasks:
:assembleRequirements"; without them it configures and runs
test -> check -> assembleRequirements -> build.

Safe to land before the 1.0.1 bump. On the current 0.1.2 the plugin's own
`build finalizedBy assembleRequirements` still runs the task, and `build`
already runs `test`, so the removed `dependsOn test` was redundant there
too. Checked with a real build on 0.1.2: the zip is produced with both
test-result XMLs.

Refs: reqstool/reqstool-java-gradle-plugin#88
Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
@jimisola
jimisola merged commit 09d70cc into main Sep 6, 2026
10 checks passed
@jimisola
jimisola deleted the fix/drop-hand-wired-assemble-requirements branch September 6, 2026 00:57
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