diff options
Diffstat (limited to 'src/internal/SetBuildNumber')
| -rw-r--r-- | src/internal/SetBuildNumber/Directory.Packages.props.pp | 86 | ||||
| -rw-r--r-- | src/internal/SetBuildNumber/SetBuildNumber.proj | 96 | ||||
| -rw-r--r-- | src/internal/SetBuildNumber/global.json.pp | 8 |
3 files changed, 190 insertions, 0 deletions
diff --git a/src/internal/SetBuildNumber/Directory.Packages.props.pp b/src/internal/SetBuildNumber/Directory.Packages.props.pp new file mode 100644 index 00000000..1117eab7 --- /dev/null +++ b/src/internal/SetBuildNumber/Directory.Packages.props.pp | |||
| @@ -0,0 +1,86 @@ | |||
| 1 | <Project> | ||
| 2 | <PropertyGroup> | ||
| 3 | <DtfBuildSuffix>-build.1</DtfBuildSuffix> | ||
| 4 | <InternalBuildSuffix>-build.2</InternalBuildSuffix> | ||
| 5 | <LibsBuildSuffix>-build.1</LibsBuildSuffix> | ||
| 6 | <ApiBuildSuffix>-build.2</ApiBuildSuffix> | ||
| 7 | <BurnBuildSuffix>-build.2</BurnBuildSuffix> | ||
| 8 | <WixBuildSuffix>-build.3</WixBuildSuffix> | ||
| 9 | <BalBuildSuffix>-build.2</BalBuildSuffix> | ||
| 10 | <UtilBuildSuffix>-build.1</UtilBuildSuffix> | ||
| 11 | </PropertyGroup> | ||
| 12 | |||
| 13 | <ItemGroup> | ||
| 14 | <PackageVersion Include="WixToolset.Dtf.Compression" Version="{packageversion}" /> | ||
| 15 | <PackageVersion Include="WixToolset.Dtf.Compression.Cab" Version="{packageversion}" /> | ||
| 16 | <PackageVersion Include="WixToolset.Dtf.Resources" Version="{packageversion}" /> | ||
| 17 | <PackageVersion Include="WixToolset.Dtf.WindowsInstaller" Version="{packageversion}" /> | ||
| 18 | |||
| 19 | <PackageVersion Include="WixBuildTools.TestSupport" Version="{packageversion}" /> | ||
| 20 | <PackageVersion Include="WixBuildTools.TestSupport.Native" Version="{packageversion}" /> | ||
| 21 | |||
| 22 | <PackageVersion Include="WixToolset.DUtil" Version="{packageversion}" /> | ||
| 23 | <PackageVersion Include="WixToolset.WcaUtil" Version="{packageversion}" /> | ||
| 24 | |||
| 25 | <PackageVersion Include="WixToolset.BootstrapperCore.Native" Version="{packageversion}" /> | ||
| 26 | <PackageVersion Include="WixToolset.BalUtil" Version="{packageversion}" /> | ||
| 27 | <PackageVersion Include="WixToolset.BextUtil" Version="{packageversion}" /> | ||
| 28 | <PackageVersion Include="WixToolset.Mba.Core" Version="{packageversion}" /> | ||
| 29 | |||
| 30 | <PackageVersion Include="WixToolset.Data" Version="{packageversion}" /> | ||
| 31 | <PackageVersion Include="WixToolset.Extensibility" Version="{packageversion}" /> | ||
| 32 | |||
| 33 | <PackageVersion Include="WixToolset.Burn" Version="{packageversion}" /> | ||
| 34 | |||
| 35 | <PackageVersion Include="WixToolset.Core" Version="{packageversion}" /> | ||
| 36 | <PackageVersion Include="WixToolset.Core.Burn" Version="{packageversion}" /> | ||
| 37 | <PackageVersion Include="WixToolset.Core.WindowsInstaller" Version="{packageversion}" /> | ||
| 38 | <PackageVersion Include="WixToolset.Core.TestPackage" Version="{packageversion}" /> | ||
| 39 | |||
| 40 | <PackageVersion Include="WixToolset.Bal.wixext" Version="{packageversion}" /> | ||
| 41 | <PackageVersion Include="WixToolset.Dependency.wixext" Version="{packageversion}" /> | ||
| 42 | <PackageVersion Include="WixToolset.NetFx.wixext" Version="{packageversion}" /> | ||
| 43 | <PackageVersion Include="WixToolset.Util.wixext" Version="{packageversion}" /> | ||
| 44 | </ItemGroup> | ||
| 45 | |||
| 46 | <ItemGroup> | ||
| 47 | <PackageVersion Include="System.Diagnostics.PerformanceCounter" Version="4.7.0" /> | ||
| 48 | <PackageVersion Include="System.DirectoryServices" Version="4.7.0" /> | ||
| 49 | <PackageVersion Include="System.IO.FileSystem.AccessControl" Version="4.6.0" /> | ||
| 50 | <PackageVersion Include="System.IO.Compression" Version="4.3.0" /> | ||
| 51 | <PackageVersion Include="System.Reflection.Metadata" Version="1.6.0" /> | ||
| 52 | <PackageVersion Include="System.Security.Principal.Windows" Version="4.7.0" /> | ||
| 53 | <PackageVersion Include="System.Text.Encoding.CodePages" Version="4.6.0" /> | ||
| 54 | |||
| 55 | <PackageVersion Include="Microsoft.AspNetCore.Owin" Version="3.1.13" /> | ||
| 56 | <PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" /> | ||
| 57 | <PackageVersion Include="Microsoft.VisualStudio.Setup.Configuration.Native" Version="1.14.114" /> | ||
| 58 | <PackageVersion Include="Microsoft.Win32.Registry" Version="4.7.0" /> | ||
| 59 | |||
| 60 | <PackageVersion Include="NuGet.Credentials" Version="5.6.0" /> | ||
| 61 | <PackageVersion Include="NuGet.Protocol" Version="5.6.0" /> | ||
| 62 | <PackageVersion Include="NuGet.Versioning" Version="5.6.0" /> | ||
| 63 | </ItemGroup> | ||
| 64 | |||
| 65 | |||
| 66 | |||
| 67 | <ItemGroup Condition="'$(TargetFramework)'=='net461' or '$(TargetFramework)'=='net472'" > | ||
| 68 | <PackageVersion Include="Microsoft.Build.Tasks.Core" Version="14.3"/> | ||
| 69 | </ItemGroup> | ||
| 70 | |||
| 71 | <ItemGroup Condition="'$(TargetFramework)'=='netstandard2.0' or '$(TargetFramework)'=='netcoreapp3.1'"> | ||
| 72 | <PackageVersion Include="Microsoft.Build.Tasks.Core" Version="15.7.179" /> | ||
| 73 | </ItemGroup> | ||
| 74 | |||
| 75 | <ItemGroup> | ||
| 76 | <PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.0.0" /> | ||
| 77 | <PackageVersion Include="GitInfo" Version="2.1.2" /> | ||
| 78 | </ItemGroup> | ||
| 79 | |||
| 80 | <ItemGroup> | ||
| 81 | <PackageVersion Include="Microsoft.NET.Test.Sdk" Version="16.8.3" /> | ||
| 82 | <PackageVersion Include="xunit" Version="2.4.1" /> | ||
| 83 | <PackageVersion Include="xunit.runner.visualstudio" Version="2.4.1" /> | ||
| 84 | <PackageVersion Include="xunit.assert" Version="2.4.1" /> | ||
| 85 | </ItemGroup> | ||
| 86 | </Project> | ||
diff --git a/src/internal/SetBuildNumber/SetBuildNumber.proj b/src/internal/SetBuildNumber/SetBuildNumber.proj new file mode 100644 index 00000000..e0993cd3 --- /dev/null +++ b/src/internal/SetBuildNumber/SetBuildNumber.proj | |||
| @@ -0,0 +1,96 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | ||
| 3 | |||
| 4 | <Project Sdk="Microsoft.Build.NoTargets/3.0.4"> | ||
| 5 | <PropertyGroup> | ||
| 6 | <TargetFramework>netcoreapp3.1</TargetFramework> | ||
| 7 | <!-- Disable central package version management since this project will write the central package version management file --> | ||
| 8 | <ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally> | ||
| 9 | |||
| 10 | <!-- Explicitly set the restore sources because this project may run before the build\artifacts folder has been created --> | ||
| 11 | <RestoreSources>https://api.nuget.org/v3/index.json</RestoreSources> | ||
| 12 | <RestoreIgnoreFailedSources>true</RestoreIgnoreFailedSources> | ||
| 13 | </PropertyGroup> | ||
| 14 | |||
| 15 | <PropertyGroup> | ||
| 16 | <SetBuildNumbersDependsOn> | ||
| 17 | __SetPropertiesFromGit; | ||
| 18 | SetAppVeyorBuildNumber; | ||
| 19 | SetGlobalJson; | ||
| 20 | SetDirectoryPackagesProps; | ||
| 21 | </SetBuildNumbersDependsOn> | ||
| 22 | |||
| 23 | <GlobalJsonPath>$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\..\global.json))</GlobalJsonPath> | ||
| 24 | <CentralPackageVersionsPath>$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\..\Directory.Packages.props))</CentralPackageVersionsPath> | ||
| 25 | </PropertyGroup> | ||
| 26 | |||
| 27 | <Target Name="SetAppVeyorBuildNumber" | ||
| 28 | Condition=" '$(APPVEYOR)'=='True' "> | ||
| 29 | <PropertyGroup> | ||
| 30 | <AppVeyorBuildNumber>$(InformationalVersion)</AppVeyorBuildNumber> | ||
| 31 | <AppVeyorBuildNumber Condition=" 'APPVEYOR_PULL_REQUEST_NUMBER'!='' ">PR#$(APPVEYOR_PULL_REQUEST_NUMBER)-$(AppVeyorBuildNumber)</AppVeyorBuildNumber> | ||
| 32 | </PropertyGroup> | ||
| 33 | |||
| 34 | <Message Importance="high" Text=" $(AppVeyorBuildNumber)" /> | ||
| 35 | |||
| 36 | <Exec Command='appveyor UpdateBuild -Version "$(AppVeyorBuildNumber)"' /> | ||
| 37 | </Target> | ||
| 38 | |||
| 39 | |||
| 40 | <Target Name="SetGlobalJson" | ||
| 41 | Inputs="global.json.pp" | ||
| 42 | Outputs="$(GlobalJsonPath)"> | ||
| 43 | <PropertyGroup> | ||
| 44 | <GlobaJsonTextHeader>/* DO NOT MODIFY! Auto-generated from internal\SetBuildNumber\global.json.pp */</GlobaJsonTextHeader> | ||
| 45 | <GlobalJsonText>$([System.IO.File]::ReadAllText(global.json.pp))</GlobalJsonText> | ||
| 46 | <GlobalJsonText>$(GlobalJsonText.Replace('{apiversion}', $(ApiVersion)))</GlobalJsonText> | ||
| 47 | <GlobalJsonText>$(GlobalJsonText.Replace('{fileversion}', $(FileVersion)))</GlobalJsonText> | ||
| 48 | <GlobalJsonText>$(GlobalJsonText.Replace('{fullversion}', $(InformationalVersion)))</GlobalJsonText> | ||
| 49 | <GlobalJsonText>$(GlobalJsonText.Replace('{informationalversion}', $(InformationalVersion)))</GlobalJsonText> | ||
| 50 | <GlobalJsonText>$(GlobalJsonText.Replace('{height}', $(GitCommits)))</GlobalJsonText> | ||
| 51 | <GlobalJsonText>$(GlobalJsonText.Replace('{packageversion}', $(PackageVersion)))</GlobalJsonText> | ||
| 52 | <GlobalJsonText>$(GlobalJsonText.Replace('{version}', $(Version)))</GlobalJsonText> | ||
| 53 | </PropertyGroup> | ||
| 54 | |||
| 55 | <WriteLinesToFile File="$(GlobalJsonPath)" | ||
| 56 | Lines="$(GlobaJsonTextHeader);$(GlobalJsonText)" | ||
| 57 | Overwrite="true" | ||
| 58 | WriteOnlyWhenDifferent="true" /> | ||
| 59 | |||
| 60 | <Message Importance="high" Text="$(MSBuildProjectName) -> $(GlobalJsonPath)" /> | ||
| 61 | </Target> | ||
| 62 | |||
| 63 | |||
| 64 | <Target Name="SetDirectoryPackagesProps" | ||
| 65 | Inputs="Directory.Packages.props.pp" | ||
| 66 | Outputs="$(CentralPackageVersionsPath)"> | ||
| 67 | <PropertyGroup> | ||
| 68 | <CentralPackageVersionsTextHeader><!-- DO NOT MODIFY! Auto-generated from internal\SetBuildNumber\Directory.Packages.props.pp --></CentralPackageVersionsTextHeader> | ||
| 69 | <CentralPackageVersionsText>$([System.IO.File]::ReadAllText(Directory.Packages.props.pp))</CentralPackageVersionsText> | ||
| 70 | <CentralPackageVersionsText>$(CentralPackageVersionsText.Replace('{apiversion}', $(ApiVersion)))</CentralPackageVersionsText> | ||
| 71 | <CentralPackageVersionsText>$(CentralPackageVersionsText.Replace('{fileversion}', $(FileVersion)))</CentralPackageVersionsText> | ||
| 72 | <CentralPackageVersionsText>$(CentralPackageVersionsText.Replace('{fullversion}', $(InformationalVersion)))</CentralPackageVersionsText> | ||
| 73 | <CentralPackageVersionsText>$(CentralPackageVersionsText.Replace('{informationalversion}', $(InformationalVersion)))</CentralPackageVersionsText> | ||
| 74 | <CentralPackageVersionsText>$(CentralPackageVersionsText.Replace('{height}', $(GitCommits)))</CentralPackageVersionsText> | ||
| 75 | <CentralPackageVersionsText>$(CentralPackageVersionsText.Replace('{packageversion}', $(PackageVersion)))</CentralPackageVersionsText> | ||
| 76 | <CentralPackageVersionsText>$(CentralPackageVersionsText.Replace('{version}', $(Version)))</CentralPackageVersionsText> | ||
| 77 | </PropertyGroup> | ||
| 78 | |||
| 79 | <WriteLinesToFile File="$(CentralPackageVersionsPath)" | ||
| 80 | Lines="$(CentralPackageVersionsTextHeader);$(CentralPackageVersionsText)" | ||
| 81 | Overwrite="true" | ||
| 82 | WriteOnlyWhenDifferent="true" /> | ||
| 83 | |||
| 84 | <Message Importance="high" Text="$(MSBuildProjectName) -> $(CentralPackageVersionsPath)" /> | ||
| 85 | </Target> | ||
| 86 | |||
| 87 | |||
| 88 | <Target Name="SetBuildNumbers" | ||
| 89 | DependsOnTargets="$(SetBuildNumbersDependsOn)" | ||
| 90 | BeforeTargets="AfterBuild" /> | ||
| 91 | |||
| 92 | |||
| 93 | <ItemGroup> | ||
| 94 | <PackageReference Include="GitInfo" Version="2.1.2" /> | ||
| 95 | </ItemGroup> | ||
| 96 | </Project> | ||
diff --git a/src/internal/SetBuildNumber/global.json.pp b/src/internal/SetBuildNumber/global.json.pp new file mode 100644 index 00000000..a1d6244a --- /dev/null +++ b/src/internal/SetBuildNumber/global.json.pp | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | { | ||
| 2 | "msbuild-sdks": { | ||
| 3 | "WixToolset.Sdk": "{packageversion}" | ||
| 4 | }, | ||
| 5 | "sdk": { | ||
| 6 | "allowPrerelease": false | ||
| 7 | } | ||
| 8 | } | ||
