Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
4340ea3
Allow adding OFT plugins
kaklakariada Aug 21, 2026
fdefe14
Revert integration test
kaklakariada Aug 31, 2026
c81f83a
Merge branch 'main' into allow-adding-plugins
kaklakariada Aug 31, 2026
e5108bb
Add integration test for asciidoc plugin
kaklakariada Aug 31, 2026
99c1ab8
Add workaround for missing class in OFT
kaklakariada Aug 31, 2026
cd9eb16
Code cleanup
kaklakariada Aug 31, 2026
7712b7f
Improve child first class loader
kaklakariada Aug 31, 2026
26f38eb
Code cleanup
kaklakariada Sep 3, 2026
884bcb8
Fix classpath issues with OFT
kaklakariada Sep 4, 2026
50425bf
Fix missing javadoc comment
kaklakariada Sep 5, 2026
a8b7af1
Upgrade github actions
kaklakariada Sep 5, 2026
5a093b0
Suppress sonar warnings
kaklakariada Sep 5, 2026
8f11afb
Fix sonar warnings
kaklakariada Sep 5, 2026
36819f4
Merge remote-tracking branch 'origin/main' into allow-adding-plugins
kaklakariada Sep 20, 2026
c5b8223
Fix merge errors
kaklakariada Sep 24, 2026
f97db31
Upgrade asciidoc plugin
kaklakariada Sep 25, 2026
36c41c7
Fix issue with reporter factory
kaklakariada Sep 25, 2026
fbdde3d
Merge remote-tracking branch 'origin/main' into allow-adding-plugins
kaklakariada Sep 25, 2026
1f0e866
Upgrade gradle version
kaklakariada Sep 25, 2026
f2e1dc7
Add plan to simplify plugin loading
kaklakariada Sep 26, 2026
e901d64
Merge remote-tracking branch 'origin/main' into allow-adding-plugins
kaklakariada Oct 11, 2026
261a721
Revert classloader implementation
kaklakariada Oct 11, 2026
9c07f0b
Code cleanup
kaklakariada Oct 11, 2026
07472bf
Update plugins
kaklakariada Oct 17, 2026
8b76b7d
Use new Oft plugin API
kaklakariada Oct 17, 2026
bd85867
Speedup included mvn build
kaklakariada Oct 17, 2026
9844639
Upgrade link checker action
kaklakariada Oct 17, 2026
aa5689b
Upgrade to OFT 4.11.0
kaklakariada Oct 18, 2026
c2b662f
Fix build error in gradle
kaklakariada Oct 18, 2026
f5e32d4
Prepare release
kaklakariada Oct 18, 2026
e99c8de
Fix sonar warning
kaklakariada Oct 18, 2026
863d089
Enable log output for plugins
kaklakariada Oct 18, 2026
77d2a80
Remove implementation plan
kaklakariada Oct 18, 2026
f98755d
Fix sonar finding
kaklakariada Oct 18, 2026
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: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
run: |
mkdir -p ./target
echo '{ "aliveStatusCodes": [429, 200] }' > ./target/broken_links_checker.json
- uses: tcort/github-action-markdown-link-check@e047c5b37f24ab722bbef1a27b6fab7f96bc4068 # v1.1.3
- uses: tcort/github-action-markdown-link-check@4e4c260e171095fad9a1c53696167469187b72ce # master
with:
use-quiet-mode: 'yes'
use-verbose-mode: 'yes'
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [3.5.0] - 2026-10-18

