Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Fix BuildAllConfigurations #15754

Merged
merged 18 commits into from
Feb 3, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 20 additions & 7 deletions Tools-Override/depProj.targets
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,31 @@ See the LICENSE file in the project root for more information.
<Target Name="CreateManifestResourceNames" />

<!-- Support filtering to a subset of packages -->
<Target Name="FilterNugetPackages" AfterTargets="ResolveNuGetPackages">
<Target Name="FilterNugetPackages"
AfterTargets="ResolveNuGetPackages"
Condition="'@(PackageToInclude)' != '' OR '@(PackageToExclude)' != '' OR '@(FileToInclude)' != '' OR '@(FileToExclude)' != ''">
<ItemGroup>
<_referenceCopyLocalByPackageId Include="@(ReferenceCopyLocalPaths->'%(NuGetPackageId)')">
<_nuGetDeploy Include="@($(NuGetDeploySourceItem))"/>
<_nuGetDeployByFileName Include="@(_nuGetDeploy->'%(FileName)')">
<OriginalItemSpec>%(Identity)</OriginalItemSpec>
</_referenceCopyLocalByPackageId>
</_nuGetDeployByFileName>

<_referenceCopyLocalByPackageIdToRemove Include="@(_referenceCopyLocalByPackageId)" Exclude="@(PackageToInclude)" Condition="'@(PackageToInclude)' != ''" />
<_filteredReferenceCopyLocalByPackageId Include="@(_referenceCopyLocalByPackageId)" Exclude="@(_referenceCopyLocalByPackageIdToRemove);@(PackageToExclude)" />
<_nuGetDeployByFileNameToRemove Include="@(_nuGetDeployByFileName)" Exclude="@(FileToInclude)" Condition="'@(FileToInclude)' != ''" />
<_filteredNuGetDeployByFileName Include="@(_nuGetDeployByFileName)" Exclude="@(_nuGetDeployByFileNameToRemove);@(FileToExclude)" />

<_nuGetDeployByPackageId Include="@(_filteredNuGetDeployByFileName->'%(NuGetPackageId)')" />

<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)"/>
<ReferenceCopyLocalPaths Include="@(_filteredReferenceCopyLocalByPackageId->'%(OriginalItemSpec)')" />
<_nuGetDeployByPackageIdToRemove Include="@(_nuGetDeployByPackageId)" Exclude="@(PackageToInclude)" Condition="'@(PackageToInclude)' != ''" />
<_filteredNuGetDeployByPackageId Include="@(_nuGetDeployByPackageId)" Exclude="@(_nuGetDeployByPackageIdToRemove);@(PackageToExclude)" />

<ReferenceCopyLocalPaths Condition="'$(NuGetDeploySourceItem)' == 'ReferenceCopyLocalPaths'" Remove="@(ReferenceCopyLocalPaths)" />
<Reference Condition="'$(NuGetDeploySourceItem)' == 'Reference'" Remove="@(Reference)" />
<Analyzer Condition="'$(NuGetDeploySourceItem)' == 'Analyzer'" Remove="@(Analyzer)" />
</ItemGroup>

<CreateItem Include="@(_filteredNuGetDeployByPackageId->'%(OriginalItemSpec)')">
<Output TaskParameter="Include" ItemName="$(NuGetDeploySourceItem)" />
</CreateItem>
</Target>

</Project>
3 changes: 3 additions & 0 deletions external/dir.targets
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,7 @@
<Target Name="GetTargetPath"
DependsOnTargets="Compile;GetBinplaceItems"
Returns="@(BinplaceItem)" />

<!-- Don't do any filtering of Targeting pack packages -->
<Target Name="FilterTargetingPackResolvedNugetPackages" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we put this in the depproj.targets file?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can in a follow up.

</Project>
24 changes: 3 additions & 21 deletions external/netfx/netfx.depproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,9 @@
<RefPath Condition="'$(ForShims)' != 'true'">$(RefPath)</RefPath>
<RefPath Condition="'$(ForShims)' == 'true'">$(NetFxRefPath)</RefPath>
</BinplaceConfiguration>
</ItemGroup>

<!-- Filter the targeting pack to just these assemblies which we need netcoreapp shims for -->
<ItemGroup>
<TargetingPackReference Include="mscorlib" />
<TargetingPackReference Include="System" />
<TargetingPackReference Include="System.Core" />
<TargetingPackReference Include="System.Drawing" />
<TargetingPackReference Include="System.Numerics" />
<TargetingPackReference Include="System.Runtime.Serialization" />
<TargetingPackReference Include="System.Web" />
<TargetingPackReference Include="System.Xml" />
<TargetingPackReference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup Condition="'$(ForShims)' != 'true'">
<TargetingPackReference Include="System.ComponentModel.DataAnnotations" />
<TargetingPackReference Include="System.Data" />
<TargetingPackReference Include="System.Security" />
<TargetingPackReference Include="System.ServiceProcess" />
<TargetingPackReference Include="System.Transactions" />
<TargetingPackReference Include="WindowsBase" />

