Skip to content

Commit 30e33d4

Browse files
authored
fixup! 🔧Set assembly file version to match nuget version (#1583)
Fixup of #1582 Remove any semantic version suffix in the file version, it is not allowed and broke the master branch build with pre-release version.
1 parent bf9bfe1 commit 30e33d4

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

UnitsNet.NumberExtensions/UnitsNet.NumberExtensions.csproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@
1717
<PackageTags>UnitsNet Extensions NumberToExtensions NumberToUnitsExtensions NumberExtensions NumberToUnits convert conversion parse</PackageTags>
1818
</PropertyGroup>
1919

20+
<!-- Assembly and msbuild properties -->
2021
<PropertyGroup>
21-
<AssemblyVersion>6.0.0.0</AssemblyVersion> <!-- Fixed to major version, for strong naming -->
22-
<FileVersion>$(Version)</FileVersion> <!-- Will match NuGet version -->
22+
<!-- Removes any semantic version suffix after the version number and appends ".0", for example "6.0.0-pre014 => "6.0.0.0" -->
23+
<VersionNoSuffix>$([System.Text.RegularExpressions.Regex]::Match($(Version), '^[0-9.]+')).0</VersionNoSuffix>
24+
<AssemblyVersion>6.0.0.0</AssemblyVersion> <!-- Fixed to major version, for strong naming -->
25+
<FileVersion>$(VersionNoSuffix)</FileVersion> <!-- Match the NuGet version number, except any suffix in the semantic version. -->
2326
<LangVersion>latest</LangVersion>
2427
<Nullable>enable</Nullable>
2528
<RootNamespace>UnitsNet</RootNamespace>

UnitsNet.Serialization.JsonNet/UnitsNet.Serialization.JsonNet.csproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020

2121
<!-- Assembly and msbuild properties -->
2222
<PropertyGroup>
23-
<AssemblyVersion>6.0.0.0</AssemblyVersion> <!-- Fixed to major version, for strong naming -->
24-
<FileVersion>$(Version)</FileVersion> <!-- Will match NuGet version -->
23+
<!-- Removes any semantic version suffix after the version number and appends ".0", for example "6.0.0-pre014 => "6.0.0.0" -->
24+
<VersionNoSuffix>$([System.Text.RegularExpressions.Regex]::Match($(Version), '^[0-9.]+')).0</VersionNoSuffix>
25+
<AssemblyVersion>6.0.0.0</AssemblyVersion> <!-- Fixed to major version, for strong naming -->
26+
<FileVersion>$(VersionNoSuffix)</FileVersion> <!-- Match the NuGet version number, except any suffix in the semantic version. -->
2527
<LangVersion>latest</LangVersion>
2628
<Nullable>enable</Nullable>
2729
<RootNamespace>UnitsNet.Serialization.JsonNet</RootNamespace>

UnitsNet/UnitsNet.csproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020

2121
<!-- Assembly and msbuild properties -->
2222
<PropertyGroup>
23-
<AssemblyVersion>6.0.0.0</AssemblyVersion> <!-- Fixed to major version, for strong naming -->
24-
<FileVersion>$(Version)</FileVersion> <!-- Will match NuGet version -->
23+
<!-- Removes any semantic version suffix after the version number and appends ".0", for example "6.0.0-pre014 => "6.0.0.0" -->
24+
<VersionNoSuffix>$([System.Text.RegularExpressions.Regex]::Match($(Version), '^[0-9.]+')).0</VersionNoSuffix>
25+
<AssemblyVersion>6.0.0.0</AssemblyVersion> <!-- Fixed to major version, for strong naming -->
26+
<FileVersion>$(VersionNoSuffix)</FileVersion> <!-- Match the NuGet version number, except any suffix in the semantic version. -->
2527
<LangVersion>latest</LangVersion>
2628
<Nullable>enable</Nullable>
2729
<RootNamespace>UnitsNet</RootNamespace>

0 commit comments

Comments
 (0)