Skip to content

feat: add VersionFileProjectType and register in ProjectTypeFactory (#124)#320

Open
sainathchinta wants to merge 2 commits into
jenkinsci:mainfrom
sainathchinta:version-file-supportt
Open

feat: add VersionFileProjectType and register in ProjectTypeFactory (#124)#320
sainathchinta wants to merge 2 commits into
jenkinsci:mainfrom
sainathchinta:version-file-supportt

Conversation

@sainathchinta

Copy link
Copy Markdown

This pull request adds support for using a plain VERSION file as a source of truth for project version information, as requested in issue #124.

Changes

  • Added VersionFileProjectType class that implements ProjectType to read and write a simple VERSION file in the project root.
  • Registered the new project type in ProjectTypeFactory so that it is discovered during version detection.
  • If a VERSION file is present, the plugin will use its contents as the current version and will write back the calculated next version when writeVersion is enabled.

Testing done

  • Verified that the new project type is detected when a VERSION file is present and that the current version is read correctly.
  • Confirmed that the VersionFileProjectType writes the next version string back to the VERSION file.
  • Built the plugin locally to ensure the code compiles and existing tests pass.

Comments

This change allows projects without build configuration files (e.g., those not using Maven or Gradle) to specify their version via a VERSION file. See issue #124 for context.

Add a new ProjectType implementation that reads and writes a plain VERSION file. If a VERSION file exists in the project root, the plugin will use its contents as the current version and update the file with the next calculated version. This change enables projects without standard build files to specify their version in a VERSION file as requested in issue jenkinsci#124.
Register the new VersionFileProjectType in ProjectTypeFactory so that the plugin can detect and write to a VERSION file. This change allows projects without build files to specify their version in a VERSION file. Addresses issue jenkinsci#124.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant