Skip to content

Commit 3fd8a97

Browse files
authored
Add targets to generate the list of shared framework assemblies from project property (#7510)
Changes: * Add support for a property, `IsAspNetCoreApp`, in the .csproj file of assemblies which are part of the shared framework. * Remove unused dependencies * Remove reference which have become part of 'netcoreapp3.0'
1 parent 5bbf710 commit 3fd8a97

File tree

98 files changed

+406
-268
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+406
-268
lines changed

Directory.Build.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@
154154
<Import Project="eng\Dependencies.props" />
155155
<Import Project="eng\PatchConfig.props" />
156156
<Import Project="eng\ProjectReferences.props" />
157+
<Import Project="eng\SharedFramework.Local.props" />
158+
<Import Project="eng\SharedFramework.External.props" />
157159
<Import Project="eng\targets\Cpp.Common.props" Condition="'$(MSBuildProjectExtension)' == '.vcxproj'" />
158160
<Import Project="eng\targets\CSharp.Common.props" Condition="'$(MSBuildProjectExtension)' == '.csproj'" />
159161
<Import Project="eng\targets\Wix.Common.props" Condition="'$(MSBuildProjectExtension)' == '.wixproj'" />

build/SharedFrameworkOnly.props

Lines changed: 0 additions & 26 deletions
This file was deleted.

build/repo.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
<Project>
2-
<Import Project="SharedFrameworkOnly.props" />
3-
42
<PropertyGroup>
53
<TargetRuntimeIdentifier Condition="'$(TargetRuntimeIdentifier)' == ''">$(TargetOsName)-$(TargetArchitecture)</TargetRuntimeIdentifier>
64
</PropertyGroup>
@@ -180,6 +178,8 @@
180178
</Choose>
181179

182180
<Import Project="..\eng\Versions.props" />
181+
<Import Project="..\eng\SharedFramework.Local.props" />
182+
<Import Project="..\eng\SharedFramework.External.props" />
183183
<Import Project="runtimes.props" />
184184
<Import Project="CodeSign.props" />
185185
</Project>

build/repo.targets

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@
6767
<Output TaskParameter="TargetOutputs" ItemName="_ProjectReferenceProvider"/>
6868
</MSBuild>
6969

70+
<ItemGroup>
71+
<_SharedFrameworkAndPackageRef Include="@(_ProjectReferenceProvider->WithMetadataValue('IsAspNetCoreApp','true')->WithMetadataValue('IsShippingPackage', 'true')->Distinct())" />
72+
<_SharedFrameworkRef Include="@(_ProjectReferenceProvider->WithMetadataValue('IsAspNetCoreApp','true')->WithMetadataValue('IsShippingPackage', 'false')->Distinct())" />
73+
</ItemGroup>
74+
7075
<PropertyGroup>
7176
<ProjectListFile>$(MSBuildThisFileDirectory)..\eng\ProjectReferences.props</ProjectListFile>
7277
<ProjectListContent>
@@ -86,6 +91,32 @@
8691
</PropertyGroup>
8792

8893
<WriteLinesToFile File="$(ProjectListFile)" Lines="$(ProjectListContent)" Overwrite="true" />
94+
95+
<PropertyGroup>
96+
<SharedFxDepList>$(MSBuildThisFileDirectory)..\eng\SharedFramework.Local.props</SharedFxDepList>
97+
<SharedFxDepListContent>
98+
<![CDATA[
99+
<!--
100+
This file is automatically generated. Run `./eng/scripts/GenerateProjectList.ps1` to update.
101+
102+
This file contains a complete list of the assemblies which are part of the shared framework.
103+
104+
This project is generated using the <IsAspNetCoreApp> and <IsShippingPackage> properties from each .csproj in this repository.
105+
-->
106+
<Project>
107+
<ItemGroup>
108+
<!-- These assemblies are available as both a NuGet package and in the shared framework -->
109+
@(_SharedFrameworkAndPackageRef->'<AspNetCoreAppReferenceAndPackage Include="%(Identity)" />', '%0A ')
110+
111+
<!-- These assemblies are only in the shared framework -->
112+
@(_SharedFrameworkRef->'<AspNetCoreAppReference Include="%(Identity)" />', '%0A ')
113+
</ItemGroup>
114+
</Project>
115+
]]>
116+
</SharedFxDepListContent>
117+
</PropertyGroup>
118+
119+
<WriteLinesToFile File="$(SharedFxDepList)" Lines="$(SharedFxDepListContent)" Overwrite="true" />
89120
</Target>
90121

91122
<!-- This is temporary until we can use FrameworkReference to build our own packages. -->
@@ -97,7 +128,7 @@
97128

98129
<RepoTasks.RemoveSharedFrameworkDependencies Condition="@(_BuildOutput->Count()) != 0"
99130
Files="@(_BuildOutput)"
100-
FrameworkOnlyPackages="@(SharedFrameworkOnlyPackage)" />
131+
FrameworkOnlyPackages="@(AspNetCoreAppReference)" />
101132
</Target>
102133

103134
<Target Name="GenerateBuildAssetManifest">

docs/ProjectProperties.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ In addition to the standard set of MSBuild properties supported by Microsoft.NET
66
Property name | Meaning
77
-------------------|--------------------------------------------------------------------------------------------
88
IsShippingPackage | When set to `true`, the package produced by from project is intended for use by customers. Defaults to `false`, which means the package is intended for internal use only by Microsoft teams.
9+
IsAspNetCoreApp | Set to `true` when the assembly is part of the [Microsoft.AspNetCore.App shared framework](./SharedFramework.md)

docs/SharedFramework.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Guidance on developing the ASP.NET Core shared framework (`Microsoft.AspNetCore.
77

88
The ASP.NET Core shared framework contains assemblies that are fully developed, supported, and serviceable by Microsoft. You can think of this as constituting the ASP.NET Core *platform*. As such, all assemblies which are included in the shared framework are expected to meet specific requirements. Here are the principles we are using to guide our decisions about what is allowed in the shared framework.
99

10-
* Breaking changes are highly discouraged. Therefore,
10+
* Breaking changes are highly discouraged. Therefore,
1111
* If it's in, it must be broadly useful and expected to be supported for at least several years.
1212
* The API for all assemblies in shared framework MUST NOT make breaking changes in patch or minor releases.
1313
* The complete closure of all assemblies must be in the shared framework, or must be in the "base framework", Microsoft.NETCore.App
@@ -19,3 +19,12 @@ The ASP.NET Core shared framework contains assemblies that are fully developed,
1919
* API we believe is essential for central experiences in .NET Core should be in the shared framework
2020
* Examples of central experiences: MVC, Kestrel, Razor, SignalR
2121
* New API can ship as out-of-band packages first, and move into the base framework later when it meets these standards
22+
23+
### How to adjust what is in the shared framework
24+
25+
The contents of the shared framework are defined in two ways:
26+
27+
* [src/Framework/LocalDependencies.props](/src/Framework/LocalDependencies.props) - this file is generated from the .csproj files in this repo
28+
by looking for projects which have set `<IsAspNetCoreApp>true</IsAspNetCoreApp>`.
29+
* [src/Framework/Microsoft.AspNetCore.App.props](/src/Framework/Microsoft.AspNetCore.App.props) - this file lists all assemblies shipped
30+
in Microsoft.AspNetCore.App which are built by source code found in other repositories.

eng/Dependencies.props

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,17 +134,13 @@ and are generated based on the last package release.
134134
<LatestPackageReference Include="StackExchange.Redis" Version="$(StackExchangeRedisPackageVersion)" />
135135
<LatestPackageReference Include="System.Buffers" Version="$(SystemBuffersPackageVersion)" />
136136
<LatestPackageReference Include="System.CodeDom" Version="$(SystemCodeDomPackageVersion)" />
137-
<LatestPackageReference Include="System.ComponentModel.Annotations" Version="$(SystemComponentModelAnnotationsPackageVersion)" />
138137
<LatestPackageReference Include="System.Data.SqlClient" Version="$(SystemDataSqlClientPackageVersion)" />
139-
<LatestPackageReference Include="System.Diagnostics.DiagnosticSource" Version="$(SystemDiagnosticsDiagnosticSourcePackageVersion)" />
140138
<LatestPackageReference Include="System.Diagnostics.EventLog" Version="$(SystemDiagnosticsEventLogPackageVersion)" />
141139
<LatestPackageReference Include="System.IdentityModel.Tokens.Jwt" Version="$(SystemIdentityModelTokensJwtPackageVersion)" />
142140
<LatestPackageReference Include="System.IO.Pipelines" Version="$(SystemIOPipelinesPackageVersion)" />
143-
<LatestPackageReference Include="System.Memory" Version="$(SystemMemoryPackageVersion)" />
144141
<LatestPackageReference Include="System.Net.Http.WinHttpHandler" Version="$(SystemNetHttpWinHttpHandlerPackageVersion)" />
145142
<LatestPackageReference Include="System.Net.Http" Version="$(SystemNetHttpPackageVersion)" />
146143
<LatestPackageReference Include="System.Net.WebSockets.WebSocketProtocol" Version="$(SystemNetWebSocketsWebSocketProtocolPackageVersion)" />
147-
<LatestPackageReference Include="System.Numerics.Vectors" Version="$(SystemNumericsVectorsPackageVersion)" />
148144
<LatestPackageReference Include="System.Reactive.Linq" Version="$(SystemReactiveLinqPackageVersion)" />
149145
<LatestPackageReference Include="System.Reflection.Metadata" Version="$(SystemReflectionMetadataPackageVersion)" />
150146
<LatestPackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="$(SystemRuntimeCompilerServicesUnsafePackageVersion)" />

0 commit comments

Comments
 (0)