Skip to content

Add targets to generate the list of shared framework assemblies from project property #7510

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

Merged
merged 5 commits into from
Feb 13, 2019
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@
<Import Project="eng\Dependencies.props" />
<Import Project="eng\PatchConfig.props" />
<Import Project="eng\ProjectReferences.props" />
<Import Project="eng\SharedFramework.Local.props" />
<Import Project="eng\SharedFramework.External.props" />
<Import Project="eng\targets\Cpp.Common.props" Condition="'$(MSBuildProjectExtension)' == '.vcxproj'" />
<Import Project="eng\targets\CSharp.Common.props" Condition="'$(MSBuildProjectExtension)' == '.csproj'" />
<Import Project="eng\targets\Wix.Common.props" Condition="'$(MSBuildProjectExtension)' == '.wixproj'" />
Expand Down
26 changes: 0 additions & 26 deletions build/SharedFrameworkOnly.props

This file was deleted.

4 changes: 2 additions & 2 deletions build/repo.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<Project>
<Import Project="SharedFrameworkOnly.props" />

<PropertyGroup>
<TargetRuntimeIdentifier Condition="'$(TargetRuntimeIdentifier)' == ''">$(TargetOsName)-$(TargetArchitecture)</TargetRuntimeIdentifier>
</PropertyGroup>
Expand Down Expand Up @@ -180,6 +178,8 @@
</Choose>

<Import Project="..\eng\Versions.props" />
<Import Project="..\eng\SharedFramework.Local.props" />
<Import Project="..\eng\SharedFramework.External.props" />
<Import Project="runtimes.props" />
<Import Project="CodeSign.props" />
</Project>
33 changes: 32 additions & 1 deletion build/repo.targets
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@
<Output TaskParameter="TargetOutputs" ItemName="_ProjectReferenceProvider"/>
</MSBuild>

<ItemGroup>
<_SharedFrameworkAndPackageRef Include="@(_ProjectReferenceProvider->WithMetadataValue('IsAspNetCoreApp','true')->WithMetadataValue('IsShippingPackage', 'true')->Distinct())" />
<_SharedFrameworkRef Include="@(_ProjectReferenceProvider->WithMetadataValue('IsAspNetCoreApp','true')->WithMetadataValue('IsShippingPackage', 'false')->Distinct())" />
</ItemGroup>

<PropertyGroup>
<ProjectListFile>$(MSBuildThisFileDirectory)..\eng\ProjectReferences.props</ProjectListFile>
<ProjectListContent>
Expand All @@ -86,6 +91,32 @@
</PropertyGroup>

<WriteLinesToFile File="$(ProjectListFile)" Lines="$(ProjectListContent)" Overwrite="true" />

<PropertyGroup>
<SharedFxDepList>$(MSBuildThisFileDirectory)..\eng\SharedFramework.Local.props</SharedFxDepList>
<SharedFxDepListContent>
<![CDATA[
<!--
This file is automatically generated. Run `./eng/scripts/GenerateProjectList.ps1` to update.

This file contains a complete list of the assemblies which are part of the shared framework.

This project is generated using the <IsAspNetCoreApp> and <IsShippingPackage> properties from each .csproj in this repository.
-->
<Project>
<ItemGroup>
<!-- These assemblies are available as both a NuGet package and in the shared framework -->
@(_SharedFrameworkAndPackageRef->'<AspNetCoreAppReferenceAndPackage Include="%(Identity)" />', '%0A ')

<!-- These assemblies are only in the shared framework -->
@(_SharedFrameworkRef->'<AspNetCoreAppReference Include="%(Identity)" />', '%0A ')
</ItemGroup>
</Project>
]]>
</SharedFxDepListContent>
</PropertyGroup>

<WriteLinesToFile File="$(SharedFxDepList)" Lines="$(SharedFxDepListContent)" Overwrite="true" />
</Target>

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

<RepoTasks.RemoveSharedFrameworkDependencies Condition="@(_BuildOutput->Count()) != 0"
Files="@(_BuildOutput)"
FrameworkOnlyPackages="@(SharedFrameworkOnlyPackage)" />
FrameworkOnlyPackages="@(AspNetCoreAppReference)" />
</Target>

