Skip to content

fix: svcsAnnotationsFile rename to svcsAnnotationsFiles broke backwards compatibility #52

@jimisola

Description

@jimisola

Problem

Plugin 0.1.1 (introduced in #49) renamed the extension property:

  • Before (0.1.0): svcsAnnotationsFile — a single RegularFileProperty
  • After (0.1.1): svcsAnnotationsFiles — a plural ConfigurableFileCollection

Any build.gradle that previously configured svcsAnnotationsFile now fails at configuration time with:

Could not set unknown property 'svcsAnnotationsFile' for extension 'requirementsTool'
of type io.github.reqstool.gradle.RequirementsToolExtension.

This is a hard break — the build cannot proceed at all. Users upgrading from 0.1.0 to 0.1.1 via Dependabot or other automated tooling will get a build failure with no migration path other than reading the release notes or source.

Expected behaviour

The old svcsAnnotationsFile property should still be accepted, but emit a deprecation warning and internally add the value to svcsAnnotationsFiles:

/**
 * @deprecated Use {@link #getSvcsAnnotationsFiles()} instead.
 */
@Deprecated
public void setSvcsAnnotationsFile(Object file) {
    project.getLogger().warn(
        "[reqstool] 'svcsAnnotationsFile' is deprecated and will be removed in a future release. " +
        "Use 'svcsAnnotationsFiles.from(...)' instead."
    );
    this.svcsAnnotationsFiles.from(file);
}

This makes the upgrade path:

  1. Upgrade plugin version → build still works, deprecation warning printed
  2. Migrate build.gradle at own pace: svcsAnnotationsFile = ...svcsAnnotationsFiles.from(...)
  3. Deprecation warning disappears

Suggested fix

Add a setter for the old name in RequirementsToolExtension that delegates to svcsAnnotationsFiles.from(...) and logs a WARN via the Gradle logger.

Version info

  • Plugin 0.1.0: property named svcsAnnotationsFile
  • Plugin 0.1.1: property renamed to svcsAnnotationsFiles, old name removed without deprecation period

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions