-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix support for cross targeting projects (#52)
SDK-style projects dispatch inner builds to resolve project references. This change updates the SlnGen target when running in cross targeting mode to dispatch the inner builds to get the project references. Fixes #50
- Loading branch information
Showing
10 changed files
with
183 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ItemGroup> | ||
<PackageReference Update="JetBrains.Annotations" Version="2018.2.1" /> | ||
<PackageReference Update="MSBuild.ProjectCreation" Version="1.2.8" /> | ||
<PackageReference Update="JetBrains.Annotations" Version="2019.1.1" /> | ||
<PackageReference Update="MSBuild.ProjectCreation" Version="1.2.11" /> | ||
<PackageReference Update="Microsoft.Build" Version="15.9.20" ExcludeAssets="Runtime" /> | ||
<PackageReference Update="Microsoft.Build.Framework" Version="15.9.20" ExcludeAssets="Runtime" /> | ||
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="15.9.0" /> | ||
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="16.0.1" /> | ||
<PackageReference Update="Shouldly" Version="3.0.2" /> | ||
<PackageReference Update="xunit" Version="2.4.1" /> | ||
<PackageReference Update="xunit.runner.visualstudio" Version="2.4.1" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<GlobalPackageReference Include="Nerdbank.GitVersioning" Version="2.3.38" /> | ||
<GlobalPackageReference Include="SlnGen" Version="2.1.5" /> | ||
<GlobalPackageReference Include="Nerdbank.GitVersioning" Version="2.3.138" /> | ||
<GlobalPackageReference Include="SlnGen" Version="2.1.7" /> | ||
<GlobalPackageReference Include="StyleCop.Analyzers" Version="1.0.2" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"msbuild-sdks": { | ||
"Microsoft.Build.CentralPackageVersions": "2.0.1" | ||
"Microsoft.Build.CentralPackageVersions": "2.0.26" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<runtime> | ||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | ||
<dependentAssembly> | ||
<assemblyIdentity name="Microsoft.Build.Framework" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/> | ||
<bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="15.1.0.0"/> | ||
</dependentAssembly> | ||
</assemblyBinding> | ||
</runtime> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(CustomAfterSlnGenTargets)" Condition="'$(CustomAfterSlnGenTargets)' != '' and Exists('$(CustomAfterSlnGenTargets)')"/> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
|
||
<Import Project="$(CustomBeforeSlnGenTargets)" Condition="'$(CustomBeforeSlnGenTargets)' != '' and Exists('$(CustomBeforeSlnGenTargets)')"/> | ||
|
||
<PropertyGroup Condition=" '$(SlnGenAssemblyFile)' == '' "> | ||
<SlnGenAssemblyFile Condition=" '$(MSBuildRuntimeType)' == '' ">$(MSBuildThisFileDirectory)net45\SlnGen.Build.Tasks.dll</SlnGenAssemblyFile> | ||
<SlnGenAssemblyFile Condition=" '$(MSBuildRuntimeType)' == 'Full' ">$(MSBuildThisFileDirectory)net46\SlnGen.Build.Tasks.dll</SlnGenAssemblyFile> | ||
<SlnGenAssemblyFile Condition=" '$(MSBuildRuntimeType)' == 'Core' ">$(MSBuildThisFileDirectory)netstandard2.0\SlnGen.Build.Tasks.dll</SlnGenAssemblyFile> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<SlnGenGlobalProperties Condition=" '$(SlnGenGlobalProperties)' != '' ">DesignTimeBuild=true;BuildingProject=false;$(SlnGenGlobalProperties)</SlnGenGlobalProperties> | ||
<SlnGenGlobalProperties Condition=" '$(SlnGenGlobalProperties)' == '' ">DesignTimeBuild=true;BuildingProject=false</SlnGenGlobalProperties> | ||
</PropertyGroup> | ||
|
||
<UsingTask TaskName="SlnGen" AssemblyFile="$(SlnGenAssemblyFile)" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,48 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="..\build\SlnGen.targets" /> | ||
|
||
<Import Project="$(MSBuildThisFileDirectory)..\build\Before.SlnGen.targets" /> | ||
|
||
<Target Name="SlnGen" | ||
DependsOnTargets="_ComputeTargetFrameworkItems" | ||
Returns="@(InnerOutput)"> | ||
|
||
<MSBuild Projects="@(_InnerBuildProjects)" | ||
Condition="'@(_InnerBuildProjects)' != '' And $(BuildingSolutionFile) != 'true'" | ||
Targets="ResolveProjectReferences" | ||
Properties="DesignTimeBuild=true" | ||
BuildInParallel="$(BuildInParallel)" | ||
SkipNonexistentTargets="true" | ||
SkipNonexistentProjects="true"> | ||
<Output ItemName="InnerOutput" TaskParameter="TargetOutputs" /> | ||
</MSBuild> | ||
|
||
<ItemGroup> | ||
<_MSBuildProjectReferenceExistent Include="%(InnerOutput.OriginalItemSpec)" Condition="Exists('%(InnerOutput.OriginalItemSpec)')" /> | ||
</ItemGroup> | ||
|
||
<PropertyGroup> | ||
<SlnGenSolutionFileFullPath Condition=" '$(SlnGenSolutionFileFullPath)' == '' And '$(BuildingSolutionFile)' == 'true' ">$(SolutionPath)</SlnGenSolutionFileFullPath> | ||
</PropertyGroup> | ||
|
||
<SlnGen | ||
BuildingSolutionFile="$(BuildingSolutionFile)" | ||
CollectStats="$([MSBuild]::ValueOrDefault('$(SlnGenCollectStats)', 'false'))" | ||
CustomProjectTypeGuids="@(SlnGenCustomProjectTypeGuid)" | ||
DevEnvFullPath="$(SlnGenDevEnvFullPath)" | ||
Folders="$([MSBuild]::ValueOrDefault('$(SlnGenFolders)', 'true'))" | ||
GlobalProperties="$(SlnGenGlobalProperties)" | ||
GlobalPropertiesToRemove="$(SlnGenGlobalPropertiesToRemove)" | ||
InheritGlobalProperties="$([MSBuild]::ValueOrDefault('$(SlnGenInheritGlobalProperties)', 'true'))" | ||
ProjectFullPath="$(MSBuildProjectFullPath)" | ||
ProjectReferences="@(_MSBuildProjectReferenceExistent)" | ||
ShouldLaunchVisualStudio="$([MSBuild]::ValueOrDefault('$(SlnGenLaunchVisualStudio)', 'true'))" | ||
SolutionFileFullPath="$(SlnGenSolutionFileFullPath)" | ||
SolutionItems="@(SlnGenSolutionItem)" | ||
ToolsVersion="$([MSBuild]::ValueOrDefault('$(SlnGenToolsVersion)', '$(MSBuildToolsVersion)'))" | ||
UseShellExecute="$([MSBuild]::ValueOrDefault('$(SlnGenUseShellExecute)', 'true'))" | ||
/> | ||
</Target> | ||
|
||
<Import Project="$(MSBuildThisFileDirectory)..\build\After.SlnGen.targets" /> | ||
</Project> |