Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

port some System.IO.Packaging, System.CodeDom, System.Collections.Immutable and System.Configuration.ConfigurationManager #55216

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from 7 commits
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
13 changes: 11 additions & 2 deletions eng/packaging.targets
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<ItemGroup>
<TfmSpecificPackageFile Include="@(SatelliteDllsProjectOutputGroupOutput);
@(BuiltProjectOutputGroupOutput)">
<PackagePath>runtimes/$(_runtimeOS)/lib/$(TargetFrameworkWithoutSuffix)</PackagePath>
<PackagePath>runtimes/$(PackageTargetRuntime)/lib/$(TargetFrameworkWithoutSuffix)</PackagePath>
</TfmSpecificPackageFile>
</ItemGroup>
</Target>
Expand All @@ -74,9 +74,18 @@

<ItemGroup Condition="Exists('$(RuntimeSymbolPath)')">
<TfmSpecificDebugSymbolsFile Include="$(RuntimeSymbolPath)">
<TargetPath>/runtimes/$(_runtimeOS)/lib/$(TargetFrameworkWithoutSuffix)/$(TargetName).pdb</TargetPath>
<TargetPath>/runtimes/$(PackageTargetRuntime)/lib/$(TargetFrameworkWithoutSuffix)/$(TargetName).pdb</TargetPath>
<TargetFramework>$(TargetFrameworkWithoutSuffix)</TargetFramework>
</TfmSpecificDebugSymbolsFile>
</ItemGroup>
</Target>

<!-- Ensure that the IsPackable attribute in NetCoreAppLibrary.props is in sync with IsPackable properties in projects. -->
<Target Name="EnsureNetCoreAppLibraryIsPackableInSync"
BeforeTargets="Pack">
<Error Text="Please add $(AssemblyName) to the NetCoreAppLibrary IsPackable item update in NetCoreAppLibrary.props."
Condition="!@(NetCoreAppLibrary->WithMetadataValue('Identity', '$(AssemblyName)')->AnyHaveMetadataValue('IsPackable', 'true')) and '$(IsNETCoreAppSrc)' == 'true' and '$(IsPackable)' == 'true'" />
<Error Text="Please remove $(AssemblyName) from the NetCoreAppLibrary IsPackable item update in NetCoreAppLibrary.props."
Condition="@(NetCoreAppLibrary->WithMetadataValue('Identity', '$(AssemblyName)')->AnyHaveMetadataValue('IsPackable', 'true')) and '$(IsSourceProject)' == 'true' and ('$(IsNETCoreAppSrc)' != 'true' or '$(IsPackable)' != 'true')" />
</Target>
</Project>
20 changes: 12 additions & 8 deletions eng/references.targets
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project>
<Project InitialTargets="UpdateProjectReferencesWithPrivateAttribute">
<PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
<!--
Disable RAR from transitively discovering dependencies for references. This is required as we don't copy
Expand Down Expand Up @@ -37,15 +37,19 @@

<!-- Make shared framework assemblies not app-local (non private). -->
<Target Name="UpdateProjectReferencesWithPrivateAttribute"
AfterTargets="AssignProjectConfiguration"
BeforeTargets="PrepareProjectReferences"
Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and
('$(IsTestProject)' == 'true' or '$(IsTestSupportProject)' == 'true') and
'@(ProjectReferenceWithConfiguration)' != ''">
('$(IsSourceProject)' == 'true' or '$(IsTestProject)' == 'true' or '$(IsTestSupportProject)' == 'true') and
'@(ProjectReference)' != ''">
<ItemGroup>
<ProjectReferenceWithConfiguration PrivateAssets="all"
Private="false"
Condition="$(NetCoreAppLibrary.Contains('%(Filename);'))" />
<_noPackageNetCoreAppLibrary Include="@(NetCoreAppLibrary)"
Condition="'%(NetCoreAppLibrary.IsPackable)' != 'true'" />
Copy link
Member

Choose a reason for hiding this comment

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

If the only consumer of this metadata is as a list without IsPackable, perhaps we can just store it that way and avoid the metadata? IOW we have NoPackageNetCoreAppLibrary item statically defined instead of calculated in this target.

Copy link
Member

Choose a reason for hiding this comment

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

I prefer metadata over a separate list. Please check my latest changes in which I removed the target entirely in favor of static evaluation.

<_projectReferenceByFileName Include="@(ProjectReference->'%(FileName)')"
Original="%(Identity)" />
<_projectReferenceByFileName Condition="'@(_noPackageNetCoreAppLibrary)' == '@(_ProjectReferenceByFileName)' and '%(Identity)' != ''"
PrivateAssets="all"
Private="false" />
<ProjectReference Remove="@(ProjectReference)" />
<ProjectReference Include="@(_ProjectReferenceByFileName->'%(Original)')" />
</ItemGroup>
</Target>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.Logging.Abstractions\src\Microsoft.Extensions.Logging.Abstractions.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.Logging.Configuration\src\Microsoft.Extensions.Logging.Configuration.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.Options\src\Microsoft.Extensions.Options.csproj" />
<!-- Application tfms (.NETCoreApp, .NETFramework) need to use the same or higher version of .NETStandard's dependencies. -->
<ProjectReference Include="$(LibrariesProjectRoot)System.Text.Json\src\System.Text.Json.csproj" />
</ItemGroup>

Expand All @@ -60,4 +61,4 @@
<NETStandardCompatError Include="netcoreapp2.0" Supported="$(NetCoreAppMinimum)" />
</ItemGroup>

</Project>
</Project>
16 changes: 15 additions & 1 deletion src/libraries/NetCoreAppLibrary.props
Original file line number Diff line number Diff line change
Expand Up @@ -149,5 +149,19 @@
<!-- Make NetCoreAppLibrary available as an item. -->
<ItemGroup>
<NetCoreAppLibrary Include="$(NetCoreAppLibrary)" />
<NetCoreAppLibrary Update="
System.Collections.Immutable;
System.Diagnostics.DiagnosticSource;
System.Formats.Asn1;
System.Net.Http.Json;
System.Reflection.Metadata;
System.Runtime.CompilerServices.Unsafe;
System.Text.Encoding.CodePages;
System.Text.Encodings.Web;
System.Text.Json;
System.Threading.Channels;
itemupdate2;
System.Threading.Tasks.Dataflow"
IsPackable="true" />
</ItemGroup>
</Project>
</Project>
7 changes: 0 additions & 7 deletions src/libraries/System.CodeDom/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
<StrongNameKeyId>Open</StrongNameKeyId>
<PackageDescription>Provides types that can be used to model the structure of a source code document and to output source code for that model in a supported language.

Commonly Used Types:
System.CodeDom.CodeObject
System.CodeDom.Compiler.CodeDomProvider
Microsoft.CSharp.CSharpCodeProvider
Microsoft.VisualBasic.VBCodeProvider</PackageDescription>
<IncludePlatformAttributes>true</IncludePlatformAttributes>
<UnsupportedOSPlatforms>browser;ios;tvos;maccatalyst</UnsupportedOSPlatforms>
</PropertyGroup>
Expand Down
10 changes: 0 additions & 10 deletions src/libraries/System.CodeDom/pkg/System.CodeDom.pkgproj

This file was deleted.

Loading