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
4 changes: 2 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ toc::[]
[source,gradle]
----
plugins {
id 'se.lfv.reqstool' version '1.0.0'
id 'io.github.reqstool' version '0.2.0'
}
----

Expand Down Expand Up @@ -104,7 +104,7 @@ When the `maven-publish` plugin is applied, the reqstool ZIP is automatically re
[source,gradle]
----
plugins {
id 'se.lfv.reqstool' version '1.0.0'
id 'io.github.reqstool' version '0.2.0'
id 'maven-publish'
}

Expand Down
18 changes: 11 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ plugins {
id 'com.gradle.plugin-publish' version '2.0.0'
}

group = 'se.lfv.reqstool'
version = '0.1.0'
group = 'io.github.reqstool'
version = '0.2.0'

java {
sourceCompatibility = JavaVersion.VERSION_17
Expand All @@ -19,13 +19,13 @@ repositories {
}

gradlePlugin {
website = 'https://github.com/luftfartsverket/reqstool-java-gradle-plugin'
vcsUrl = 'https://github.com/luftfartsverket/reqstool-java-gradle-plugin.git'
website = 'https://github.com/reqstool/reqstool-java-gradle-plugin'
vcsUrl = 'https://github.com/reqstool/reqstool-java-gradle-plugin.git'

plugins {
reqstoolPlugin {
id = 'se.lfv.reqstool'
implementationClass = 'se.lfv.reqstool.gradle.RequirementsToolPlugin'
id = 'io.github.reqstool'
implementationClass = 'io.github.reqstool.gradle.RequirementsToolPlugin'
displayName = 'Reqstool Gradle Plugin'
description = 'Gradle plugin for assembling and attaching reqstool ZIP artifacts'
tags.set(['reqstool', 'requirements', 'verification', 'testing'] )
Expand All @@ -49,6 +49,10 @@ dependencies {
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

javadoc {
options.addStringOption('Xdoclint:none', '-quiet')
}

test {
useJUnitPlatform()
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
// Copyright © LFV
package se.lfv.reqstool.gradle;
package io.github.reqstool.gradle;

import org.gradle.api.Project;
import org.gradle.api.file.RegularFileProperty;
import org.gradle.api.provider.ListProperty;
import org.gradle.api.provider.Property;

import java.io.File;

/**
* Extension for configuring the Reqstool Gradle Plugin. Provides zero-configuration
* defaults matching the Maven plugin behavior.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
// Copyright © LFV
package se.lfv.reqstool.gradle;
package io.github.reqstool.gradle;

import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.Task;
import org.gradle.api.artifacts.Configuration;
import org.gradle.api.publish.PublishingExtension;
import org.gradle.api.publish.maven.MavenPublication;
import org.gradle.api.tasks.TaskProvider;
Expand Down Expand Up @@ -43,7 +41,7 @@ public void apply(Project project) {
// Configure ZIP output file
String archiveBaseName = project.hasProperty("archivesBaseName")
? String.valueOf(project.property("archivesBaseName")) : project.getName();
String zipFileName = archiveBaseName + "-reqstool.zip";
String zipFileName = archiveBaseName + "-" + project.getVersion() + "-reqstool.zip";
task.getZipFile()
.set(extension.getOutputDirectory()
.map(dir -> project.getLayout()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// Copyright © LFV
package se.lfv.reqstool.gradle;
package io.github.reqstool.gradle;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
Expand Down Expand Up @@ -257,8 +256,8 @@ private void writeCombinedOutputToFile(File outputFile, JsonNode combinedOutputN
}

private void assembleZipArtifact() throws IOException {
String zipArtifactFilename = projectName.get() + "-reqstool.zip";
String topLevelDir = projectName.get() + "-reqstool";
String zipArtifactFilename = projectName.get() + "-" + projectVersion.get() + "-reqstool.zip";
String topLevelDir = projectName.get() + "-" + projectVersion.get() + "-reqstool";

File zipFileOutput = zipFile.get().getAsFile();
File outDir = zipFileOutput.getParentFile();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
// Copyright © LFV
package se.lfv.reqstool.gradle;
package io.github.reqstool.gradle;

import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.io.File;
import java.io.IOException;
import java.nio.file.Path;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import org.gradle.api.Project;
import org.gradle.testfixtures.ProjectBuilder;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;

import static org.junit.jupiter.api.Assertions.*;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;

class RequirementsToolTaskTest {

Expand All @@ -30,7 +33,7 @@ class RequirementsToolTaskTest {
void setup() {
project = ProjectBuilder.builder().withProjectDir(tempDir.toFile()).build();

task = project.getTasks().create("testTask", RequirementsToolTask.class);
task = project.getTasks().register("testTask", RequirementsToolTask.class).get();
}

@Test
Expand Down
18 changes: 9 additions & 9 deletions src/test/resources/yml/combined_annotations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@ requirement_annotations:
implementations:
REQ_001:
- elementKind: "CLASS"
fullyQualifiedName: "se.lfv.reqstool.annotations.RequirementsExample"
fullyQualifiedName: "io.github.reqstool.annotations.RequirementsExample"
REQ_002:
- elementKind: "CLASS"
fullyQualifiedName: "se.lfv.reqstool.annotations.RequirementsExample"
fullyQualifiedName: "io.github.reqstool.annotations.RequirementsExample"
REQ_003:
- elementKind: "CLASS"
fullyQualifiedName: "se.lfv.reqstool.annotations.RequirementsExample"
fullyQualifiedName: "io.github.reqstool.annotations.RequirementsExample"
- elementKind: "METHOD"
fullyQualifiedName: "se.lfv.reqstool.annotations.RequirementsExample.someMethod1"
fullyQualifiedName: "io.github.reqstool.annotations.RequirementsExample.someMethod1"
REQ_004:
- elementKind: "FIELD"
fullyQualifiedName: "se.lfv.reqstool.annotations.RequirementsExample.field"
fullyQualifiedName: "io.github.reqstool.annotations.RequirementsExample.field"
tests:
SVC_001:
- elementKind: "CLASS"
fullyQualifiedName: "se.lfv.reqstool.annotations.SVCsExample"
fullyQualifiedName: "io.github.reqstool.annotations.SVCsExample"
SVC_002:
- elementKind: "CLASS"
fullyQualifiedName: "se.lfv.reqstool.annotations.SVCsExample"
fullyQualifiedName: "io.github.reqstool.annotations.SVCsExample"
SVC_003:
- elementKind: "CLASS"
fullyQualifiedName: "se.lfv.reqstool.annotations.SVCsExample"
fullyQualifiedName: "io.github.reqstool.annotations.SVCsExample"
- elementKind: "METHOD"
fullyQualifiedName: "se.lfv.reqstool.annotations.SVCsExample.someMethod"
fullyQualifiedName: "io.github.reqstool.annotations.SVCsExample.someMethod"
10 changes: 5 additions & 5 deletions src/test/resources/yml/requirements_annotations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ requirement_annotations:
implementations:
REQ_001:
- elementKind: "CLASS"
fullyQualifiedName: "se.lfv.reqstool.annotations.RequirementsExample"
fullyQualifiedName: "io.github.reqstool.annotations.RequirementsExample"
REQ_002:
- elementKind: "CLASS"
fullyQualifiedName: "se.lfv.reqstool.annotations.RequirementsExample"
fullyQualifiedName: "io.github.reqstool.annotations.RequirementsExample"
REQ_003:
- elementKind: "CLASS"
fullyQualifiedName: "se.lfv.reqstool.annotations.RequirementsExample"
fullyQualifiedName: "io.github.reqstool.annotations.RequirementsExample"
- elementKind: "METHOD"
fullyQualifiedName: "se.lfv.reqstool.annotations.RequirementsExample.someMethod1"
fullyQualifiedName: "io.github.reqstool.annotations.RequirementsExample.someMethod1"
REQ_004:
- elementKind: "FIELD"
fullyQualifiedName: "se.lfv.reqstool.annotations.RequirementsExample.field"
fullyQualifiedName: "io.github.reqstool.annotations.RequirementsExample.field"
8 changes: 4 additions & 4 deletions src/test/resources/yml/svcs_annotations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ requirement_annotations:
tests:
SVC_001:
- elementKind: "CLASS"
fullyQualifiedName: "se.lfv.reqstool.annotations.SVCsExample"
fullyQualifiedName: "io.github.reqstool.annotations.SVCsExample"
SVC_002:
- elementKind: "CLASS"
fullyQualifiedName: "se.lfv.reqstool.annotations.SVCsExample"
fullyQualifiedName: "io.github.reqstool.annotations.SVCsExample"
SVC_003:
- elementKind: "CLASS"
fullyQualifiedName: "se.lfv.reqstool.annotations.SVCsExample"
fullyQualifiedName: "io.github.reqstool.annotations.SVCsExample"
- elementKind: "METHOD"
fullyQualifiedName: "se.lfv.reqstool.annotations.SVCsExample.someMethod"
fullyQualifiedName: "io.github.reqstool.annotations.SVCsExample.someMethod"