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
2 changes: 2 additions & 0 deletions .github/workflows/broken_links_checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:

steps:
- uses: actions/checkout@v6
with:
persist-credentials: true
- name: Configure broken links checker
run: |
mkdir -p ./target
Expand Down
39 changes: 31 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
- uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false

- uses: actions/setup-java@v5
with:
Expand All @@ -41,17 +42,19 @@ jobs:
uses: gradle/actions/setup-gradle@v6

- name: Cache SonarQube packages
if: ${{ env.DEFAULT_JAVA == matrix.java }}
uses: actions/cache@v5
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-java-${{ matrix.java }}-sonar
restore-keys: ${{ runner.os }}-java-${{ matrix.java }}-sonar

- name: Build with Java ${{ matrix.java }}
run: ./gradlew build --info --warning-mode all -PjavaVersion=${{ matrix.java }}
env:
ORG_GRADLE_PROJECT_ossIndexUsername: ${{ secrets.OSSINDEX_USERNAME }}
ORG_GRADLE_PROJECT_ossIndexToken: ${{ secrets.OSSINDEX_TOKEN }}
- name: Build with Java ${{ matrix.java }} with configuration cache
run: ./gradlew build --warning-mode all --exclude-task ossIndexAudit -PenableConfigurationCache=true -PjavaVersion=${{ matrix.java }}

- name: Build with Java ${{ matrix.java }} without configuration cache
# Required to get jacoco test coverage reports for SonarQube, which doesn't work with configuration cache enabled, see https://github.com/gradle/gradle/issues/25979
run: ./gradlew clean build --warning-mode all --exclude-task ossIndexAudit -PenableConfigurationCache=false -PjavaVersion=${{ matrix.java }}

- name: Upload reports
uses: actions/upload-artifact@v7
Expand All @@ -62,13 +65,33 @@ jobs:

- name: Sonar analysis
if: ${{ env.DEFAULT_JAVA == matrix.java && env.SONAR_TOKEN != null }}
run: ./gradlew sonar --warning-mode all -Dsonar.token=$SONAR_TOKEN
run: ./gradlew sonar --info --warning-mode all -Dsonar.token=$SONAR_TOKEN
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

build:
needs: matrix-build
ossindex:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6
- name: Ossindex
run: ./gradlew ossIndexAudit --warning-mode all --info
env:
ORG_GRADLE_PROJECT_ossIndexUsername: ${{ secrets.OSSINDEX_USERNAME }}
ORG_GRADLE_PROJECT_ossIndexToken: ${{ secrets.OSSINDEX_TOKEN }}

build:
needs:
- matrix-build
- ossindex
runs-on: ubuntu-slim
steps:
- run: echo "Build successful"
2 changes: 2 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
persist-credentials: false

- uses: actions/setup-java@v5
with:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: true

- name: Fail if not running on main branch
if: ${{ github.ref != 'refs/heads/main' }}
uses: actions/github-script@v8
uses: actions/github-script@v9
with:
script: |
core.setFailed('Not running on main branch, github.ref is ${{ github.ref }}. Please start this workflow only on main')
Expand Down
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [3.2.0] - 2026-02-14
## [3.1.2] - 2026-05-17

