Skip to content

Commit 88a3a74

Browse files
author
John Luo
authored
Multitarget packages to remove dependencies for source build (#12936)
1 parent 8ef2856 commit 88a3a74

File tree

31 files changed

+2628
-25
lines changed

31 files changed

+2628
-25
lines changed

eng/SharedFramework.External.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
These compilation references are necessary to compile netstandard2.0 assemblies which are in the shared framework.
9494
This references are part of Microsoft.NETCore.App, so are listed here as references to be used during compilation only.
9595
-->
96-
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netstandard2.1'">
96+
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or $(TargetFrameworks.Contains('netstandard2.0')) or '$(TargetFramework)' == 'netstandard2.1'">
9797
<_CompilationOnlyReference Include="Microsoft.Win32.Registry" />
9898
<_CompilationOnlyReference Include="System.Security.Cryptography.Cng" />
9999
<_CompilationOnlyReference Include="System.Security.Principal.Windows" />
@@ -107,7 +107,7 @@
107107
These compilation references are necessary to workaround the mismatch of what is found in the ref pack for NETCore.App and what
108108
is actually present at runtime. See https://github.com/dotnet/corefx/issues/34906
109109
-->
110-
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
110+
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0' or $(TargetFrameworks.Contains('netcoreapp3.0'))">
111111
<_CompilationOnlyReference Include="Microsoft.Win32.Registry" />
112112
<_CompilationOnlyReference Include="System.Security.Cryptography.Cng" />
113113
<_CompilationOnlyReference Include="System.Security.Principal.Windows" />
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
<!-- This file is automatically generated. -->
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.0;netcoreapp3.0</TargetFrameworks>
55
</PropertyGroup>
66
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
77
<Compile Include="Microsoft.AspNetCore.Components.netstandard2.0.cs" />
88
<Reference Include="Microsoft.AspNetCore.Authorization" />
99
<Reference Include="Microsoft.JSInterop" />
1010
<Reference Include="System.ComponentModel.Annotations" />
1111
</ItemGroup>
12+
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
13+
<Compile Include="Microsoft.AspNetCore.Components.netcoreapp3.0.cs" />
14+
<Reference Include="Microsoft.AspNetCore.Authorization" />
15+
<Reference Include="Microsoft.JSInterop" />
16+
</ItemGroup>
1217
</Project>

src/Components/Components/ref/Microsoft.AspNetCore.Components.netcoreapp3.0.cs

Lines changed: 681 additions & 0 deletions
Large diffs are not rendered by default.

src/Components/Components/src/Microsoft.AspNetCore.Components.csproj

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.0</TargetFramework>
4+
<TargetFrameworks>netstandard2.0;netcoreapp3.0</TargetFrameworks>
5+
<TargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">netcoreapp3.0</TargetFrameworks>
56
<Description>Components feature for ASP.NET Core.</Description>
67
<GenerateDocumentationFile>true</GenerateDocumentationFile>
78
<IsShippingPackage>true</IsShippingPackage>
@@ -17,6 +18,9 @@
1718
<ItemGroup>
1819
<Reference Include="Microsoft.AspNetCore.Authorization" />
1920
<Reference Include="Microsoft.JSInterop" />
21+
</ItemGroup>
22+
23+
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
2024
<Reference Include="System.ComponentModel.Annotations" />
2125
</ItemGroup>
2226

@@ -34,15 +38,17 @@
3438

3539
<!-- Pack settings -->
3640
<PropertyGroup>
37-
<NuspecFile>Microsoft.AspNetCore.Components.nuspec</NuspecFile>
41+
<NuspecFile>Microsoft.AspNetCore.Components.multitarget.nuspec</NuspecFile>
42+
<NuspecFile Condition="'$(DotNetBuildFromSource)' == 'true'">Microsoft.AspNetCore.Components.netcoreapp3.0.nuspec</NuspecFile>
3843
<GenerateNuspecDependsOn>$(GenerateNuspecDependsOn);_GetNuspecDependencyPackageVersions</GenerateNuspecDependsOn>
3944
</PropertyGroup>
4045

4146
<ItemGroup>
4247
<NuspecProperty Include="jsInteropPackageVersion=$(MicrosoftJSInteropPackageVersion)" />
43-
<NuspecProperty Include="systemComponentModelAnnotationsPackageVersion=$(SystemComponentModelAnnotationsPackageVersion)" />
44-
<NuspecProperty Include="outputPath=$(OutputPath)" />
45-
<NuspecProperty Include="assemblyName=$(AssemblyName)" />
48+
<NuspecProperty Condition="'$(DotNetBuildFromSource)' != 'true'" Include="systemComponentModelAnnotationsPackageVersion=$(SystemComponentModelAnnotationsPackageVersion)" />
49+
<NuspecProperty Include="OutputBinary=$(MSBuildProjectDirectory)\$(OutputPath)**\$(AssemblyName).dll" />
50+
<NuspecProperty Include="OutputSymbol=$(MSBuildProjectDirectory)\$(OutputPath)**\$(AssemblyName).pdb" />
51+
<NuspecProperty Include="OutputDocumentation=$(MSBuildProjectDirectory)\$(OutputPath)**\$(AssemblyName).xml" />
4652
</ItemGroup>
4753

4854
</Project>

src/Components/Components/src/Microsoft.AspNetCore.Components.nuspec renamed to src/Components/Components/src/Microsoft.AspNetCore.Components.multitarget.nuspec

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,17 @@
99
<dependency id="Microsoft.JSInterop" version="$jsInteropPackageVersion$" exclude="Build,Analyzers" />
1010
<dependency id="System.ComponentModel.Annotations" version="$systemComponentModelAnnotationsPackageVersion$" exclude="Build,Analyzers" />
1111
</group>
12+
<group targetFramework=".NETCoreApp3.0">
13+
<dependency id="Microsoft.AspNetCore.Components.Analyzers" version="$componentAnalyzerPackageVersion$" />
14+
<dependency id="Microsoft.AspNetCore.Authorization" version="$authorizationPackageVersion$" exclude="Build,Analyzers" />
15+
<dependency id="Microsoft.JSInterop" version="$jsInteropPackageVersion$" exclude="Build,Analyzers" />
16+
</group>
1217
</dependencies>
1318
</metadata>
1419
<files>
15-
<file src="$outputPath$$assemblyName$.dll" target="lib\netstandard2.0\$assemblyname$.dll" />
16-
<file src="$outputPath$$assemblyName$.xml" target="lib\netstandard2.0\$assemblyname$.xml" />
17-
<file src="$outputPath$$assemblyName$.pdb" target="lib\netstandard2.0\$assemblyname$.pdb" />
20+
<file src="$OutputBinary$" target="lib\" />
21+
<file src="$OutputDocumentation$" target="lib\" />
22+
<file src="$OutputSymbol$" target="lib\" />
1823
<file src="..\..\THIRD-PARTY-NOTICES.txt" target=".\THIRD-PARTY-NOTICES.txt" />
1924
</files>
2025
</package>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
3+
<metadata>
4+
$CommonMetadataElements$
5+
<dependencies>
6+
<group targetFramework=".NETCoreApp3.0">
7+
<dependency id="Microsoft.AspNetCore.Components.Analyzers" version="$componentAnalyzerPackageVersion$" />
8+
<dependency id="Microsoft.AspNetCore.Authorization" version="$authorizationPackageVersion$" exclude="Build,Analyzers" />
9+
<dependency id="Microsoft.JSInterop" version="$jsInteropPackageVersion$" exclude="Build,Analyzers" />
10+
</group>
11+
</dependencies>
12+
</metadata>
13+
<files>
14+
<file src="$OutputBinary$" target="lib\" />
15+
<file src="$OutputDocumentation$" target="lib\" />
16+
<file src="$OutputSymbol$" target="lib\" />
17+
<file src="..\..\THIRD-PARTY-NOTICES.txt" target=".\THIRD-PARTY-NOTICES.txt" />
18+
</files>
19+
</package>
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
<!-- This file is automatically generated. -->
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.0;netcoreapp3.0</TargetFrameworks>
55
</PropertyGroup>
66
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
77
<Compile Include="Microsoft.AspNetCore.Components.Web.netstandard2.0.cs" />
88
<Reference Include="Microsoft.AspNetCore.Components" />
99
<Reference Include="Microsoft.Extensions.DependencyInjection" />
1010
</ItemGroup>
11+
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
12+
<Compile Include="Microsoft.AspNetCore.Components.Web.netcoreapp3.0.cs" />
13+
<Reference Include="Microsoft.AspNetCore.Components" />
14+
<Reference Include="Microsoft.Extensions.DependencyInjection" />
15+
</ItemGroup>
1116
</Project>

0 commit comments

Comments
 (0)