| 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> |
| 5 | <PropertyGroup> |
| 6 | <SigningToolExe>$(ToolsFolder)\sign.exe</SigningToolExe> |
| 7 | <SigningCommand>code azure-key-vault</SigningCommand> |
| 8 | <SigningConfiguration>--description "WiX Toolset" --description-url "https://wixtoolset.org/" --file-list "$(MSBuildThisFileDirectory)signing-empty-file-list.txt" --azure-key-vault-url $(SigningKeyVaultUri) --azure-key-vault-tenant-id $(SigningTenantId) --azure-key-vault-client-id $(SigningClientId) --azure-key-vault-client-secret $(SigningClientSecret) --azure-key-vault-certificate $(SigningCertName) --timestamp-url "http://timestamp.digicert.com"</SigningConfiguration> |
| 9 | </PropertyGroup> |
| 10 | |
| 11 | <PropertyGroup Condition=" '$(IsWixTestSupportProject)'=='true' "> |
| 12 | <IsTestProject>false</IsTestProject> |
| 13 | </PropertyGroup> |
| 14 | |
| 15 | <ItemGroup Condition=" '$(IsWixTestSupportProject)'=='true' "> |
| 16 | <ProjectCapability Remove="TestContainer" /> |
| 17 | </ItemGroup> |
| 18 | |
| 19 | <!-- If the git information wasn't imported yet, import the cached git information. --> |
| 20 | <Import Project="$(RootBuildFolder)SomeVerInfo.props" Condition=" '$(SomeVerInfoImported)'!='true' " /> |
| 21 | <Import Project="internal/SetBuildNumber/SomeVerInfo.targets" /> |
| 22 | |
| 23 | <PropertyGroup> |
| 24 | <RepositoryUrl Condition=" '$(RepositoryUrl)'=='' ">https://github.com/wixtoolset/wix</RepositoryUrl> |
| 25 | <RepositoryType Condition=" '$(RepositoryType)'=='' ">git</RepositoryType> |
| 26 | <RepositoryCommit Condition=" '$(RepositoryCommit)'=='' ">$(SomeVerInfoSha)</RepositoryCommit> |
| 27 | <PublishRepositoryUrl>true</PublishRepositoryUrl> |
| 28 | |
| 29 | <ProjectUrl Condition=" '$(ProjectUrl)'=='' and '$(RepositoryUrl)'!='' ">$(RepositoryUrl)</ProjectUrl> |
| 30 | </PropertyGroup> |
| 31 | |
| 32 | <PropertyGroup> |
| 33 | <GenerateNuspecDependsOn> |
| 34 | $(GenerateNuspecDependsOn); |
| 35 | __SetNuspecProperties |
| 36 | </GenerateNuspecDependsOn> |
| 37 | </PropertyGroup> |
| 38 | |
| 39 | <Target Name="__SetNuspecProperties" |
| 40 | Condition=" Exists('$(MSBuildProjectName).nuspec') "> |
| 41 | <PropertyGroup> |
| 42 | <NuspecFile Condition=" '$(NuspecFile)'=='' ">$(MSBuildProjectName).nuspec</NuspecFile> |
| 43 | <PackageId Condition=" '$(PackageId)'=='' ">$(MSBuildProjectName)</PackageId> |
| 44 | <Title Condition=" '$(Title)'=='' ">$(Description)</Title> |
| 45 | <NuspecBasePath Condition=" '$(NuspecBasePath)'=='' ">$(OutputPath)</NuspecBasePath> |
| 46 | <NuspecProperties>$(NuspecProperties);Id=$(PackageId);Version=$(PackageVersion);MajorVersion=$(SomeVerInfoMajor);NextMajorVersion=$(SomeVerInfoNextMajor);Authors=$(Authors);Configuration=$(Configuration)</NuspecProperties> |
| 47 | <NuspecProperties>$(NuspecProperties);Copyright=$(Copyright);Description=$(Description);Title=$(Title)</NuspecProperties> |
| 48 | <NuspecProperties>$(NuspecProperties);RepositoryType=$(RepositoryType);RepositoryCommit=$(RepositoryCommit);RepositoryUrl=$(RepositoryUrl)</NuspecProperties> |
| 49 | <NuspecProperties>$(NuspecProperties);ProjectUrl=$(ProjectUrl);ProjectFolder=$(MSBuildProjectDirectory)</NuspecProperties> |
| 50 | </PropertyGroup> |
| 51 | </Target> |
| 52 | |
| 53 | <Target Name="PackNative" DependsOnTargets="__SetNuspecProperties" |
| 54 | Condition=" Exists('$(MSBuildProjectName).nuspec') "> |
| 55 | |
| 56 | <Exec Command='nuget pack $(NuspecFile) -OutputDirectory "$(PackageOutputPath.Trim("\"))" -BasePath $(NuspecBasePath) -Properties "$(NuspecProperties)"' |
| 57 | WorkingDirectory="$(MSBuildProjectDirectory)" /> |
| 58 | |
| 59 | <ItemGroup> |
| 60 | <NuGetPackOutput Include="$(PackageOutputPath)\$(PackageId).$(PackageVersion).nupkg" /> |
| 61 | </ItemGroup> |
| 62 | </Target> |
| 63 | |
| 64 | <Target Name="SignOutput" AfterTargets="AfterBuild" |
| 65 | Condition=" '$(SigningCertName)'!='' and '$(SignOutput)'!='false' and |
| 66 | ('$(MSBuildProjectExtension)'=='.csproj' or ('$(MSBuildProjectExtension)'=='.vcxproj' and '$(ConfigurationType)'!='StaticLibrary'))"> |
| 67 | |
| 68 | <Message Importance="high" Text="Signing file: $(TargetPath)" /> |
| 69 | |
| 70 | <Exec Command='"$(SigningToolExe)" $(SigningCommand) $(SigningConfiguration) $(TargetPath)' |
| 71 | WorkingDirectory="$(MSBuildProjectDirectory)" EchoOff="true" /> |
| 72 | </Target> |
| 73 | |
| 74 | <Target Name="SignNupkg" AfterTargets="Pack;PackNative" |
| 75 | Condition=" '$(SigningCertName)'!='' and '@(NuGetPackOutput)'!='' and '$(SignNupkg)'!='false' "> |
| 76 | <ItemGroup> |
| 77 | <SigningNupkgs Include="@(NuGetPackOutput)" Condition=" '%(Extension)'=='.nupkg' " /> |
| 78 | </ItemGroup> |
| 79 | |
| 80 | <Message Importance="high" Text="Signing nupkg: @(SigningNupkgs->'%(Identity)')" /> |
| 81 | |
| 82 | <Exec Command='"$(SigningToolExe)" $(SigningCommand) $(SigningConfiguration) "@(SigningNupkgs->'%(Identity)')"' |
| 83 | WorkingDirectory="$(MSBuildProjectDirectory)" EchoOff="true" /> |
| 84 | </Target> |
| 85 | |
| 86 | <Target Name="SignBundleEngine" Condition=" '$(SigningCertName)'!='' and '$(SignOutput)'!='false' "> |
| 87 | <Message Importance="high" Text="Signing bundle engine: @(SignBundleEngine->'%(Identity)')" /> |
| 88 | |
| 89 | <Exec Command='"$(SigningToolExe)" $(SigningCommand) $(SigningConfiguration) "@(SignBundleEngine->'%(Identity)')"' |
| 90 | WorkingDirectory="$(MSBuildProjectDirectory)" EchoOff="true" /> |
| 91 | </Target> |
| 92 | |
| 93 | <Target Name="SignBundle" Condition=" '$(SigningCertName)'!='' and '$(SignOutput)'!='false' "> |
| 94 | <Message Importance="high" Text="Signing bundle: @(SignBundle->'%(Identity)')" /> |
| 95 | |
| 96 | <Exec Command='"$(SigningToolExe)" $(SigningCommand) $(SigningConfiguration) "@(SignBundle->'%(Identity)')"' |
| 97 | WorkingDirectory="$(MSBuildProjectDirectory)" EchoOff="true" /> |
| 98 | </Target> |
| 99 | |
| 100 | <Import Project="Directory$(MSBuildProjectExtension).targets" Condition=" Exists('Directory$(MSBuildProjectExtension).targets') " /> |
| 101 | <Import Project="Custom.Build.targets" Condition=" Exists('Custom.Build.targets') " /> |
| 102 | </Project> |