diff --git a/.claude/settings.local.json b/.claude/settings.local.json deleted file mode 100644 index efcdf4f..0000000 --- a/.claude/settings.local.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "permissions": { - "allow": [ - "Bash(git checkout:*)", - "Bash(./gradlew clean:*)", - "Bash(git add:*)", - "Bash(./gradlew publishToMavenLocal:*)", - "Bash(gradle build:*)", - "Bash(unzip:*)", - "Bash(gradle clean:*)", - "Bash(git:*)", - "Bash(GIT_SEQUENCE_EDITOR=\"/tmp/reword_all.sh\" GIT_EDITOR=\"/tmp/strip_coauthor.sh\" git:*)", - "Bash(gh pr:*)", - "Bash(gh issue:*)", - "Bash(ls:*)", - "WebFetch(domain:github.com)" - ] - } -} diff --git a/.gitignore b/.gitignore index bef95b8..afad91f 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,6 @@ bin/ ### Mac OS ### .DS_Store + +### Claude Code ### +.claude/ diff --git a/README.adoc b/README.adoc index 139bdf6..67f8c08 100644 --- a/README.adoc +++ b/README.adoc @@ -1,149 +1,9 @@ -= Reqstool Gradle Plugin -:toc: -:toc-placement!: - -image:https://img.shields.io/badge/License-MIT-blue.svg[License,link=LICENSE] - -Gradle plugin for assembling and attaching reqstool ZIP artifacts. This plugin mimics the behavior of the link:https://github.com/Luftfartsverket/reqstool-java-maven-plugin[reqstool-java-maven-plugin]. - -toc::[] - -== Features - -* *Zero-configuration*: Works out of the box with sensible defaults -* *Automatic lifecycle integration*: Runs as part of the standard `build` task -* *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 - -[source,gradle] ----- -plugins { - id 'io.github.reqstool.gradle-plugin' version '0.1.0' -} ----- - -=== Default Behavior - -The plugin automatically: - -1. Runs after the `check` task (when tests complete) -2. Combines annotation files from `build/generated-sources/` and `build/generated-test-sources/` -3. Creates a ZIP artifact in `build/reqstool/` containing: - * `requirements.yml` (from `./reqstool/` directory) - * `software_verification_cases.yml` (optional) - * `manual_verification_results.yml` (optional) - * `annotations.yml` (combined/merged annotations) - * `test_results/` (XML test results from `build/test-results/`) - * `reqstool_config.yml` (configuration manifest) -4. Registers the ZIP for Maven publication (if `maven-publish` plugin is applied) - -=== Minimal Setup - -Create a `reqstool/` directory in your project root with a `requirements.yml` file: - ----- -my-project/ -├── build.gradle -├── reqstool/ -│ └── requirements.yml (mandatory) -└── src/ ----- - -Run `gradle build` and the ZIP artifact will be created automatically. - -== Configuration - -The plugin provides zero-configuration defaults, but you can customize if needed: - -[source,gradle] ----- -requirementsTool { - // Path to requirements annotations YAML - // Default: build/generated-sources/annotations/resources/annotations.yml - requirementsAnnotationsFile = file('build/custom-path/annotations.yml') - - // Path to SVCS annotations YAML - // Default: build/generated-test-sources/test-annotations/resources/annotations.yml - svcsAnnotationsFile = file('build/custom-path/test-annotations.yml') - - // Output directory for ZIP and combined annotations - // Default: build/reqstool - outputDirectory = file('build/custom-output') - - // Dataset directory containing requirements.yml and optional files - // Default: ./reqstool - datasetPath = file('custom-reqstool-data') - - // Test result file patterns - // Default: ['build/test-results/**/*.xml'] - testResults = ['build/test-results/**/*.xml', 'build/custom-tests/**/*.xml'] - - // Skip entire plugin execution - // Default: false - skip = false - - // Skip ZIP assembly but keep annotation combining - // Default: false - skipAssembleZipArtifact = false - - // Skip artifact attachment for publishing - // Default: false - skipAttachZipArtifact = false -} ----- - -== Publishing - -When the `maven-publish` plugin is applied, the reqstool ZIP is automatically registered for publication: - -[source,gradle] ----- -plugins { - id 'io.github.reqstool.gradle-plugin' version '0.1.0' - id 'maven-publish' -} - -publishing { - repositories { - maven { - url = "https://your-repo.example.com/maven" - } - } -} ----- - -The ZIP artifact will be published with classifier `reqstool` (e.g., `my-app-1.0.0-reqstool.zip`). - -== Tasks - -=== `assembleRequirements` - -Main task that: - -* Depends on `check` task (ensures tests have run) -* Combines annotation files -* Assembles ZIP artifact -* Runs automatically as part of `build` task - -Run manually: - -[source,bash] ----- -gradle assembleRequirements ----- - -== Requirements - -* Gradle 9.0+ -* Java 17+ -* A `requirements.yml` file in the dataset directory (default: `./reqstool/`) - -== License - -MIT License - see link:LICENSE[LICENSE] file for details - +image:https://img.shields.io/github/commit-activity/m/reqstool/reqstool-java-gradle-plugin?label=commits&style=for-the-badge["Commit Activity", link="https://github.com/reqstool/reqstool-java-gradle-plugin/pulse"] +image:https://img.shields.io/github/issues/reqstool/reqstool-java-gradle-plugin?style=for-the-badge&logo=github["GitHub Issues", link="https://github.com/reqstool/reqstool-java-gradle-plugin/issues"] +image:https://img.shields.io/badge/Java-17-brightgreen.svg?style=for-the-badge["JVM support", link="https://sdkman.io"] +image:https://img.shields.io/github/license/reqstool/reqstool-java-gradle-plugin?style=for-the-badge&logo=opensourceinitiative["License", link="https://opensource.org/license/mit/"] +image:https://img.shields.io/github/actions/workflow/status/reqstool/reqstool-java-gradle-plugin/build.yml?style=for-the-badge&logo=github["Build", link="https://github.com/reqstool/reqstool-java-gradle-plugin/actions/workflows/build.yml"] +image:https://img.shields.io/badge/Documentation-blue?style=for-the-badge&link=docs["Static Badge", link="https://reqstool.github.io/reqstool-java-gradle-plugin/"] + +See: +link:https://github.com/reqstool/reqstool-java-gradle-plugin/blob/main/docs/modules/ROOT/pages/index.adoc[Documentation] diff --git a/build.gradle b/build.gradle index 78ee4a2..758511f 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ repositories { } gradlePlugin { - website = 'https://github.com/reqstool/reqstool-java-gradle-plugin' + website = 'https://reqstool.github.io' vcsUrl = 'https://github.com/reqstool/reqstool-java-gradle-plugin.git' plugins { @@ -49,10 +49,22 @@ dependencies { testRuntimeOnly 'org.junit.platform:junit-platform-launcher' } -javadoc { - options.addBooleanOption('Xdoclint:all', true) -} - test { useJUnitPlatform() } + +publishing { + publications { + withType(MavenPublication) { + pom { + developers { + developer { + name = 'Reqstool Contributors' + organization = 'reqstool' + organizationUrl = 'https://github.com/reqstool' + } + } + } + } + } +} diff --git a/src/main/java/io/github/reqstool/gradle/RequirementsToolTask.java b/src/main/java/io/github/reqstool/gradle/RequirementsToolTask.java index 8eb1488..fcfc457 100644 --- a/src/main/java/io/github/reqstool/gradle/RequirementsToolTask.java +++ b/src/main/java/io/github/reqstool/gradle/RequirementsToolTask.java @@ -84,10 +84,10 @@ public class RequirementsToolTask extends DefaultTask { public static final String XML_TESTS = "tests"; /** YAML language server schema hint for annotations files. */ - protected static final String YAML_LANG_SERVER_SCHEMA_ANNOTATIONS = "# yaml-language-server: $schema=https://raw.githubusercontent.com/Luftfartsverket/reqstool-client/main/src/reqstool/resources/schemas/v1/annotations.schema.json"; + protected static final String YAML_LANG_SERVER_SCHEMA_ANNOTATIONS = "# yaml-language-server: $schema=https://raw.githubusercontent.com/reqstool/reqstool-client/main/src/reqstool/resources/schemas/v1/annotations.schema.json"; /** YAML language server schema hint for reqstool config files. */ - protected static final String YAML_LANG_SERVER_SCHEMA_CONFIG = "# yaml-language-server: $schema=https://raw.githubusercontent.com/Luftfartsverket/reqstool-client/main/src/reqstool/resources/schemas/v1/reqstool_config.schema.json"; + protected static final String YAML_LANG_SERVER_SCHEMA_CONFIG = "# yaml-language-server: $schema=https://raw.githubusercontent.com/reqstool/reqstool-client/main/src/reqstool/resources/schemas/v1/reqstool_config.schema.json"; private static final ObjectMapper yamlMapper; diff --git a/src/test/resources/yml/requirements_annotations.yml b/src/test/resources/yml/requirements_annotations.yml index 046d120..70de55c 100644 --- a/src/test/resources/yml/requirements_annotations.yml +++ b/src/test/resources/yml/requirements_annotations.yml @@ -1,4 +1,4 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/Luftfartsverket/reqstool-client/main/src/reqstool/resources/schemas/v1/annotations.schema.json +# yaml-language-server: $schema=https://raw.githubusercontent.com/reqstool/reqstool-client/main/src/reqstool/resources/schemas/v1/annotations.schema.json --- requirement_annotations: implementations: diff --git a/src/test/resources/yml/svcs_annotations.yml b/src/test/resources/yml/svcs_annotations.yml index 5732c96..e102df6 100644 --- a/src/test/resources/yml/svcs_annotations.yml +++ b/src/test/resources/yml/svcs_annotations.yml @@ -1,4 +1,4 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/Luftfartsverket/reqstool-client/main/src/reqstool/resources/schemas/v1/annotations.schema.json +# yaml-language-server: $schema=https://raw.githubusercontent.com/reqstool/reqstool-client/main/src/reqstool/resources/schemas/v1/annotations.schema.json --- requirement_annotations: tests: