diff options
author | Eric St. John <ericstj@microsoft.com> | 2017-04-08 02:12:20 +0300 |
---|---|---|
committer | Eric St. John <ericstj@microsoft.com> | 2017-04-08 03:02:41 +0300 |
commit | cf28f5105ac4bbcb9d19fa71a90fe4a219e0994b (patch) | |
tree | 652cc016424f89ee2ae7a3977fd3e190820b2fe2 /pkg | |
parent | b7153b2f56f1a3dd49a67d4eca7dd78c791e8539 (diff) |
Share content template across framework pkgs
Previously the content items/targets were duplicated between the
UAP and NETCoreApp pkgprojs.
This refactors it into shared targets.
The mechanism for opt-in to this traversal behavior is to set a property
IsFrameworkPackage=true.
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/Microsoft.Private.CoreFx.NETCoreApp/Microsoft.Private.CoreFx.NETCoreApp.pkgproj | 92 | ||||
-rw-r--r-- | pkg/Microsoft.Private.CoreFx.UAP/Microsoft.Private.CoreFx.UAP.pkgproj | 94 | ||||
-rw-r--r-- | pkg/dir.targets | 2 | ||||
-rw-r--r-- | pkg/frameworkPackage.targets | 81 |
4 files changed, 102 insertions, 167 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 7339853029..fc5a63c9e8 100644 --- a/pkg/Microsoft.Private.CoreFx.NETCoreApp/Microsoft.Private.CoreFx.NETCoreApp.pkgproj +++ b/pkg/Microsoft.Private.CoreFx.NETCoreApp/Microsoft.Private.CoreFx.NETCoreApp.pkgproj @@ -16,95 +16,21 @@ <NETStandardVersion>2.0</NETStandardVersion> + <IsFrameworkPackage>true</IsFrameworkPackage> + <!-- Include symbols in package by default--> <IncludeSymbolsInPackage Condition="'$(IncludeSymbolsInPackage)' == ''">true</IncludeSymbolsInPackage> </PropertyGroup> - <Import Condition="'$(PackageTargetRuntime)' == ''" Project="$(RefBinDir)\*.props" /> - <ItemGroup Condition="'$(PackageTargetRuntime)' == ''"> - <!-- Include refs --> - <File Include="@(FileToPackage)"> - <TargetPath Condition="'%(File.TargetPath)' == ''">ref/$(TargetFramework)</TargetPath> - </File> - <!-- force a missing file if ref build is absent --> - <File Include="$(RefBinDir)/MISSING_REF_BUILD" Condition="'@(FileToPackage)' == ''" /> - - <_buildRIDWithMetadata Include="@(BuildRID)"> - <TargetRuntime>%(Identity)</TargetRuntime> - <Version>$(PackageVersion)</Version> - </_buildRIDWithMetadata> - <Dependency Include="@(_buildRIDWithMetadata->'runtime.%(Identity).$(Id)')" /> - - <Dependency Include="Microsoft.NETCore.Platforms"> - <Version>$(PlatformPackageVersion)</Version> - </Dependency> - </ItemGroup> - - <Import Condition="'$(PackageTargetRuntime)' != ''" Project="$(LibBinDir)\*.props" /> - <ItemGroup Condition="'$(PackageTargetRuntime)' != ''"> - <!-- Include lib --> - <File Include="@(FileToPackage)"> - <TargetPath Condition="'%(File.TargetPath)' == ''">runtimes/$(PackageTargetRuntime)/lib/$(TargetFramework)</TargetPath> - </File> - <!-- force a missing file if lib build is absent --> - <File Include="$(LibBinDir)/MISSING_LIB_BUILD" Condition="'@(FileToPackage)' == ''" /> - - <!-- Include native --> - <ExcludeNative Include="$(NativeBinDir)/*.lib" /> - <NativeFile Include="$(NativeBinDir)/*.*" Exclude="@(ExcludeNative)"> - <TargetPath>runtimes/$(PackageTargetRuntime)/native</TargetPath> - </NativeFile> - <File Include="@(NativeFile)" /> - <!-- force a missing file if native build is absent --> - <File Include="$(NativeBinDir)/MISSING_NATIVE_BUILD" Condition="'@(NativeFile)' == ''" /> - </ItemGroup> - <ItemGroup> <IgnoredReference Include="System.Private.CoreLib" /> - </ItemGroup> - - <Target Name="VerifyClosure" AfterTargets="Build"> - <ItemGroup> - <!-- Exclude shims from the closure verification --> - <ExcludeFromClosure Include="mscorlib" /> - <ExcludeFromClosure Include="System" /> - <ExcludeFromClosure Include="System.Core" /> - <ExcludeFromClosure Include="System.Data" /> - </ItemGroup> - - <ItemGroup> - <_fileExisting Include="@(File)" Condition="Exists(%(FullPath))"/> - - <_fileNames Include="@(_fileExisting -> '%(FileName)')" Exclude="@(ExcludeFromClosure)"> - <Original>%(_fileExisting.Identity)</Original> - </_fileNames> - <_filesFiltered Include="@(_fileNames->'%(Original)')" /> - </ItemGroup> - <VerifyClosure Sources="@(_filesFiltered)" - IgnoredReferences="@(IgnoredReference)" /> - </Target> - - <Target Name="VerifyNETStandard" AfterTargets="Build"> - <ItemGroup> - <_NETStandardFile Include="$(PackagesDir)$(NETStandardPackageId)\$(NETStandardPackageVersion)\build\netstandard$(NETStandardVersion)\ref\*.dll" /> - <!-- force a missing file there are no files found in the package --> - <_NETStandardFile Include="$(PackagesDir)$(NETStandardPackageId)\$(NETStandardPackageVersion)\build\netstandard$(NETStandardVersion)\ref\MISSING_REF_BUILD" Condition="'@(_NETStandardFile)' == ''" /> - <_NETStandardMissingFile Include="@(_NETStandardFile->'%(FileName)')" Exclude="@(File->'%(FileName)')" /> - <_NETStandardMissingFileError Include="@(_NETStandardMissingFile)" Exclude="@(SuppressNETStandardMissingFile)" /> - <_NETStandardSuppressedMissingFile Include="@(_NETStandardMissingFile)" Exclude="@(_NETStandardMissingFileError)" /> - </ItemGroup> - <Message Condition="'@(_NETStandardSuppressedMissingFile)' != ''" Text="Files'@(_NETStandardSuppressedMissingFile)' are part of '$(NETStandardPackageId)' but missing from this package. This error has been suppressed." /> - <Error Condition="'@(_NETStandardMissingFileError)' != ''" Text="Files '@(_NETStandardMissingFileError)' are part of '$(NETStandardPackageId)' but missing from this package." /> - </Target> - - <Target Name="GetSymbolPackageFiles" BeforeTargets="GetPackageFiles"> - <ItemGroup> - <File> - <IsSymbolFile Condition="'%(Extension)' == '.pdb'">true</IsSymbolFile> - <IsSymbolFile Condition="'$(SymbolFileExtension)' != '' AND'%(Extension)' == '$(SymbolFileExtension)'">true</IsSymbolFile> - </File> - </ItemGroup> - </Target> + <!-- Exclude shims from the closure verification --> + <ExcludeFromClosure Include="mscorlib" /> + <ExcludeFromClosure Include="System" /> + <ExcludeFromClosure Include="System.Core" /> + <ExcludeFromClosure Include="System.Data" /> + </ItemGroup> + <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> </Project> 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 22fcf970a8..d01d4e674e 100644 --- a/pkg/Microsoft.Private.CoreFx.UAP/Microsoft.Private.CoreFx.UAP.pkgproj +++ b/pkg/Microsoft.Private.CoreFx.UAP/Microsoft.Private.CoreFx.UAP.pkgproj @@ -17,101 +17,27 @@ <NETStandardVersion>2.0</NETStandardVersion> + <IsFrameworkPackage>true</IsFrameworkPackage> + <!-- Include symbols in package by default--> <IncludeSymbolsInPackage Condition="'$(IncludeSymbolsInPackage)' == ''">true</IncludeSymbolsInPackage> </PropertyGroup> - <Import Condition="'$(PackageTargetRuntime)' == ''" Project="$(RefBinDir)\*.props" /> - <ItemGroup Condition="'$(PackageTargetRuntime)' == ''"> - <!-- Include refs --> - <File Include="@(FileToPackage)"> - <TargetPath Condition="'%(File.TargetPath)' == ''">ref/$(TargetFramework)</TargetPath> - </File> - <!-- force a missing file if ref build is absent --> - <File Include="$(RefBinDir)/MISSING_REF_BUILD" Condition="'@(FileToPackage)' == ''" /> - - <_buildRIDWithMetadata Include="@(BuildRID)"> - <TargetRuntime>%(Identity)</TargetRuntime> - <Version>$(PackageVersion)</Version> - </_buildRIDWithMetadata> - <Dependency Include="@(_buildRIDWithMetadata->'runtime.%(Identity).$(Id)')" /> - - <Dependency Include="Microsoft.NETCore.Platforms"> - <Version>$(PlatformPackageVersion)</Version> - </Dependency> - </ItemGroup> - - <Import Condition="'$(PackageTargetRuntime)' != ''" Project="$(LibBinDir)\*.props" /> - <ItemGroup Condition="'$(PackageTargetRuntime)' != ''"> - <!-- Include lib --> - <File Include="@(FileToPackage)"> - <TargetPath Condition="'%(File.TargetPath)' == ''">runtimes/$(PackageTargetRuntime)/lib/$(TargetFramework)</TargetPath> - </File> - <!-- force a missing file if lib build is absent --> - <File Include="$(LibBinDir)/MISSING_LIB_BUILD" Condition="'@(FileToPackage)' == ''" /> - - <!-- Include native --> - <ExcludeNative Include="$(NativeBinDir)/*.lib" /> - <NativeFile Include="$(NativeBinDir)/*.*" Exclude="@(ExcludeNative)"> - <TargetPath>runtimes/$(PackageTargetRuntime)/native</TargetPath> - </NativeFile> - <File Include="@(NativeFile)" /> - <!-- force a missing file if native build is absent --> - <File Include="$(NativeBinDir)/MISSING_NATIVE_BUILD" Condition="'@(NativeFile)' == ''" /> - </ItemGroup> - <ItemGroup> <IgnoredReference Include="System.Private.CoreLib" /> <IgnoredReference Include="Windows" /> <IgnoredReference Include="System.Private.Interop" /> <IgnoredReference Include="Microsoft.Win32.Registry" /> <!-- Ignore for now since it's being exclude from closure below. Issue https://github.com/dotnet/corefx/issues/15966 --> <IgnoredReference Include="System.IO.IsolatedStorage" /> <!-- Ignore for now since it's being exclude from closure below. Issue https://github.com/dotnet/corefx/issues/15968 --> - </ItemGroup> - - <Target Name="VerifyClosure" AfterTargets="Build"> - <ItemGroup> - <ExcludeFromClosure Include="System.IO.IsolatedStorage" /> <!-- IsolatedStorage depends on AccessControl which is not available for UAP --> - <ExcludeFromClosure Include="Microsoft.Win32.Registry" /> <!-- Most likely this one will be removed from the package, it's just there today for the closure --> - <!-- Exclude shims from the closure verification --> - <ExcludeFromClosure Include="mscorlib" /> - <ExcludeFromClosure Include="System" /> - <ExcludeFromClosure Include="System.Core" /> - <ExcludeFromClosure Include="System.Data" /> - </ItemGroup> - - <ItemGroup> - <_fileExisting Include="@(File)" Condition="Exists(%(FullPath))"/> - <_fileNames Include="@(_fileExisting -> '%(FileName)')" Exclude="@(ExcludeFromClosure)"> - <Original>%(_fileExisting.Identity)</Original> - </_fileNames> - <_filesFiltered Include="@(_fileNames->'%(Original)')" /> - </ItemGroup> - - <VerifyClosure Sources="@(_filesFiltered)" - IgnoredReferences="@(IgnoredReference)" /> - </Target> - - <Target Name="VerifyNETStandard" AfterTargets="Build"> - <ItemGroup> - <_NETStandardFile Include="$(PackagesDir)$(NETStandardPackageId)\$(NETStandardPackageVersion)\build\netstandard$(NETStandardVersion)\ref\*.dll" /> - <!-- force a missing file there are no files found in the package --> - <_NETStandardFile Include="$(PackagesDir)$(NETStandardPackageId)\$(NETStandardPackageVersion)\build\netstandard$(NETStandardVersion)\ref\MISSING_REF_BUILD" Condition="'@(_NETStandardFile)' == ''" /> - <_NETStandardMissingFile Include="@(_NETStandardFile->'%(FileName)')" Exclude="@(File->'%(FileName)')" /> - <_NETStandardMissingFileError Include="@(_NETStandardMissingFile)" Exclude="@(SuppressNETStandardMissingFile)" /> - <_NETStandardSuppressedMissingFile Include="@(_NETStandardMissingFile)" Exclude="@(_NETStandardMissingFileError)" /> - </ItemGroup> - <Message Condition="'@(_NETStandardSuppressedMissingFile)' != ''" Text="Files'@(_NETStandardSuppressedMissingFile)' are part of '$(NETStandardPackageId)' but missing from this package. This error has been suppressed." /> - <Error Condition="'@(_NETStandardMissingFileError)' != ''" Text="Files '@(_NETStandardMissingFileError)' are part of '$(NETStandardPackageId)' but missing from this package." /> - </Target> + <ExcludeFromClosure Include="System.IO.IsolatedStorage" /> <!-- IsolatedStorage depends on AccessControl which is not available for UAP --> + <ExcludeFromClosure Include="Microsoft.Win32.Registry" /> <!-- Most likely this one will be removed from the package, it's just there today for the closure --> + <!-- Exclude shims from the closure verification --> + <ExcludeFromClosure Include="mscorlib" /> + <ExcludeFromClosure Include="System" /> + <ExcludeFromClosure Include="System.Core" /> + <ExcludeFromClosure Include="System.Data" /> + </ItemGroup> - <Target Name="GetSymbolPackageFiles" BeforeTargets="GetPackageFiles"> - <ItemGroup> - <File> - <IsSymbolFile Condition="'%(Extension)' == '.pdb'">true</IsSymbolFile> - <IsSymbolFile Condition="'$(SymbolFileExtension)' != '' AND'%(Extension)' == '$(SymbolFileExtension)'">true</IsSymbolFile> - </File> - </ItemGroup> - </Target> <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> </Project> diff --git a/pkg/dir.targets b/pkg/dir.targets index 53e5d2320f..7c12c49fea 100644 --- a/pkg/dir.targets +++ b/pkg/dir.targets @@ -1,6 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="14.0" InitialTargets="CheckForBuildTools" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Condition="'$(IsFrameworkPackage)' == 'true'" Project="frameworkPackage.targets" /> + <Import Project="..\dir.targets" /> <Target Name="ApplyBaselineToStaticDependencies" diff --git a/pkg/frameworkPackage.targets b/pkg/frameworkPackage.targets new file mode 100644 index 0000000000..33bf916aee --- /dev/null +++ b/pkg/frameworkPackage.targets @@ -0,0 +1,81 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="14.0" InitialTargets="CheckForBuildTools" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + + <!-- Bring in ref content from binplaced ref props --> + <Import Condition="'$(PackageTargetRuntime)' == ''" Project="$(RefBinDir)\*.props" /> + <ItemGroup Condition="'$(PackageTargetRuntime)' == ''"> + <!-- Include refs --> + <File Include="@(FileToPackage)"> + <TargetPath Condition="'%(File.TargetPath)' == ''">ref/$(TargetFramework)</TargetPath> + </File> + <!-- force a missing file if ref build is absent --> + <File Include="$(RefBinDir)/MISSING_REF_BUILD" Condition="'@(FileToPackage)' == ''" /> + + <_buildRIDWithMetadata Include="@(BuildRID)"> + <TargetRuntime>%(Identity)</TargetRuntime> + <Version>$(PackageVersion)</Version> + </_buildRIDWithMetadata> + <Dependency Include="@(_buildRIDWithMetadata->'runtime.%(Identity).$(Id)')" /> + + <Dependency Include="Microsoft.NETCore.Platforms"> + <Version>$(PlatformPackageVersion)</Version> + </Dependency> + </ItemGroup> + + <!-- Bring in lib content from binplaced lib props --> + <Import Condition="'$(PackageTargetRuntime)' != ''" Project="$(LibBinDir)\*.props" /> + <ItemGroup Condition="'$(PackageTargetRuntime)' != ''"> + <!-- Include lib --> + <File Include="@(FileToPackage)"> + <TargetPath Condition="'%(File.TargetPath)' == ''">runtimes/$(PackageTargetRuntime)/lib/$(TargetFramework)</TargetPath> + </File> + <!-- force a missing file if lib build is absent --> + <File Include="$(LibBinDir)/MISSING_LIB_BUILD" Condition="'@(FileToPackage)' == ''" /> + + <!-- Include native --> + <ExcludeNative Include="$(NativeBinDir)/*.lib" /> + <NativeFile Include="$(NativeBinDir)/*.*" Exclude="@(ExcludeNative)"> + <TargetPath>runtimes/$(PackageTargetRuntime)/native</TargetPath> + </NativeFile> + <File Include="@(NativeFile)" /> + <!-- force a missing file if native build is absent --> + <File Include="$(NativeBinDir)/MISSING_NATIVE_BUILD" Condition="'@(NativeFile)' == ''" /> + </ItemGroup> + + + <Target Name="VerifyClosure" AfterTargets="Build"> + <ItemGroup> + <_fileExisting Include="@(File)" Condition="Exists(%(FullPath))"/> + + <_fileNames Include="@(_fileExisting -> '%(FileName)')" Exclude="@(ExcludeFromClosure)"> + <Original>%(_fileExisting.Identity)</Original> + </_fileNames> + <_filesFiltered Include="@(_fileNames->'%(Original)')" /> + </ItemGroup> + + <VerifyClosure Sources="@(_filesFiltered)" + IgnoredReferences="@(IgnoredReference)" /> + </Target> + + <Target Name="VerifyNETStandard" AfterTargets="Build"> + <ItemGroup> + <_NETStandardFile Include="$(PackagesDir)$(NETStandardPackageId)\$(NETStandardPackageVersion)\build\netstandard$(NETStandardVersion)\ref\*.dll" /> + <!-- force a missing file there are no files found in the package --> + <_NETStandardFile Include="$(PackagesDir)$(NETStandardPackageId)\$(NETStandardPackageVersion)\build\netstandard$(NETStandardVersion)\ref\MISSING_REF_BUILD" Condition="'@(_NETStandardFile)' == ''" /> + <_NETStandardMissingFile Include="@(_NETStandardFile->'%(FileName)')" Exclude="@(File->'%(FileName)')" /> + <_NETStandardMissingFileError Include="@(_NETStandardMissingFile)" Exclude="@(SuppressNETStandardMissingFile)" /> + <_NETStandardSuppressedMissingFile Include="@(_NETStandardMissingFile)" Exclude="@(_NETStandardMissingFileError)" /> + </ItemGroup> + <Message Condition="'@(_NETStandardSuppressedMissingFile)' != ''" Text="Files'@(_NETStandardSuppressedMissingFile)' are part of '$(NETStandardPackageId)' but missing from this package. This error has been suppressed." /> + <Error Condition="'@(_NETStandardMissingFileError)' != ''" Text="Files '@(_NETStandardMissingFileError)' are part of '$(NETStandardPackageId)' but missing from this package." /> + </Target> + + <Target Name="GetSymbolPackageFiles" BeforeTargets="GetPackageFiles"> + <ItemGroup> + <File> + <IsSymbolFile Condition="'%(Extension)' == '.pdb'">true</IsSymbolFile> + <IsSymbolFile Condition="'$(SymbolFileExtension)' != '' AND'%(Extension)' == '$(SymbolFileExtension)'">true</IsSymbolFile> + </File> + </ItemGroup> + </Target> +</Project> |