diff options
| author | Rob Mensching <rob@firegiant.com> | 2021-05-03 15:55:48 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2021-05-03 15:55:48 -0700 |
| commit | ba7bab476501c16e437b0aee71c1be02c3dda176 (patch) | |
| tree | 814fba485c29a7dfe1adb396169e27ed641ef9a3 /src/ext/Bal/Directory.Build.targets | |
| parent | 14987a72cc1a3493ca8f80693d273352fc314bd9 (diff) | |
| download | wix-ba7bab476501c16e437b0aee71c1be02c3dda176.tar.gz wix-ba7bab476501c16e437b0aee71c1be02c3dda176.tar.bz2 wix-ba7bab476501c16e437b0aee71c1be02c3dda176.zip | |
Move Bal.wixext into ext
Diffstat (limited to 'src/ext/Bal/Directory.Build.targets')
| -rw-r--r-- | src/ext/Bal/Directory.Build.targets | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/ext/Bal/Directory.Build.targets b/src/ext/Bal/Directory.Build.targets new file mode 100644 index 00000000..cb988931 --- /dev/null +++ b/src/ext/Bal/Directory.Build.targets | |||
| @@ -0,0 +1,56 @@ | |||
| 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 | Do NOT modify this file. Update the canonical version in Home\repo-template\src\Directory.Build.targets | ||
| 5 | then update all of the repos. | ||
| 6 | --> | ||
| 7 | <!-- | ||
| 8 | Replace PackageReferences with ProjectReferences when the projects can be found in .sln. | ||
| 9 | See the original here: https://github.com/dotnet/sdk/issues/1151#issuecomment-385133284 | ||
| 10 | --> | ||
| 11 | <Project> | ||
| 12 | <PropertyGroup> | ||
| 13 | <CreateDocumentation Condition=" '$(CreateDocumentationFile)'!='true' ">false</CreateDocumentation> | ||
| 14 | <DocumentationFile Condition=" '$(CreateDocumentationFile)'=='true' ">$(OutputPath)\$(AssemblyName).xml</DocumentationFile> | ||
| 15 | </PropertyGroup> | ||
| 16 | |||
| 17 | <PropertyGroup> | ||
| 18 | <ReplacePackageReferences>true</ReplacePackageReferences> | ||
| 19 | <TheSolutionPath Condition=" '$(NCrunch)'=='' ">$(SolutionPath)</TheSolutionPath> | ||
| 20 | <TheSolutionPath Condition=" '$(NCrunch)'=='1' ">$(NCrunchOriginalSolutionPath)</TheSolutionPath> | ||
| 21 | </PropertyGroup> | ||
| 22 | |||
| 23 | <Choose> | ||
| 24 | <When Condition="$(ReplacePackageReferences) AND '$(TheSolutionPath)' != '' AND '$(TheSolutionPath)' != '*undefined*' AND Exists('$(TheSolutionPath)')"> | ||
| 25 | |||
| 26 | <PropertyGroup> | ||
| 27 | <SolutionFileContent>$([System.IO.File]::ReadAllText($(TheSolutionPath)))</SolutionFileContent> | ||
| 28 | <SmartSolutionDir>$([System.IO.Path]::GetDirectoryName( $(TheSolutionPath) ))</SmartSolutionDir> | ||
| 29 | <RegexPattern>(?<="[PackageName]", ")(.*)(?=", ")</RegexPattern> | ||
| 30 | </PropertyGroup> | ||
| 31 | |||
| 32 | <ItemGroup> | ||
| 33 | <!-- Keep the identity of the PackageReference --> | ||
| 34 | <SmartPackageReference Include="@(PackageReference)"> | ||
| 35 | <PackageName>%(Identity)</PackageName> | ||
| 36 | <InSolution>$(SolutionFileContent.Contains('\%(Identity).csproj'))</InSolution> | ||
| 37 | </SmartPackageReference> | ||
| 38 | |||
| 39 | <!-- Filter them by mapping them to another ItemGroup using the WithMetadataValue item function --> | ||
| 40 | <PackageInSolution Include="@(SmartPackageReference->WithMetadataValue('InSolution', True))"> | ||
| 41 | <Pattern>$(RegexPattern.Replace('[PackageName]','%(PackageName)') )</Pattern> | ||
| 42 | <SmartPath>$([System.Text.RegularExpressions.Regex]::Match('$(SolutionFileContent)', '%(Pattern)'))</SmartPath> | ||
| 43 | </PackageInSolution> | ||
| 44 | |||
| 45 | <ProjectReference Include="@(PackageInSolution->'$(SmartSolutionDir)\%(SmartPath)' )"/> | ||
| 46 | |||
| 47 | <!-- Remove the package references that are now referenced as projects --> | ||
| 48 | <PackageReference Remove="@(PackageInSolution->'%(PackageName)' )"/> | ||
| 49 | </ItemGroup> | ||
| 50 | |||
| 51 | </When> | ||
| 52 | </Choose> | ||
| 53 | |||
| 54 | <Import Project="Wix.Build.targets" Condition=" Exists('Wix.Build.targets') And '$(MSBuildProjectExtension)'=='.wixproj' " /> | ||
| 55 | <Import Project="Custom.Build.targets" Condition=" Exists('Custom.Build.targets') " /> | ||
| 56 | </Project> | ||
