diff options
author | Eric St. John <ericstj@microsoft.com> | 2017-02-24 08:41:27 +0300 |
---|---|---|
committer | Eric St. John <ericstj@microsoft.com> | 2017-02-24 22:00:05 +0300 |
commit | 83ecd322e3c6190870f4855fa7104ab3ac0a6404 (patch) | |
tree | ca8cc3023170d7884070b25d1769b3ceac484a1b /pkg | |
parent | 4224a038d999f7fb9fe6e0d74017c8c6ad7437c0 (diff) |
Improve private package build perf
After including all source in private packages build perf is
significantly regressed. This is due to the huge number of props and
items from those props. When evaluating project references we were
revaluating all these once for each RID. This was excessive since the
only thing we needed out of the project reference was the package ID.
Since that's coming from the same project, just list it explicitly.
Diffstat (limited to 'pkg')
3 files changed, 32 insertions, 8 deletions
diff --git a/pkg/Microsoft.Private.CoreFx.NETCoreApp/Microsoft.Private.CoreFx.NETCoreApp.pkgproj b/pkg/Microsoft.Private.CoreFx.NETCoreApp/Microsoft.Private.CoreFx.NETCoreApp.pkgproj index cd0fc6613b..b3a9e99b55 100644 --- a/pkg/Microsoft.Private.CoreFx.NETCoreApp/Microsoft.Private.CoreFx.NETCoreApp.pkgproj +++ b/pkg/Microsoft.Private.CoreFx.NETCoreApp/Microsoft.Private.CoreFx.NETCoreApp.pkgproj @@ -44,8 +44,6 @@ <Import Condition="'$(PackageTargetRuntime)' == ''" Project="$(RefBinDir)\*.props" /> <ItemGroup Condition="'$(PackageTargetRuntime)' == ''"> - <ProjectReference Include="@(Project)" /> - <!-- Include refs --> <File Include="@(FileToPackage)"> <TargetPath Condition="'%(File.TargetPath)' == ''">ref/$(TargetFramework)</TargetPath> @@ -53,9 +51,13 @@ <!-- force a missing file if ref build is absent --> <File Include="$(RefBinDir)/MISSING_REF_BUILD" Condition="'@(FileToPackage)' == ''" /> - <FilePackageDependency Include="Microsoft.NETCore.Platforms"> + <Dependency Include="@(BuildRid->'runtime.%(Identity).$(Id)')"> + <TargetRuntime>%(Identity)</TargetRuntime> + <Version>$(PackageVersion)</Version> + </Dependency> + <Dependency Include="Microsoft.NETCore.Platforms"> <Version>$(PlatformPackageVersion)</Version> - </FilePackageDependency> + </Dependency> </ItemGroup> <Import Condition="'$(PackageTargetRuntime)' != ''" Project="$(LibBinDir)\*.props" /> diff --git a/pkg/Microsoft.Private.CoreFx.UAP/Microsoft.Private.CoreFx.UAP.pkgproj b/pkg/Microsoft.Private.CoreFx.UAP/Microsoft.Private.CoreFx.UAP.pkgproj index 7999a1df8b..19cc3c9e55 100644 --- a/pkg/Microsoft.Private.CoreFx.UAP/Microsoft.Private.CoreFx.UAP.pkgproj +++ b/pkg/Microsoft.Private.CoreFx.UAP/Microsoft.Private.CoreFx.UAP.pkgproj @@ -22,8 +22,6 @@ <Import Condition="'$(PackageTargetRuntime)' == ''" Project="$(RefBinDir)\*.props" /> <ItemGroup Condition="'$(PackageTargetRuntime)' == ''"> - <ProjectReference Include="@(Project)" /> - <!-- Include refs --> <File Include="@(FileToPackage)"> <TargetPath Condition="'%(File.TargetPath)' == ''">ref/$(TargetFramework)</TargetPath> @@ -31,9 +29,13 @@ <!-- force a missing file if ref build is absent --> <File Include="$(RefBinDir)/MISSING_REF_BUILD" Condition="'@(FileToPackage)' == ''" /> - <FilePackageDependency Include="Microsoft.NETCore.Platforms"> + <Dependency Include="@(BuildRid->'runtime.%(Identity).$(Id)')"> + <TargetRuntime>%(Identity)</TargetRuntime> + <Version>$(PackageVersion)</Version> + </Dependency> + <Dependency Include="Microsoft.NETCore.Platforms"> <Version>$(PlatformPackageVersion)</Version> - </FilePackageDependency> + </Dependency> </ItemGroup> <Import Condition="'$(PackageTargetRuntime)' != ''" Project="$(LibBinDir)\*.props" /> diff --git a/pkg/dir.targets b/pkg/dir.targets new file mode 100644 index 0000000000..690a03bf90 --- /dev/null +++ b/pkg/dir.targets @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="14.0" InitialTargets="CheckForBuildTools" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + + <Import Project="..\dir.targets" /> + + <Target Name="ApplyBaselineToStaticDependencies" + BeforeTargets="AssignPkgProjPackageDependenciesTargetFramework" + Condition="'@(Dependency)' != ''"> + <ApplyBaseLine OriginalDependencies="@(Dependency)" + BaseLinePackages="@(BaseLinePackage)" + PackageIndexes="@(PackageIndex)" + Apply="$(BaseLinePackageDependencies)"> + <Output TaskParameter="BaseLinedDependencies" ItemName="_BaseLinedStaticDependencies" /> + </ApplyBaseLine> + <ItemGroup> + <Dependency Remove="@(Dependency)" /> + <Dependency Include="@(_BaseLinedStaticDependencies)" /> + </ItemGroup> + </Target> +</Project> |