Skip to content

Commit

Permalink
Add VersionPrefix regex to props files
Browse files Browse the repository at this point in the history
  • Loading branch information
Invvard committed Feb 28, 2024
1 parent f0f6547 commit c2e9802
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/plugins/props-plugin.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Plugin, { PluginVersionRegex, VersionPartDelimiter } from "./plugin";

const VERSION_TAG_REGEX: RegExp = /<Version>(.*)<\/Version>/i;
const VERSION_PREFIX_TAG_REGEX: RegExp = /<VersionPrefix>(.*)<\/VersionPrefix>/i;
const ASSEMBLY_VERSION_TAG_REGEX: RegExp = /<AssemblyVersion>(.*)<\/AssemblyVersion>/i;
const FILE_VERSION_TAG_REGEX: RegExp = /<FileVersion>(.*)<\/FileVersion>/i;

Expand All @@ -15,6 +16,11 @@ export default class PropsPlugin extends Plugin
versionPartDelimiter: VersionPartDelimiter.DOT,
versionType: "<Version> tag"
},
{
regex: VERSION_PREFIX_TAG_REGEX,
versionPartDelimiter: VersionPartDelimiter.DOT,
versionType: "<VersionPrefix> tag"
},
{
regex: ASSEMBLY_VERSION_TAG_REGEX,
versionPartDelimiter: VersionPartDelimiter.DOT,
Expand Down
1 change: 1 addition & 0 deletions test-files/expected-results/Test.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Project>
<PropertyGroup>
<Version>4.5.6</Version>
<VersionPrefix>4.5.6</VersionPrefix>
</PropertyGroup>
</Project>
1 change: 1 addition & 0 deletions test-files/input/Test.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Project>
<PropertyGroup>
<Version>1.2.3</Version>
<VersionPrefix>1.2.3</VersionPrefix>
</PropertyGroup>
</Project>

0 comments on commit c2e9802

Please sign in to comment.