- [#77](https://github.com/itsallcode/openfasttrace-gradle/issues/77)
- Add support for OpenFastTrace plugin dependencies

## [3.4.0] - 2026-09-22

- Upgrade to OpenFastTrace [4.10.0](https://github.com/itsallcode/openfasttrace/releases/tag/4.10.0)
Expand Down
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Gradle plugin for the requirement tracing suite [OpenFastTrace](https://github.c

```groovy
plugins {
id "org.itsallcode.openfasttrace" version "3.4.0"
id "org.itsallcode.openfasttrace" version "3.5.0"
}
```

Expand Down Expand Up @@ -75,6 +75,22 @@ You can configure the following properties:
* `filteredArtifactTypes`: Use only the listed artifact types during tracing
* `filterWantedStatuses`: Import only specification items that have a status contained in the list of statuses. Possible values: `draft`, `proposed`, `approved`, `rejected`. See the [OFT user guide](https://github.com/itsallcode/openfasttrace/blob/main/doc/user_guide/user_guide.md#filtering-by-status) for details.

### Using OpenFastTrace Plugins

OpenFastTrace extension plugins can be added with the `pluginDependencies` property. The dependencies are added to the classpath used by requirement collection and tracing:

```groovy
repositories {
mavenCentral()
}

requirementTracing {
pluginDependencies = ['org.itsallcode:openfasttrace-asciidoc-plugin:1.0.0']
}
```

These are OpenFastTrace extension plugins, not Gradle build plugins. Plugin JARs must provide the appropriate OpenFastTrace service descriptors and should not include a duplicate incompatible `openfasttrace-api` dependency. Plugin discovery remains additive to OpenFastTrace's built-in plugin directory.

### 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
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ plugins {
id 'signing'
id 'com.gradle.plugin-publish' version '2.2.1'
id 'org.sonarqube' version '7.5.0.8588'
id 'io.github.ben-manes.versions' version '0.65.0'
id 'org.sonatype.gradle.plugins.scan' version '4.1.0-02'
id 'io.github.ben-manes.versions' version '0.66.0'
id 'org.sonatype.gradle.plugins.scan' version '4.1.1-01'
}

apply plugin: 'org.itsallcode.jacoco-testkit'
Expand All @@ -16,12 +16,12 @@ repositories {

apply from: 'gradle/workAroundJacocoGradleTestKitIssueOnWindows.gradle'

version = '3.4.0'
version = '3.5.0'
group = 'org.itsallcode'

ext {
gradlePluginId = 'org.itsallcode.openfasttrace'
oftVersion = '4.10.0'
oftVersion = '4.11.0'
junitVersion = '6.1.3'
if (project.hasProperty('oftSourceDir')) {
oftSourceDir = file(project.oftSourceDir)
Expand Down Expand Up @@ -90,7 +90,7 @@ task compileOft(type: Exec) {
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',
'-Dmaven.site.skip=true', '-Dmaven.javadoc.skip=true', '-Dmaven.source.skip=true', '-Dossindex.skip=true', '-Dspdx.skip=true',
'-Djava.version=' + getJavaVersion()
}

Expand Down
15 changes: 15 additions & 0 deletions example-projects/plugin-config/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
plugins {
id "base"
id 'org.itsallcode.openfasttrace'
}

repositories {
mavenCentral()
}

requirementTracing {
failBuild = true
inputDirectories = files('doc', 'src')
reportFormat = 'plain'
pluginDependencies = ['org.itsallcode:openfasttrace-asciidoc-plugin:1.0.0']
}
6 changes: 6 additions & 0 deletions example-projects/plugin-config/doc/spec.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
== AsciiDoc Spec

[.specitem, oft-sid="dsn~asciidoc-exampleB~1", oft-needs="impl,test"]
=== Example AsciiDoc Requirement

Example AsciiDoc requirement
6 changes: 6 additions & 0 deletions example-projects/plugin-config/doc/spec.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# MarkDown Tracing Example
`dsn~md-exampleA~1`

Example MarkDown requirement

Needs: impl, test
1 change: 1 addition & 0 deletions example-projects/plugin-config/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rootProject.name = 'plugin-config'
5 changes: 5 additions & 0 deletions example-projects/plugin-config/src/Source.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// [impl->dsn~md-exampleA~1]
// [impl->dsn~asciidoc-exampleB~1]
class Source
{
}
5 changes: 5 additions & 0 deletions example-projects/plugin-config/src/Test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// [test->dsn~md-exampleA~1]
// [test->dsn~asciidoc-exampleB~1]
class Test
{
}
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
org.gradle.warning.mode=fail
org.gradle.configuration-cache=true
org.gradle.parallel=true
org.gradle.tooling.parallel=true

# Default values
org.gradle.caching=false
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ private static TaskProvider<CollectTask> createCollectTask(final Project rootPro
task.setGroup(TASK_GROUP_NAME);
task.setDescription("Collect requirements and generate specobject file");
task.getInputDirectories().set(getAllInputDirectories(rootProject.getAllprojects()));
task.getPluginFiles().from(
getPluginDependencies(rootProject, rootProject.getAllprojects()));
task.getOutputFile().set(
rootProject.getLayout().getBuildDirectory().file("reports/requirements.xml"));
task.getPathConfig().set(getPathConfig(rootProject.getAllprojects()));
Expand Down Expand Up @@ -109,6 +111,8 @@ private static void configureTracingTask(final Project rootProject,
task.getReportFormat().set(config.getReportFormat());
task.getImportedRequirements()
.from(getImportedRequirements(rootProject, rootProject.getAllprojects()));
task.getPluginFiles().from(
getPluginDependencies(rootProject, rootProject.getAllprojects()));
task.getFilteredArtifactTypes().set(config.getFilteredArtifactTypes());
task.getFilteredTags().set(config.getFilteredTags());
task.getFilterAcceptsItemsWithoutTag().set(config.getFilterAcceptsItemsWithoutTag());
Expand Down Expand Up @@ -173,6 +177,45 @@ private static Optional<Provider<Configuration>> getImportedRequirements(final P
return Optional.of(project.getConfigurations().named(CONFIG_NAME));
}

private static ConfigurableFileCollection getPluginDependencies(final Project rootProject,
final Set<Project> allProjects)
{
return rootProject.files(allProjects.stream()
.map(OpenFastTracePlugin::getPluginDependencies)
.flatMap(Optional::stream)
.toList());
}

private static Optional<Configuration> getPluginDependencies(final Project project)
{
final List<Object> dependencies = getConfig(project).getPluginDependencies().get();
if (dependencies.isEmpty())
{
return Optional.empty();
}
final String CONFIG_NAME = "oftPluginConfig";
return Optional.of(getOrCreateConfiguration(project, CONFIG_NAME, dependencies));
}

private static Configuration getOrCreateConfiguration(final Project project,
final String configurationName, final List<Object> dependencies)
{
final Configuration existingConfiguration = project.getConfigurations()
.findByName(configurationName);
if (existingConfiguration != null)
{
return existingConfiguration;
}

final Configuration configuration = project.getConfigurations().create(configurationName);
dependencies.forEach(dependency -> {
LOG.info("Adding dependency {} with configuration {} to project {}", dependency,
configurationName, project);
project.getDependencies().add(configurationName, dependency);
});
return configuration;
}

private static List<SerializableTagPathConfig> getPathConfig(final Set<Project> allProjects)
{
return allProjects.stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class TracingConfig
private final ConfigurableFileCollection inputDirectories;
private final RegularFileProperty reportFile;
private final ListProperty<Object> importedRequirements;
private final ListProperty<Object> pluginDependencies;
private final SetProperty<String> filteredTags;
private final SetProperty<String> filteredArtifactTypes;
private final SetProperty<String> filterWantedStatuses;
Expand All @@ -35,7 +36,7 @@ public class TracingConfig

/**
* Creates a tracing configuration with the plugin defaults.
*
*
* @param project
* the Gradle project owning the configuration
*/
Expand All @@ -49,6 +50,7 @@ public TracingConfig(final Project project)
this.reportFormat = project.getObjects().property(String.class);
this.reportFormat.set(DEFAULT_REPORT_FORMAT);
this.importedRequirements = project.getObjects().listProperty(Object.class);
this.pluginDependencies = project.getObjects().listProperty(Object.class);
this.filteredTags = project.getObjects().setProperty(String.class);
this.filteredArtifactTypes = project.getObjects().setProperty(String.class);
this.filterAcceptsItemsWithoutTag = project.getObjects().property(Boolean.class);
Expand All @@ -62,7 +64,7 @@ public TracingConfig(final Project project)

/**
* Returns the report verbosity property.
*
*
* @return the verbosity property
*/
public Property<ReportVerbosity> getReportVerbosity()
Expand Down Expand Up @@ -121,6 +123,16 @@ public ListProperty<Object> getImportedRequirements()
return importedRequirements;
}

/**
* Returns the OpenFastTrace plugin dependencies.
*
* @return the plugin dependencies
*/
public ListProperty<Object> getPluginDependencies()
{
return pluginDependencies;
}

/**
* Returns the tags to include in tracing.
*
Expand Down Expand Up @@ -301,6 +313,17 @@ public void setImportedRequirements(final List<Object> importedRequirements)
this.importedRequirements.set(importedRequirements);
}

/**
* Sets the OpenFastTrace plugin dependencies.
*
* @param pluginDependencies
* dependencies to add to the OpenFastTrace plugin classpath
*/
public void setPluginDependencies(final List<Object> pluginDependencies)
{
this.pluginDependencies.set(pluginDependencies);
}

/**
* Sets the tags to include in tracing.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.util.stream.Stream;

import org.gradle.api.DefaultTask;
import org.gradle.api.file.ConfigurableFileCollection;
import org.gradle.api.file.RegularFileProperty;
import org.gradle.api.provider.ListProperty;
import org.gradle.api.provider.SetProperty;
Expand All @@ -16,7 +17,8 @@
import org.itsallcode.openfasttrace.api.core.SpecificationItem;
import org.itsallcode.openfasttrace.api.importer.ImportSettings;
import org.itsallcode.openfasttrace.api.importer.tag.config.PathConfig;
import org.itsallcode.openfasttrace.core.*;
import org.itsallcode.openfasttrace.core.ExportSettings;
import org.itsallcode.openfasttrace.core.Oft;
import org.itsallcode.openfasttrace.gradle.task.config.SerializableTagPathConfig;

/** Gradle task that collects specification items into a specobject file. */
Expand All @@ -35,6 +37,8 @@ public class CollectTask extends DefaultTask
@SuppressWarnings({ "this-escape" })
public final ListProperty<SerializableTagPathConfig> pathConfig = getProject().getObjects()
.listProperty(SerializableTagPathConfig.class);
@SuppressWarnings("this-escape")
private final ConfigurableFileCollection pluginFiles = getProject().files();

/** Creates the task. */
public CollectTask()
Expand Down Expand Up @@ -76,13 +80,24 @@ public ListProperty<SerializableTagPathConfig> getPathConfig()
return pathConfig;
}

/**
* Returns the OpenFastTrace plugin files.
*
* @return the plugin files
*/
@InputFiles
@PathSensitive(PathSensitivity.ABSOLUTE)
public ConfigurableFileCollection getPluginFiles()
{
return pluginFiles;
}

/** Collects specification items and writes the specobject file. */
@TaskAction
public void collectRequirements()
{
createReportOutputDir();

final Oft oft = new OftRunner();
final Oft oft = OftFactory.createOft(getPluginFiles());
final ImportSettings settings = getImportSettings();
getLogger().info("Importing from {} locations {} and {} path configurations: {}",
settings.getInputs().size(), settings.getInputs(), settings.getPathConfigs().size(),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package org.itsallcode.openfasttrace.gradle.task;

import java.io.File;
import java.nio.file.Path;
import java.util.Arrays;

import org.gradle.api.file.ConfigurableFileCollection;
import org.itsallcode.openfasttrace.core.Oft;
import org.itsallcode.openfasttrace.core.OftBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

final class OftFactory
{
private static final Logger LOGGER = LoggerFactory.getLogger(OftFactory.class);

private OftFactory()
{
// prevent instantiation
}

static Oft createOft(final ConfigurableFileCollection pluginFiles)
{
final OftBuilder builder = Oft.builder();
if (!pluginFiles.isEmpty())
{
final Path[] plugins = pluginFiles.getFiles()
.stream()
.map(File::toPath)
.toArray(Path[]::new);
if (LOGGER.isInfoEnabled())
{
LOGGER.info("Using {} plugin files: {}", plugins.length, Arrays.toString(plugins));
}
builder.addPlugin("gradle-plugins", plugins);
}
return builder.build();
}
}
Loading
Loading