Usage

Basic usage

Apply the plugin and set datasetPath if your dataset directory is not the default reqstool/:

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

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

Run a standard build — assembleRequirements is wired automatically:

gradle clean build

Running the task manually

gradle assembleRequirements

When invoked directly, assembleRequirements still depends on all compile tasks so annotation files are always up to date.

With Maven publishing

When the maven-publish plugin is applied, the reqstool ZIP is automatically registered for publication with classifier reqstool:

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

publishing {
    repositories {
        maven {
            url = 'https://your-repo.example.com/maven'
        }
    }
}

The artifact is published as <name>-<version>-reqstool.zip.

Task reference

assembleRequirements

Group: build

Combines requirements and SVCs annotations from all source sets into a single annotations.yml, then (unless skipAssembleZipArtifact is set) assembles a ZIP artifact at <outputDirectory>/<name>-<version>-reqstool.zip.

Auto-wired dependencies (when the java plugin is applied):

  • Depends on compileJava (main source set — generates requirementsAnnotationsFile)

  • Depends on compileXxxJava for each non-main source set (generates entries in svcsAnnotationsFiles)

  • build is finalized by assembleRequirements

These dependencies ensure annotation processors run before the task executes. No manual wiring is needed unless you override annotation file paths with setSvcsAnnotationsFiles(…​).

Default lifecycle

build
 └── (finalizedBy) assembleRequirements
                    ├── (dependsOn) compileJava
                    ├── (dependsOn) compileTestJava
                    └── (dependsOn) compileIntegrationTestJava  (if source set exists)

ZIP artifact is written to build/reqstool/<name>-<version>-reqstool.zip.