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
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ public class RequirementsToolExtension {

private final Property<Boolean> skipAttachZipArtifact;

/**
* Constructs a RequirementsToolExtension with default configuration values.
* Initializes all properties with sensible defaults matching Maven plugin behavior.
* @param project the Gradle project
*/
public RequirementsToolExtension(Project project) {
this.requirementsAnnotationsFile = project.getObjects().fileProperty();
this.svcsAnnotationsFile = project.getObjects().fileProperty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
*/
public class RequirementsToolPlugin implements Plugin<Project> {

/**
* Default constructor for RequirementsToolPlugin.
*/
public RequirementsToolPlugin() {
}

/**
* Applies the plugin to a Gradle project. Registers the {@code assembleRequirements}
* task and automatically configures Maven publishing if the {@code maven-publish}
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/io/github/reqstool/gradle/RequirementsToolTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,26 +56,37 @@ public class RequirementsToolTask extends DefaultTask {
// Constants matching Maven plugin
private static final String[] OUTPUT_ARTIFACT_TEST_RESULTS_PATTERN = { "test_results/**/*.xml" };

/** Filename for manual verification results YAML input file. */
public static final String INPUT_FILE_MANUAL_VERIFICATION_RESULTS_YML = "manual_verification_results.yml";

/** Filename for requirements YAML input file. */
public static final String INPUT_FILE_REQUIREMENTS_YML = "requirements.yml";

/** Filename for software verification cases YAML input file. */
public static final String INPUT_FILE_SOFTWARE_VERIFICATION_CASES_YML = "software_verification_cases.yml";

/** Filename for combined annotations YAML output file. */
public static final String OUTPUT_FILE_ANNOTATIONS_YML_FILE = "annotations.yml";

/** Filename for reqstool configuration YAML file. */
public static final String OUTPUT_ARTIFACT_FILE_REQSTOOL_CONFIG_YML = "reqstool_config.yml";

/** Directory name for test results within the ZIP artifact. */
public static final String OUTPUT_ARTIFACT_DIR_TEST_RESULTS = "test_results";

/** XML element name for requirement implementations. */
public static final String XML_IMPLEMENTATIONS = "implementations";

/** XML element name for requirement annotations. */
public static final String XML_REQUIREMENT_ANNOTATIONS = "requirement_annotations";

/** XML element name for tests. */
public static final String XML_TESTS = "tests";

/** YAML language server schema hint for annotations files. */
protected static final String YAML_LANG_SERVER_SCHEMA_ANNOTATIONS = "# yaml-language-server: $schema=https://raw.githubusercontent.com/Luftfartsverket/reqstool-client/main/src/reqstool/resources/schemas/v1/annotations.schema.json";

/** YAML language server schema hint for reqstool config files. */
protected static final String YAML_LANG_SERVER_SCHEMA_CONFIG = "# yaml-language-server: $schema=https://raw.githubusercontent.com/Luftfartsverket/reqstool-client/main/src/reqstool/resources/schemas/v1/reqstool_config.schema.json";

private static final ObjectMapper yamlMapper;
Expand Down Expand Up @@ -109,6 +120,12 @@ public class RequirementsToolTask extends DefaultTask {

private final RegularFileProperty zipFile = getProject().getObjects().fileProperty();

/**
* Default constructor for RequirementsToolTask.
*/
public RequirementsToolTask() {
}

/**
* Returns the path to the requirements annotations YAML file.
* @return file property for requirements annotations
Expand Down