Enable commit-based package versioning
This commit is contained in:
Родитель
bf76569f15
Коммит
3323bfdf06
|
@ -6,5 +6,6 @@
|
|||
<AssemblyOriginatorKeyFile>../tools/Key.snk</AssemblyOriginatorKeyFile>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<PublicSign>true</PublicSign>
|
||||
<Version>1.0.0-alpha-$(CommitCount)</Version>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
<Project ToolsVersion="15.0">
|
||||
<Import Condition="Exists('obj/CommitCount.props')"
|
||||
Project="obj/CommitCount.props" />
|
||||
<PropertyGroup>
|
||||
<CommitCount Condition="'$(CommitCount)' == ''">0</CommitCount>
|
||||
</PropertyGroup>
|
||||
</Project>
|
23
build.proj
23
build.proj
|
@ -8,4 +8,27 @@
|
|||
<Target Name="DoPublish">
|
||||
<Exec Command="dotnet pack CommandLine/CommandLine-netcore.csproj --no-build" />
|
||||
</Target>
|
||||
|
||||
<Target Name="MakeVersionProps">
|
||||
<MakeDir Condition="!Exists('obj')"
|
||||
Directories="obj" />
|
||||
<Exec Command="git rev-list --count HEAD"
|
||||
ConsoleToMSBuild="true">
|
||||
<Output TaskParameter="ConsoleOutput" PropertyName="CommitCount" />
|
||||
</Exec>
|
||||
|
||||
<PropertyGroup>
|
||||
<GitCommitInfoPropsContent>
|
||||
<Project ToolsVersion="15.0">
|
||||
<PropertyGroup>
|
||||
<CommitCount>$(CommitCount)</CommitCount>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
</GitCommitInfoPropsContent>
|
||||
</PropertyGroup>
|
||||
|
||||
<WriteLinesToFile File="obj/CommitCount.props"
|
||||
Lines="$(GitCommitInfoPropsContent)"
|
||||
Overwrite="true" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
|
@ -24,4 +24,5 @@ Invoke-WebRequest -Uri "https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/s
|
|||
|
||||
$env:PATH="$DOTNET_INSTALL_DIR;$env:PATH"
|
||||
|
||||
& dotnet msbuild build.proj /t:MakeVersionProps
|
||||
& dotnet msbuild build.proj /v:diag /fl /flp:v=diag $ExtraParameters
|
||||
|
|
1
build.sh
1
build.sh
|
@ -40,4 +40,5 @@ curl -sSL https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/
|
|||
|
||||
PATH="$DOTNET_INSTALL_DIR:$PATH"
|
||||
|
||||
dotnet msbuild build.proj /t:MakeVersionProps
|
||||
dotnet msbuild build.proj /v:diag /fl /flp:v=diag "${args[@]}"
|
||||
|
|
Загрузка…
Ссылка в новой задаче