<Target Name="GenerateBuildAssetManifest">
Expand Down
1 change: 1 addition & 0 deletions docs/ProjectProperties.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ In addition to the standard set of MSBuild properties supported by Microsoft.NET
Property name | Meaning
-------------------|--------------------------------------------------------------------------------------------
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.
IsAspNetCoreApp | Set to `true` when the assembly is part of the [Microsoft.AspNetCore.App shared framework](./SharedFramework.md)
11 changes: 10 additions & 1 deletion docs/SharedFramework.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Guidance on developing the ASP.NET Core shared framework (`Microsoft.AspNetCore.

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.

* Breaking changes are highly discouraged. Therefore,
* Breaking changes are highly discouraged. Therefore,
* If it's in, it must be broadly useful and expected to be supported for at least several years.
* The API for all assemblies in shared framework MUST NOT make breaking changes in patch or minor releases.
* The complete closure of all assemblies must be in the shared framework, or must be in the "base framework", Microsoft.NETCore.App
Expand All @@ -19,3 +19,12 @@ The ASP.NET Core shared framework contains assemblies that are fully developed,
* API we believe is essential for central experiences in .NET Core should be in the shared framework
* Examples of central experiences: MVC, Kestrel, Razor, SignalR
* New API can ship as out-of-band packages first, and move into the base framework later when it meets these standards

### How to adjust what is in the shared framework

The contents of the shared framework are defined in two ways:

* [src/Framework/LocalDependencies.props](/src/Framework/LocalDependencies.props) - this file is generated from the .csproj files in this repo
by looking for projects which have set `<IsAspNetCoreApp>true</IsAspNetCoreApp>`.
* [src/Framework/Microsoft.AspNetCore.App.props](/src/Framework/Microsoft.AspNetCore.App.props) - this file lists all assemblies shipped
in Microsoft.AspNetCore.App which are built by source code found in other repositories.
4 changes: 0 additions & 4 deletions eng/Dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,13 @@ and are generated based on the last package release.
<LatestPackageReference Include="StackExchange.Redis" Version="$(StackExchangeRedisPackageVersion)" />
<LatestPackageReference Include="System.Buffers" Version="$(SystemBuffersPackageVersion)" />
<LatestPackageReference Include="System.CodeDom" Version="$(SystemCodeDomPackageVersion)" />
<LatestPackageReference Include="System.ComponentModel.Annotations" Version="$(SystemComponentModelAnnotationsPackageVersion)" />
<LatestPackageReference Include="System.Data.SqlClient" Version="$(SystemDataSqlClientPackageVersion)" />
<LatestPackageReference Include="System.Diagnostics.DiagnosticSource" Version="$(SystemDiagnosticsDiagnosticSourcePackageVersion)" />
<LatestPackageReference Include="System.Diagnostics.EventLog" Version="$(SystemDiagnosticsEventLogPackageVersion)" />
<LatestPackageReference Include="System.IdentityModel.Tokens.Jwt" Version="$(SystemIdentityModelTokensJwtPackageVersion)" />
<LatestPackageReference Include="System.IO.Pipelines" Version="$(SystemIOPipelinesPackageVersion)" />
<LatestPackageReference Include="System.Memory" Version="$(SystemMemoryPackageVersion)" />
<LatestPackageReference Include="System.Net.Http.WinHttpHandler" Version="$(SystemNetHttpWinHttpHandlerPackageVersion)" />
<LatestPackageReference Include="System.Net.Http" Version="$(SystemNetHttpPackageVersion)" />
<LatestPackageReference Include="System.Net.WebSockets.WebSocketProtocol" Version="$(SystemNetWebSocketsWebSocketProtocolPackageVersion)" />
<LatestPackageReference Include="System.Numerics.Vectors" Version="$(SystemNumericsVectorsPackageVersion)" />
<LatestPackageReference Include="System.Reactive.Linq" Version="$(SystemReactiveLinqPackageVersion)" />
<LatestPackageReference Include="System.Reflection.Metadata" Version="$(SystemReflectionMetadataPackageVersion)" />
<LatestPackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="$(SystemRuntimeCompilerServicesUnsafePackageVersion)" />
Expand Down
Loading