<FileToExclude Include="System.EnterpriseServices.Thunk" />
<FileToExclude Include="System.EnterpriseServices.Wrapper" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm interested in understanding why the filtered approach didn't work still. My expectation is that our builds didn't need the full targeting pack and would likely be able to get away with just a smaller subset.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can filter what goes into netfx. Previously I had a separate filter for netfx/net4* configured projects and shims. This broke because they needed to use the same folder. The shims will always be a smaller subset than the libs we build against so we need filtering in the shims. We can easily add back filtering to the depprojs at will in the future.

</Project>
1 change: 0 additions & 1 deletion external/portable/portable.depproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@
</BinplaceConfiguration>
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<Target Name="FilterTargetingPackResolvedNugetPackages" />
</Project>
8 changes: 0 additions & 8 deletions external/runtime/runtime.depproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,5 @@
<ProjectJsonTemplate>$(MSBuildThisFileDirectory)NETNative/project.json.template</ProjectJsonTemplate>
<NuGetDeploySourceItem>Reference</NuGetDeploySourceItem>
</PropertyGroup>
<ItemGroup Condition="'$(TargetGroup)' == 'uapaot'">
<TargetingPackReference Include="System.Private.CoreLib" />
<TargetingPackReference Include="System.Private.CoreLib.Augments" />
<TargetingPackReference Include="System.Private.CoreLib.DynamicDelegate" />
<TargetingPackReference Include="System.Private.CoreLib.WinRTInterop" />
<TargetingPackReference Include="System.Private.Interop" />
<TargetingPackReference Include="System.Private.Threading" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>
21 changes: 17 additions & 4 deletions src/shims/shims.proj
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,23 @@
<NetCoreAppRefPath>$(RefPath)</NetCoreAppRefPath>
</PropertyGroup>

<ItemGroup>
<NetFxReference Include="mscorlib" />
<NetFxReference Include="System" />
<NetFxReference Include="System.Core" />
<NetFxReference Include="System.Drawing" />
<NetFxReference Include="System.Numerics" />
<NetFxReference Include="System.Runtime.Serialization" />
<NetFxReference Include="System.Web" />
<NetFxReference Include="System.Xml" />
<NetFxReference Include="System.Xml.Linq" />
</ItemGroup>

<Target Name="GetGenFacadesInputs">
<ItemGroup>
<GenFacadesContracts Include="$(NetFxRefPath)*.dll" />
<GenFacadesContracts Include="$(NetStandardRefPath)netstandard.dll" />
<NetFxContracts Include="@(NetFxReference->'$(NetFxRefPath)%(Identity).dll')" />
<NETStandardContracts Include="$(NetStandardRefPath)netstandard.dll" />
<GenFacadesContracts Include="@(NetFxContracts);@(NETStandardContracts)" />
<GenFacadesSeeds Include="$(NetCoreAppRefPath)*.dll" Exclude="$(NetCoreAppRefPath)System.Private.CoreLib.dll" />
</ItemGroup>
</Target>
Expand Down Expand Up @@ -51,9 +64,9 @@
<GenFacadesCmd>$(ToolHostCmd) "$(ToolsDir)GenFacades.exe"</GenFacadesCmd>
</PropertyGroup>

<Exec Command="$(GenFacadesCmd) -contracts:&quot;$(NetFxRefPath)&quot; @&quot;$(GenFacadesResponseFile)&quot;" WorkingDirectory="$(ToolRuntimePath)" />
<Exec Command="$(GenFacadesCmd) -contracts:&quot;@(NetFxContracts)&quot; @&quot;$(GenFacadesResponseFile)&quot;" WorkingDirectory="$(ToolRuntimePath)" />

<Exec Command="$(GenFacadesCmd) -contracts:$(NetStandardRefPath)netstandard.dll @&quot;$(GenFacadesResponseFile)&quot;" WorkingDirectory="$(ToolRuntimePath)" />
<Exec Command="$(GenFacadesCmd) -contracts:&quot;@(NETStandardContracts)&quot; @&quot;$(GenFacadesResponseFile)&quot;" WorkingDirectory="$(ToolRuntimePath)" />

<!-- Copy the facades to the package ref and lib folders to be included in the packages -->
<!-- TODO: replace with BinPlacing targets -->
Expand Down