reqstool Gradle Plugin

This Gradle plugin generates a ZIP artifact containing combined annotations and various reports for reqstool. It provides zero-configuration defaults while allowing customization when needed.

Features

  • Zero-configuration: Works out of the box with sensible defaults

  • Automatic task wiring: assembleRequirements depends on all compile tasks; build is finalized by assembleRequirements

  • Multi-source-set support: SVCs annotation files are auto-discovered from all non-main source sets

  • Maven publishing support: Automatically registers ZIP artifact for publication

  • Combines annotations: Merges requirements annotations from implementation and test code

  • Assembles ZIP artifact: Creates structured ZIP containing requirements, test results, and configuration

Quick Start

Apply the plugin

plugins {
    id 'io.github.reqstool.gradle-plugin' version '0.1.1'
}

requirementsTool {
    datasetPath = file('docs/reqstool')
}

Default behavior

The plugin automatically:

  1. Wires assembleRequirements to depend on compileJava and all non-main compileXxxJava tasks

  2. Finalizes build with assembleRequirements — no manual task configuration needed

  3. Combines annotation files from all source sets into build/reqstool/annotations.yml

  4. Creates a ZIP artifact in build/reqstool/ containing:

    • requirements.yml (from datasetPath directory)

    • software_verification_cases.yml (optional)

    • manual_verification_results.yml (optional)

    • annotations.yml (combined annotations)

    • test_results/ (XML test results matching testResults patterns)

    • reqstool_config.yml (configuration manifest)

  5. Registers the ZIP for Maven publication (if maven-publish plugin is applied)

Minimal setup

Create a dataset directory with a requirements.yml file:

my-project/
├── build.gradle
├── docs/reqstool/
│   └── requirements.yml  (mandatory)
└── src/

Run gradle build and the ZIP artifact will be created automatically.

Prerequisites

  • Gradle 9.0+

  • Java 21+

  • A requirements.yml file in the dataset directory (default: reqstool/)

License

MIT License.