Skip to content
Open
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
88 changes: 41 additions & 47 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,54 +28,48 @@ permissions:
contents: read

jobs:
lint:
uses: reqstool/.github/.github/workflows/java-lint.yml@91cd368066d5458b5d46bdf34c4d8ca483f6633f # 1.2.2
with:
build-tool: gradle

build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
reqstool-source: [pypi, main]
steps:
# Full history and tags: git-dyn-semver derives the version from git state, so a
# shallow clone would build the wrong number rather than fail.
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
fetch-depth: 0
fetch-tags: true
ref: ${{ inputs.ref || github.ref }}
- name: Set up Java
uses: actions/setup-java@v6.3.0
with:
java-version: "21.0.12+8.0.LTS"
distribution: "temurin"
- name: Build
run: ./gradlew clean build
- name: Self-apply plugin to assemble dataset zip
# True self-application (publishing to mavenLocal and re-applying the plugin
# to its own sources from a separate project) is not yet wired up for Gradle.
# As an interim measure, merge the annotation processor's own main/test output
# (already produced by `./gradlew build` above) the same way the plugin's
# combineOutput() would, so reqstool status has real, non-fabricated data.
run: |
mkdir -p build/reqstool
{
echo "# yaml-language-server: \$schema=https://raw.githubusercontent.com/reqstool/reqstool-client/main/src/reqstool/resources/schemas/v1/annotations.schema.json"
yq eval-all '. as $item ireduce ({}; . * $item )' \
build/generated/sources/annotationProcessor/java/main/resources/annotations.yml \
build/generated/sources/annotationProcessor/java/test/resources/annotations.yml | grep -v "^#"
} > build/reqstool/annotations.yml
- name: Install reqstool
uses: reqstool/.github/.github/actions/install-reqstool@6fc8d3e3d4c3fdf7a83cb7b7a274e4761486ca71 # 1.2.1
with:
reqstool-source: ${{ matrix.reqstool-source }}
- name: Validate reqstool spec completeness
# not yet available in the latest PyPI release
if: matrix.reqstool-source == 'main'
uses: reqstool/.github/.github/actions/validate-reqstool@6fc8d3e3d4c3fdf7a83cb7b7a274e4761486ca71 # 1.2.1
- name: Run reqstool status
uses: reqstool/.github/.github/actions/reqstool-status@6fc8d3e3d4c3fdf7a83cb7b7a274e4761486ca71 # 1.2.1
with:
fail-if-incomplete: "true"
needs: lint
uses: reqstool/.github/.github/workflows/java-build-gradle.yml@91cd368066d5458b5d46bdf34c4d8ca483f6633f # 1.2.2
with:
ref: ${{ inputs.ref }}
artifact-name: ${{ inputs.artifact-name || 'dist' }}
post-test-command: |
mkdir -p build/reqstool
{
echo "# yaml-language-server: \$schema=https://raw.githubusercontent.com/reqstool/reqstool-client/main/src/reqstool/resources/schemas/v1/annotations.schema.json"
yq eval-all '. as $item ireduce ({}; . * $item )' \
build/generated/sources/annotationProcessor/java/main/resources/annotations.yml \
build/generated/sources/annotationProcessor/java/test/resources/annotations.yml | grep -v "^#"
} > build/reqstool/annotations.yml

reqstool:
needs: build
uses: reqstool/.github/.github/workflows/common-reqstool-verify.yml@91cd368066d5458b5d46bdf34c4d8ca483f6633f # 1.2.2
with:
build-artifact: ${{ inputs.artifact-name || 'dist' }}-build

smoke:
needs: build
uses: reqstool/.github/.github/workflows/java-smoke.yml@91cd368066d5458b5d46bdf34c4d8ca483f6633f # 1.2.2
with:
command: ./gradlew --console=plain build

validate-openspec:
uses: reqstool/.github/.github/workflows/common-validate-openspec.yml@6fc8d3e3d4c3fdf7a83cb7b7a274e4761486ca71 # 1.2.1

ci:
if: ${{ always() }}
needs: [lint, build, reqstool, smoke, validate-openspec]
runs-on: ubuntu-latest
steps:
- name: Fail unless every needed job succeeded
env:
NEEDS: ${{ toJSON(needs) }}
run: |
echo "$NEEDS" | python3 -c 'import json,sys; r={k:v["result"] for k,v in json.load(sys.stdin).items()}; print(r); sys.exit(0 if all(v=="success" for v in r.values()) else 1)'
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ A Gradle plugin (`io.github.reqstool.gradle-plugin`) for
`@SVCs` annotations emitted by the reqstool annotation processor during compilation,
combines them with a dataset (`requirements.yml`, etc.) and test result XML files, and
packages everything into a `<name>-<version>-reqstool.zip` artifact that the reqstool CLI
can analyze. Requires Java 21+.
can analyze. Requires Java 25+.

See `README.md` for the user-facing configuration reference (extension properties, task
behavior, JUnit 5 parameterized test setup) and `CONTRIBUTING.md` for setup/DCO/commit
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ For DCO sign-off, commit conventions, and code review process, see the organizat

## Prerequisites

- Java 21+
- Java 25+
- Gradle 9.3+ (use the wrapper)
- [reqstool](https://github.com/reqstool/reqstool-client) (`pipx install reqstool`)
- [OpenSpec](https://github.com/Fission-AI/OpenSpec) (`npm install -g @fission-ai/openspec`)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Gradle build plugin for [reqstool](https://github.com/reqstool/reqstool-client)

## Overview

Collects `@Requirements` and `@SVCs` annotations from compiled Java code, combines them with test results, and packages everything into a ZIP artifact for analysis by the reqstool CLI. Supports Java 21+.
Collects `@Requirements` and `@SVCs` annotations from compiled Java code, combines them with test results, and packages everything into a ZIP artifact for analysis by the reqstool CLI. Supports Java 25+.

The plugin automatically wires task dependencies: `assembleRequirements` depends on `check` and on all `compileJava` tasks, and `build` depends on `assembleRequirements`. No manual task wiring is needed in most projects.

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ plugins {
group = 'io.github.reqstool'

java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
sourceCompatibility = JavaVersion.VERSION_25
targetCompatibility = JavaVersion.VERSION_25
}

repositories {
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Run `gradle build` and the ZIP artifact will be created automatically.
== Prerequisites

* Gradle 9.0+
* Java 21+
* Java 25+
* A `requirements.yml` file in the dataset directory (default: `reqstool/`)

== License
Expand Down
Loading