diff --git a/README.adoc b/README.adoc index c4bef55..b38c4a5 100644 --- a/README.adoc +++ b/README.adoc @@ -23,7 +23,7 @@ toc::[] [source,gradle] ---- plugins { - id 'se.lfv.reqstool' version '1.0.0' + id 'io.github.reqstool' version '0.2.0' } ---- @@ -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' } diff --git a/build.gradle b/build.gradle index 95c3a84..d9b0e4f 100644 --- a/build.gradle +++ b/build.gradle @@ -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 @@ -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'] ) @@ -49,6 +49,10 @@ dependencies { testRuntimeOnly 'org.junit.platform:junit-platform-launcher' } +javadoc { + options.addStringOption('Xdoclint:none', '-quiet') +} + test { useJUnitPlatform() } diff --git a/src/main/java/se/lfv/reqstool/gradle/RequirementsToolExtension.java b/src/main/java/io/github/reqstool/gradle/RequirementsToolExtension.java similarity index 97% rename from src/main/java/se/lfv/reqstool/gradle/RequirementsToolExtension.java rename to src/main/java/io/github/reqstool/gradle/RequirementsToolExtension.java index 0a7783f..922152a 100644 --- a/src/main/java/se/lfv/reqstool/gradle/RequirementsToolExtension.java +++ b/src/main/java/io/github/reqstool/gradle/RequirementsToolExtension.java @@ -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. diff --git a/src/main/java/se/lfv/reqstool/gradle/RequirementsToolPlugin.java b/src/main/java/io/github/reqstool/gradle/RequirementsToolPlugin.java similarity index 95% rename from src/main/java/se/lfv/reqstool/gradle/RequirementsToolPlugin.java rename to src/main/java/io/github/reqstool/gradle/RequirementsToolPlugin.java index 260e5fd..2808ab4 100644 --- a/src/main/java/se/lfv/reqstool/gradle/RequirementsToolPlugin.java +++ b/src/main/java/io/github/reqstool/gradle/RequirementsToolPlugin.java @@ -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; @@ -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() diff --git a/src/main/java/se/lfv/reqstool/gradle/RequirementsToolTask.java b/src/main/java/io/github/reqstool/gradle/RequirementsToolTask.java similarity index 98% rename from src/main/java/se/lfv/reqstool/gradle/RequirementsToolTask.java rename to src/main/java/io/github/reqstool/gradle/RequirementsToolTask.java index a3fd644..d480d90 100644 --- a/src/main/java/se/lfv/reqstool/gradle/RequirementsToolTask.java +++ b/src/main/java/io/github/reqstool/gradle/RequirementsToolTask.java @@ -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; @@ -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(); diff --git a/src/test/java/se/lfv/reqstool/gradle/RequirementsToolTaskTest.java b/src/test/java/io/github/reqstool/gradle/RequirementsToolTaskTest.java similarity index 92% rename from src/test/java/se/lfv/reqstool/gradle/RequirementsToolTaskTest.java rename to src/test/java/io/github/reqstool/gradle/RequirementsToolTaskTest.java index 30d6a21..76ee819 100644 --- a/src/test/java/se/lfv/reqstool/gradle/RequirementsToolTaskTest.java +++ b/src/test/java/io/github/reqstool/gradle/RequirementsToolTaskTest.java @@ -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 { @@ -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 diff --git a/src/test/resources/yml/combined_annotations.yml b/src/test/resources/yml/combined_annotations.yml index 26ed176..4d6f686 100644 --- a/src/test/resources/yml/combined_annotations.yml +++ b/src/test/resources/yml/combined_annotations.yml @@ -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" diff --git a/src/test/resources/yml/requirements_annotations.yml b/src/test/resources/yml/requirements_annotations.yml index 8c250f5..046d120 100644 --- a/src/test/resources/yml/requirements_annotations.yml +++ b/src/test/resources/yml/requirements_annotations.yml @@ -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" diff --git a/src/test/resources/yml/svcs_annotations.yml b/src/test/resources/yml/svcs_annotations.yml index a953532..5732c96 100644 --- a/src/test/resources/yml/svcs_annotations.yml +++ b/src/test/resources/yml/svcs_annotations.yml @@ -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"