diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Directory.Build.props | 9 | ||||
| -rw-r--r-- | src/Directory.Build.targets | 48 | ||||
| -rw-r--r-- | src/WixToolset.Core.TestPackage/WixToolset.Core.TestPackage.csproj | 11 | ||||
| -rw-r--r-- | src/WixToolset.Core/WixToolset.Core.csproj | 11 | ||||
| -rw-r--r-- | src/test/Example.Extension/Example.Extension.csproj | 3 |
5 files changed, 58 insertions, 24 deletions
diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 9eacf3f5..e853e22d 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | 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. --> | 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 | <!-- | 3 | <!-- |
| 4 | Do NOT modify this file. Update the canonical version in Home\src\Directory.Build.props | 4 | Do NOT modify this file. Update the canonical version in Home\repo-template\src\Directory.Build.props |
| 5 | then update all of the repos. | 5 | then update all of the repos. |
| 6 | --> | 6 | --> |
| 7 | <Project> | 7 | <Project> |
| @@ -10,20 +10,17 @@ | |||
| 10 | <EnableSourceLink Condition=" '$(NCrunch)' == '1' ">false</EnableSourceLink> | 10 | <EnableSourceLink Condition=" '$(NCrunch)' == '1' ">false</EnableSourceLink> |
| 11 | 11 | ||
| 12 | <ProjectName Condition=" '$(ProjectName)' == '' ">$(MSBuildProjectName)</ProjectName> | 12 | <ProjectName Condition=" '$(ProjectName)' == '' ">$(MSBuildProjectName)</ProjectName> |
| 13 | <BaseOutputPath>$(MSBuildThisFileDirectory)..\build\</BaseOutputPath> | 13 | <BaseOutputPath>$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\build\))</BaseOutputPath> |
| 14 | <BaseIntermediateOutputPath>$(BaseOutputPath)obj\$(ProjectName)\</BaseIntermediateOutputPath> | 14 | <BaseIntermediateOutputPath>$(BaseOutputPath)obj\$(ProjectName)\</BaseIntermediateOutputPath> |
| 15 | <OutputPath>$(BaseOutputPath)$(Configuration)\</OutputPath> | 15 | <OutputPath>$(BaseOutputPath)$(Configuration)\</OutputPath> |
| 16 | 16 | ||
| 17 | <Authors>WiX Toolset Team</Authors> | 17 | <Authors>WiX Toolset Team</Authors> |
| 18 | <Company>WiX Toolset</Company> | 18 | <Company>WiX Toolset</Company> |
| 19 | <Copyright>Copyright (c) .NET Foundation and contributors. All rights reserved.</Copyright> | 19 | <Copyright>Copyright (c) .NET Foundation and contributors. All rights reserved.</Copyright> |
| 20 | <PackageLicenseExpression>MS-RL</PackageLicenseExpression> | ||
| 20 | <Product>WiX Toolset</Product> | 21 | <Product>WiX Toolset</Product> |
| 21 | </PropertyGroup> | 22 | </PropertyGroup> |
| 22 | 23 | ||
| 23 | <PropertyGroup> | ||
| 24 | <WixToolsetRootFolder>$(MSBuildThisFileDirectory)..\..\</WixToolsetRootFolder> | ||
| 25 | </PropertyGroup> | ||
| 26 | |||
| 27 | <Import Project="Cpp.Build.props" Condition=" '$(MSBuildProjectExtension)'=='.vcxproj' " /> | 24 | <Import Project="Cpp.Build.props" Condition=" '$(MSBuildProjectExtension)'=='.vcxproj' " /> |
| 28 | <Import Project="Custom.Build.props" Condition=" Exists('Custom.Build.props') " /> | 25 | <Import Project="Custom.Build.props" Condition=" Exists('Custom.Build.props') " /> |
| 29 | </Project> | 26 | </Project> |
diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets new file mode 100644 index 00000000..dac7452a --- /dev/null +++ b/src/Directory.Build.targets | |||
| @@ -0,0 +1,48 @@ | |||
| 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 | <ReplacePackageReferences>true</ReplacePackageReferences> | ||
| 14 | <TheSolutionPath Condition=" '$(NCrunch)'=='' ">$(SolutionPath)</TheSolutionPath> | ||
| 15 | <TheSolutionPath Condition=" '$(NCrunch)'=='1' ">$(NCrunchOriginalSolutionPath)</TheSolutionPath> | ||
| 16 | </PropertyGroup> | ||
| 17 | |||
| 18 | <Choose> | ||
| 19 | <When Condition="$(ReplacePackageReferences) AND '$(TheSolutionPath)' != '' AND '$(TheSolutionPath)' != '*undefined*' AND Exists('$(TheSolutionPath)')"> | ||
| 20 | |||
| 21 | <PropertyGroup> | ||
| 22 | <SolutionFileContent>$([System.IO.File]::ReadAllText($(TheSolutionPath)))</SolutionFileContent> | ||
| 23 | <SmartSolutionDir>$([System.IO.Path]::GetDirectoryName( $(TheSolutionPath) ))</SmartSolutionDir> | ||
| 24 | <RegexPattern>(?<="[PackageName]", ")(.*)(?=", ")</RegexPattern> | ||
| 25 | </PropertyGroup> | ||
| 26 | |||
| 27 | <ItemGroup> | ||
| 28 | <!-- Keep the identity of the PackageReference --> | ||
| 29 | <SmartPackageReference Include="@(PackageReference)"> | ||
| 30 | <PackageName>%(Identity)</PackageName> | ||
| 31 | <InSolution>$(SolutionFileContent.Contains('\%(Identity).csproj'))</InSolution> | ||
| 32 | </SmartPackageReference> | ||
| 33 | |||
| 34 | <!-- Filter them by mapping them to another ItemGroup using the WithMetadataValue item function --> | ||
| 35 | <PackageInSolution Include="@(SmartPackageReference->WithMetadataValue('InSolution', True))"> | ||
| 36 | <Pattern>$(RegexPattern.Replace('[PackageName]','%(PackageName)') )</Pattern> | ||
| 37 | <SmartPath>$([System.Text.RegularExpressions.Regex]::Match('$(SolutionFileContent)', '%(Pattern)'))</SmartPath> | ||
| 38 | </PackageInSolution> | ||
| 39 | |||
| 40 | <ProjectReference Include="@(PackageInSolution->'$(SmartSolutionDir)\%(SmartPath)' )"/> | ||
| 41 | |||
| 42 | <!-- Remove the package references that are now referenced as projects --> | ||
| 43 | <PackageReference Remove="@(PackageInSolution->'%(PackageName)' )"/> | ||
| 44 | </ItemGroup> | ||
| 45 | |||
| 46 | </When> | ||
| 47 | </Choose> | ||
| 48 | </Project> | ||
diff --git a/src/WixToolset.Core.TestPackage/WixToolset.Core.TestPackage.csproj b/src/WixToolset.Core.TestPackage/WixToolset.Core.TestPackage.csproj index 14970093..a40cea9c 100644 --- a/src/WixToolset.Core.TestPackage/WixToolset.Core.TestPackage.csproj +++ b/src/WixToolset.Core.TestPackage/WixToolset.Core.TestPackage.csproj | |||
| @@ -23,14 +23,9 @@ | |||
| 23 | </ItemGroup> | 23 | </ItemGroup> |
| 24 | 24 | ||
| 25 | <ItemGroup> | 25 | <ItemGroup> |
| 26 | <ProjectReference Include="$(WixToolsetRootFolder)\Data\src\WixToolset.Data\WixToolset.Data.csproj" Condition=" '$(Configuration)' == 'Debug' And Exists('$(WixToolsetRootFolder)\Data\README.md') " /> | 26 | <PackageReference Include="WixToolset.Data" Version="4.0.*" /> |
| 27 | <PackageReference Include="WixToolset.Data" Version="4.0.*" Condition=" '$(Configuration)' == 'Release' Or !Exists('$(WixToolsetRootFolder)\Data\README.md') " /> | 27 | <PackageReference Include="WixToolset.Extensibility" Version="4.0.*" /> |
| 28 | 28 | <PackageReference Include="WixToolset.Core.Native" Version="4.0.*" /> | |
| 29 | <ProjectReference Include="$(WixToolsetRootFolder)\Extensibility\src\WixToolset.Extensibility\WixToolset.Extensibility.csproj" Condition=" '$(Configuration)' == 'Debug' And Exists('$(WixToolsetRootFolder)\Extensibility\README.md') " /> | ||
| 30 | <PackageReference Include="WixToolset.Extensibility" Version="4.0.*" Condition=" '$(Configuration)' == 'Release' Or !Exists('$(WixToolsetRootFolder)\Extensibility\README.md') " /> | ||
| 31 | |||
| 32 | <ProjectReference Include="$(WixToolsetRootFolder)\Core.Native\src\WixToolset.Core.Native\WixToolset.Core.Native.csproj" Condition=" '$(Configuration)' == 'Debug' And Exists('$(WixToolsetRootFolder)\Core.Native\README.md') " /> | ||
| 33 | <PackageReference Include="WixToolset.Core.Native" Version="4.0.*" Condition=" '$(Configuration)' == 'Release' Or !Exists('$(WixToolsetRootFolder)\Core.Native\README.md') " /> | ||
| 34 | </ItemGroup> | 29 | </ItemGroup> |
| 35 | 30 | ||
| 36 | <ItemGroup> | 31 | <ItemGroup> |
diff --git a/src/WixToolset.Core/WixToolset.Core.csproj b/src/WixToolset.Core/WixToolset.Core.csproj index 1d884489..32a77c5a 100644 --- a/src/WixToolset.Core/WixToolset.Core.csproj +++ b/src/WixToolset.Core/WixToolset.Core.csproj | |||
| @@ -11,14 +11,9 @@ | |||
| 11 | </PropertyGroup> | 11 | </PropertyGroup> |
| 12 | 12 | ||
| 13 | <ItemGroup> | 13 | <ItemGroup> |
| 14 | <ProjectReference Include="$(WixToolsetRootFolder)\Data\src\WixToolset.Data\WixToolset.Data.csproj" Condition=" '$(Configuration)' == 'Debug' And Exists('$(WixToolsetRootFolder)\Data\README.md') " /> | 14 | <PackageReference Include="WixToolset.Data" Version="4.0.*" /> |
| 15 | <PackageReference Include="WixToolset.Data" Version="4.0.*" Condition=" '$(Configuration)' == 'Release' Or !Exists('$(WixToolsetRootFolder)\Data\README.md') " /> | 15 | <PackageReference Include="WixToolset.Extensibility" Version="4.0.*" /> |
| 16 | 16 | <PackageReference Include="WixToolset.Core.Native" Version="4.0.*" /> | |
| 17 | <ProjectReference Include="$(WixToolsetRootFolder)\Extensibility\src\WixToolset.Extensibility\WixToolset.Extensibility.csproj" Condition=" '$(Configuration)' == 'Debug' And Exists('$(WixToolsetRootFolder)\Extensibility\README.md') " /> | ||
| 18 | <PackageReference Include="WixToolset.Extensibility" Version="4.0.*" Condition=" '$(Configuration)' == 'Release' Or !Exists('$(WixToolsetRootFolder)\Extensibility\README.md') " /> | ||
| 19 | |||
| 20 | <ProjectReference Include="$(WixToolsetRootFolder)\Core.Native\src\WixToolset.Core.Native\WixToolset.Core.Native.csproj" Condition=" '$(Configuration)' == 'Debug' And Exists('$(WixToolsetRootFolder)\Core.Native\README.md') " /> | ||
| 21 | <PackageReference Include="WixToolset.Core.Native" Version="4.0.*" Condition=" '$(Configuration)' == 'Release' Or !Exists('$(WixToolsetRootFolder)\Core.Native\README.md') " /> | ||
| 22 | </ItemGroup> | 17 | </ItemGroup> |
| 23 | 18 | ||
| 24 | <ItemGroup> | 19 | <ItemGroup> |
diff --git a/src/test/Example.Extension/Example.Extension.csproj b/src/test/Example.Extension/Example.Extension.csproj index 1dde5044..32560e60 100644 --- a/src/test/Example.Extension/Example.Extension.csproj +++ b/src/test/Example.Extension/Example.Extension.csproj | |||
| @@ -13,8 +13,7 @@ | |||
| 13 | </ItemGroup> | 13 | </ItemGroup> |
| 14 | 14 | ||
| 15 | <ItemGroup> | 15 | <ItemGroup> |
| 16 | <ProjectReference Include="$(WixToolsetRootFolder)\Extensibility\src\WixToolset.Extensibility\WixToolset.Extensibility.csproj" Condition=" '$(Configuration)' == 'Debug' And Exists('$(WixToolsetRootFolder)\Extensibility\src\WixToolset.Extensibility\WixToolset.Extensibility.csproj') " /> | 16 | <PackageReference Include="WixToolset.Extensibility" Version="4.0.*" /> |
| 17 | <PackageReference Include="WixToolset.Extensibility" Version="4.0.*" Condition=" '$(Configuration)' == 'Release' Or !Exists('$(WixToolsetRootFolder)\Extensibility\src\WixToolset.Extensibility\WixToolset.Extensibility.csproj') " /> | ||
| 18 | </ItemGroup> | 17 | </ItemGroup> |
| 19 | 18 | ||
| 20 | </Project> | 19 | </Project> |
