Skip to content

Commit fe2c0af

Browse files
authored
customize package version suffix (#248)
Co-authored-by: Beisi Zhou <[email protected]>
1 parent 7dbdf6b commit fe2c0af

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

build.proj

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
<Framework Condition="'$(Framework)' == ''">All</Framework>
66
<FileVersion Condition="'$(FileVersion)' == ''">1.0.0.0</FileVersion>
77
<PackageVersion Condition="'$(PackageVersion)' == ''">1.0.0</PackageVersion>
8-
<CommandArguments>/p:Configuration=$(Configuration) /p:FileVersion=$(FileVersion) /p:PackageVersion=$(PackageVersion) /t:$(Framework) /NoLogo</CommandArguments>
8+
<PackageVersionSuffix Condition="'$(PackageVersionSuffix)' == ''">preview</PackageVersionSuffix>
9+
<CommandArguments>/p:Configuration=$(Configuration) /p:FileVersion=$(FileVersion) /p:PackageVersion=$(PackageVersion) /p:PackageVersionSuffix=$(PackageVersionSuffix) /t:$(Framework) /NoLogo</CommandArguments>
910
</PropertyGroup>
1011

1112
<Target Name="Build">

build/pack.proj

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<Tools>$(Root)tools\</Tools>
99
<Net452PackDir>$(Artifacts)Package\$(Configuration)\net452\</Net452PackDir>
1010
<PackageVersion Condition="'$(PackageVersion)' == ''">1.0.0</PackageVersion>
11+
<PackageVersionSuffix Condition="'$(PackageVersionSuffix)' == ''">preview</PackageVersionSuffix>
1112
</PropertyGroup>
1213

1314
<Target Name="net452">
@@ -19,15 +20,15 @@
1920
<ItemGroup>
2021
<Net452Projects Include="$(Src)**\*.csproj" Exclude="$(Src)**\*.Netcore.csproj;$(Src)**\*.Tests.csproj;$(Src)**\*.Test.csproj;$(Src)**\*.UnitTest.csproj" />
2122
</ItemGroup>
22-
<Exec Command="$(NuGet) pack %(Net452Projects.FullPath) -OutputDirectory $(Net452PackDir) -Properties Configuration=$(Configuration) -Version $(PackageVersion)-preview -IncludeReferencedProjects" />
23+
<Exec Command="$(NuGet) pack %(Net452Projects.FullPath) -OutputDirectory $(Net452PackDir) -Properties Configuration=$(Configuration) -Version $(PackageVersion)-$(PackageVersionSuffix) -IncludeReferencedProjects" />
2324
</Target>
2425

2526
<Target Name="netstandard20">
2627
<Message Importance="high" Text="Pack: netstandard20 started" />
2728
<ItemGroup>
2829
<NetStandard20Projects Include="$(Src)**\*.Netcore.csproj" Exclude="$(Src)**\*.Tests.Netcore.csproj;$(Src)**\*.Test.Netcore.csproj;$(Src)**\*.UnitTest.Netcore.csproj" />
2930
</ItemGroup>
30-
<Exec Command="dotnet pack %(NetStandard20Projects.FullPath) -c $(Configuration) /p:PackageVersion=$(PackageVersion)-preview --no-build" />
31+
<Exec Command="dotnet pack %(NetStandard20Projects.FullPath) -c $(Configuration) /p:PackageVersion=$(PackageVersion)-$(PackageVersionSuffix) --no-build" />
3132
</Target>
3233

3334
<Target Name="All" DependsOnTargets="net452;netstandard20">

0 commit comments

Comments
 (0)