- [PR #70](https://github.com/itsallcode/openfasttrace-gradle/pull/70)
- Upgrade to OpenFastTrace [4.4.0](https://github.com/itsallcode/openfasttrace/releases/tag/4.4.0)
- Upgrade integration tests to use Gradle 9.5.1 and 8.14.5
- Add workaround for https://github.com/gradle/gradle/issues/25979 to calculate test coverage

## [3.1.1] - 2026-02-14

- [PR #64](https://github.com/itsallcode/openfasttrace-gradle/pull/64)
- Upgrade to OpenFastTrace [4.2.1](https://github.com/itsallcode/openfasttrace/releases/tag/4.2.1)
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ Gradle plugin for the requirement tracing suite [OpenFastTrace](https://github.c
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=org.itsallcode%3Aopenfasttrace-gradle&metric=coverage)](https://sonarcloud.io/dashboard?id=org.itsallcode%3Aopenfasttrace-gradle)

* [Blog](https://blog.itsallcode.org/)
* [Gradle Plugin page](https://plugins.gradle.org/plugin/org.itsallcode.openfasttrace)
* [Changelog](CHANGELOG.md)
* [Contributing guide](CONTRIBUTING.md)
* [OpenFastTrace stories](https://github.com/itsallcode/openfasttrace/wiki/OFT-Stories)

## Usage

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

```groovy
Expand Down
28 changes: 19 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ plugins {
id 'java-gradle-plugin'
id 'jacoco'
id 'signing'
id 'com.gradle.plugin-publish' version '2.0.0'
id 'org.sonarqube' version '7.2.2.6593'
// Deactivate testkit jacoco plugin for now due to https://github.com/gradle/gradle/issues/25979
//id 'pl.droidsonroids.jacoco.testkit' version '1.0.12'
id 'com.github.ben-manes.versions' version '0.53.0'
id 'org.sonatype.gradle.plugins.scan' version '3.1.4'
id 'com.gradle.plugin-publish' version '2.1.1'
id 'org.sonarqube' version '7.3.0.8198'
id 'pl.droidsonroids.jacoco.testkit' version '1.0.12'
id 'com.github.ben-manes.versions' version '0.54.0'
id 'org.sonatype.gradle.plugins.scan' version '3.1.5'
}

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

apply from: 'gradle/workAroundJacocoGradleTestKitIssueOnWindows.gradle'

version = '3.1.1'
version = '3.1.2'
group = 'org.itsallcode'

ext {
gradlePluginId = 'org.itsallcode.openfasttrace'
oftVersion = '4.2.1'
junitVersion = '6.0.2'
oftVersion = '4.4.0'
junitVersion = '6.0.3'
if (project.hasProperty('oftSourceDir')) {
oftSourceDir = file(project.oftSourceDir)
useOftSources = oftSourceDir.exists()
Expand Down Expand Up @@ -129,6 +128,17 @@ testing {
implementation "org.hamcrest:hamcrest-core:3.0"
implementation "com.jparams:to-string-verifier:1.4.8"
}
targets {
all {
testTask.configure {
if (project.hasProperty('enableConfigurationCache')) {
def enableConfigurationCache = project.getProperty("enableConfigurationCache")
logger.lifecycle "Setting system property 'enableConfigurationCache' to $enableConfigurationCache for test task '${name}'"
systemProperty "enableConfigurationCache", enableConfigurationCache
}
}
}
}
}
}
}
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion gradlew

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

31 changes: 10 additions & 21 deletions gradlew.bat

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

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.itsallcode.openfasttrace.gradle.task;

import static java.util.stream.Collectors.joining;
import static java.util.stream.Collectors.toList;

import java.io.File;
import java.nio.file.Path;
Expand All @@ -20,6 +19,7 @@
import org.itsallcode.openfasttrace.core.*;
import org.itsallcode.openfasttrace.gradle.task.config.SerializableTagPathConfig;

@CacheableTask
public class CollectTask extends DefaultTask
{
// Possible 'this' escape before subclass is fully initialized
Expand All @@ -33,6 +33,7 @@ public class CollectTask extends DefaultTask
.listProperty(SerializableTagPathConfig.class);

@InputFiles
@PathSensitive(PathSensitivity.ABSOLUTE)
public SetProperty<File> getInputDirectories()
{
return inputDirectories;
Expand Down Expand Up @@ -92,13 +93,13 @@ private List<Path> getAllImportFiles()
.flatMap(SerializableTagPathConfig::getPaths);
getLogger().info("Importing from {} configured paths: {}", pathConfig.get().size(),
pathConfig.get());
return Stream.concat(inputDirPaths, inputTagPaths).collect(toList());
return Stream.concat(inputDirPaths, inputTagPaths).toList();
}

private List<PathConfig> getPathConfigInternal()
{
final List<PathConfig> paths = pathConfig.get().stream()
.flatMap(SerializableTagPathConfig::getPathConfig).collect(toList());
.flatMap(SerializableTagPathConfig::getPathConfig).toList();
if (getLogger().isInfoEnabled())
{
getLogger().info("Got {} path configurations:\n{}", paths.size(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.itsallcode.openfasttrace.core.OftRunner;

@SuppressWarnings("this-escape")
@CacheableTask
public class TraceTask extends DefaultTask
{
private final RegularFileProperty requirementsFile = getProject().getObjects().fileProperty();
Expand All @@ -41,6 +42,7 @@ public class TraceTask extends DefaultTask
private final Property<Boolean> failBuild = getProject().getObjects().property(Boolean.class);

@InputFile
@PathSensitive(PathSensitivity.ABSOLUTE)
public RegularFileProperty getRequirementsFile()
{
return requirementsFile;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public enum GradleTestConfig
* We support the latest Gradle version and the previous two. Older Gradle
* versions do not work with Java 21 and above.
*/
PREVIOUS_VERSION("8.14.4"), CURRENT_VERSION("9.3.1");
PREVIOUS_VERSION("8.14.5"), CURRENT_VERSION("9.5.1");

public final String gradleVersion;

Expand Down
Loading
Loading