Skip to content
Merged
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
3 changes: 3 additions & 0 deletions .github/workflows/broken_links_checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
jobs:
linkChecker:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v4
- name: Configure broken links checker
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ on:
jobs:
matrix-build:

permissions:
contents: read

runs-on: ubuntu-latest
defaults:
run:
shell: "bash"
strategy:
matrix:
java: [11, 17, 21]
Expand All @@ -34,7 +40,7 @@ jobs:
21
cache: 'gradle'

- uses: gradle/wrapper-validation-action@v2
- uses: gradle/actions/wrapper-validation@v3

- name: Cache SonarQube packages
uses: actions/cache@v4
Expand All @@ -47,13 +53,6 @@ jobs:
run: |
./gradlew build --warning-mode=summary -PjavaVersion=${{ matrix.java }}

- name: Publish Test Report for Java ${{ matrix.java }}
uses: scacap/action-surefire-report@v1
if: ${{ always() && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' }}
with:
report_paths: '**/build/test-results/*/TEST-*.xml'
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Sonar analysis
if: ${{ env.DEFAULT_JAVA == matrix.java && env.SONAR_TOKEN != null }}
run: |
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write

strategy:
fail-fast: true
Expand All @@ -29,6 +32,8 @@ jobs:
java-version: 11
cache: 'gradle'

- uses: gradle/actions/wrapper-validation@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
Expand Down
1 change: 0 additions & 1 deletion .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.builder.annotationPath.allLocations=disabled
org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=ignore
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nonnull=javax.annotation.Nonnull
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.2.0] - unreleased

- [Issue #41](https://github.com/itsallcode/openfasttrace-gradle/issues/41)
- Upgrade to [OpenFastTrace 3.8.0](https://github.com/itsallcode/openfasttrace/releases/tag/3.8.0)
- Add support for `detailsSectionDisplay` configuration


## [1.1.0] - 2023-03-11

- [PR #35](https://github.com/itsallcode/openfasttrace-gradle/pull/35):
Expand Down
55 changes: 43 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,55 @@ Gradle plugin for the requirement tracing suite [OpenFastTrace](https://github.c

## Usage

1. Preconditions: Java 11 and Gradle 7.0
1. Preconditions: Java 11 and Gradle 8.5
1. Add plugin [`org.itsallcode.openfasttrace`](https://plugins.gradle.org/plugin/org.itsallcode.openfasttrace) to your project:

```gradle
plugins {
id "org.itsallcode.openfasttrace" version "1.1.0"
id "org.itsallcode.openfasttrace" version "1.2.0"
}
```

1. Configure your project, see [examples](https://github.com/itsallcode/openfasttrace-gradle/tree/main/example-projects)
1. Run

```bash
```sh
./gradlew traceRequirements
```

1. Report is written to `build/reports/tracing.txt` by default.

### General Configuration

```gradle
requirementTracing {
inputDirectories = files('custom-dir')
reportFile = file('build/custom-report.txt')
reportFormat = 'plain'
reportVerbosity = 'failure_details'
detailsSectionDisplay = 'collapse'
}
```

You can configure the following properties:

* `inputDirectories`: Files or directories to import
* `reportFile`: Path to the report file
* `reportFormat`: Format of the report
* `plain` - Plain Text (default)
* `html` - HTML
* `reportVerbosity`: Report verbosity
* `quiet` - no output (in case only the return code is used)
* `minimal` - display ok or not ok
* `summary` - display only the summary, not individual specification items
* `failures` - list of defect specification items
* `failure_summaries` - list of summaries for defect specification items
* `failure_details` - summaries and details for defect specification items (default)
* `all` - summaries and details for all specification items
* `detailsSectionDisplay`: Initial display status of the details section in the HTML report
* `collapse` - hide details (default)
* `expand` - show details

### Configuring the short tag importer

The short tag importer allows omitting artifact type and the covered artifact type. Optionally you can add a prefix to the item name, e.g. a common module name.
Expand Down Expand Up @@ -68,14 +99,14 @@ In bigger setups you might want to share requirements between multiple projects.

Example: The Software Architecture Design project `swad` contains overall requirements that must be fulfilled by projects `component-a` and `component-b`.

1. The `swad` project publishes its requirements as a zip file `swad-req` to a maven repository.
1. The `swad` project publishes its requirements as a zip file `swad-req` to a Maven repository.
1. Both components import these requirements and cover them in their Software Detailed Design (swdd).
1. Both components publish their requirements as artefacts `component-a-req` and `component-b-req` to the shared maven repository.
1. Both components publish their requirements as artefacts `component-a-req` and `component-b-req` to the shared Maven repository.
1. A regular job check that all requirements from `swad` are covered by tracing `swad-req`, `component-a-req` and `component-b-req`.

#### Publishing requirements to a maven repository
#### Publishing requirements to a Maven repository

If you want to publish requirements to a maven repository you can use the following configuration in your `build.gradle`:
If you want to publish requirements to a Maven repository you can use the following configuration in your `build.gradle`:

```gradle
plugins {
Expand Down Expand Up @@ -122,7 +153,7 @@ See [dependency-config](https://github.com/itsallcode/openfasttrace-gradle/tree/

## Development

```bash
```sh
git clone https://github.com/itsallcode/openfasttrace-gradle-gradle.git
./gradlew check
# Test report: build/reports/tests/index.html
Expand Down Expand Up @@ -150,19 +181,19 @@ Import into eclipse using [buildship](https://projects.eclipse.org/projects/tool

### Check if dependencies are up-to-date

```bash
```sh
./gradlew dependencyUpdates
```

### Check dependencies for vulnerabilities

```bash
```sh
./gradlew ossIndexAudit
```

### Run sonar analysis

```bash
```sh
./gradlew clean sonar --info -Dsonar.token=[token]
```

Expand All @@ -185,7 +216,7 @@ gradle.publish.secret = <secret>
1. Commit and push changes.
1. Run

```bash
```sh
./gradlew clean publishPlugins --info
```

Expand Down
33 changes: 23 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ plugins {
id 'jacoco'
id 'signing'
id 'com.gradle.plugin-publish' version '1.2.1'
id 'org.sonarqube' version '4.4.1.3373'
id 'org.sonarqube' version '5.0.0.4638'
id 'pl.droidsonroids.jacoco.testkit' version '1.0.12'
id 'com.github.ben-manes.versions' version '0.50.0'
id 'org.sonatype.gradle.plugins.scan' version '2.7.0'
id 'com.github.ben-manes.versions' version '0.51.0'
id 'org.sonatype.gradle.plugins.scan' version '2.8.1'
}

repositories {
Expand All @@ -15,13 +15,13 @@ repositories {

apply from: 'gradle/workAroundJacocoGradleTestKitIssueOnWindows.gradle'

version = '1.1.0'
version = '1.2.0'
group = 'org.itsallcode'

ext {
gradlePluginId = 'org.itsallcode.openfasttrace'
oftVersion = '3.7.1'
junitVersion = '5.10.1'
oftVersion = '3.8.0'
junitVersion = '5.10.2'
if (project.hasProperty('oftSourceDir')) {
oftSourceDir = file(project.oftSourceDir)
useOftSources = oftSourceDir.exists()
Expand Down Expand Up @@ -60,17 +60,28 @@ dependencies {
testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion"
testImplementation "org.junit.jupiter:junit-jupiter-params:$junitVersion"
testImplementation "org.hamcrest:hamcrest-core:2.2"
testImplementation "com.jparams:to-string-verifier:1.4.8"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
}

def getJavaVersion = {
return project.hasProperty('javaVersion') ? project.getProperty('javaVersion') : 11
}

java {
toolchain {
def javaVersion = project.hasProperty('javaVersion') ? project.getProperty('javaVersion') : 11
def javaVersion = getJavaVersion()
languageVersion = JavaLanguageVersion.of(javaVersion)
}
modularity.inferModulePath = false
}

tasks.withType(JavaCompile) {
options.compilerArgs << '-Xlint:all'
options.compilerArgs << '-Werror'
options.encoding = 'UTF-8'
}

javadoc {
failOnError = true
options.addBooleanOption('html5', true)
Expand All @@ -79,11 +90,13 @@ javadoc {

task compileOft(type: Exec) {
workingDir oftSourceDir
def mavenCommand = 'mvn'
if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) {
commandLine 'mvn.cmd', 'resources:resources', 'compiler:compile'
} else {
commandLine "mvn", 'resources:resources', 'compiler:compile'
mavenCommand = 'mvn.cmd'
}
commandLine mavenCommand, '-T', '1C', 'package', '-DskipTests', '-Dmaven.test.skip=true',
'-Dmaven.site.skip=true', '-Dmaven.javadoc.skip=true', '-Dmaven.source.skip=true', '-Dossindex.skip=true',
'-Djava.version=' + getJavaVersion()
}

clean {
Expand Down
1 change: 1 addition & 0 deletions example-projects/html-report/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ plugins {
requirementTracing {
inputDirectories = files('custom-dir')
reportFormat = 'html'
detailsSectionDisplay = 'EXPAND'
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
20 changes: 10 additions & 10 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading