Skip to content

Commit e5fc7c2

Browse files
committed
Better trimming support + trimming fix
- Allow for trimming to be set in SourceBuild.props. This enables use in repo SB legs. Includes a default set which is all netcoreapps + netstandards. - Disable trimming for top level projects in Arcade, so that we don't accidentally skip things like publishing.
1 parent 7f6d979 commit e5fc7c2

File tree

8 files changed

+33
-0
lines changed

8 files changed

+33
-0
lines changed

src/Microsoft.DotNet.Arcade.Sdk/tools/AfterSigning.proj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. -->
22
<Project>
3+
<PropertyGroup>
4+
<NoTargetFrameworkFiltering>true</NoTargetFrameworkFiltering>
5+
</PropertyGroup>
36
<Import Project="BuildStep.props" />
47

58
<Target Name="Rebuild" DependsOnTargets="Clean;Build" />

src/Microsoft.DotNet.Arcade.Sdk/tools/AfterSolutionBuild.proj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. -->
22
<Project>
3+
<PropertyGroup>
4+
<!-- Disable target framework filtering for top level projects -->
5+
<NoTargetFrameworkFiltering>true</NoTargetFrameworkFiltering>
6+
</PropertyGroup>
7+
38
<Import Project="BuildStep.props" />
49

510
<Target Name="Rebuild" DependsOnTargets="Clean;Build" />

src/Microsoft.DotNet.Arcade.Sdk/tools/Build.proj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434

3535
<PropertyGroup>
3636
<_OriginalProjectsValue>$(Projects)</_OriginalProjectsValue>
37+
<!-- Disable target framework filtering for top level projects -->
38+
<NoTargetFrameworkFiltering>true</NoTargetFrameworkFiltering>
3739
</PropertyGroup>
3840

3941
<ItemDefinitionGroup>

src/Microsoft.DotNet.Arcade.Sdk/tools/Publish.proj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. -->
22
<Project DefaultTargets="Publish">
3+
4+
<PropertyGroup>
5+
<!-- Disable target framework filtering for top level projects -->
6+
<NoTargetFrameworkFiltering>true</NoTargetFrameworkFiltering>
7+
</PropertyGroup>
8+
39
<!--
410
Documentation for publishing is available here:
511
- https://github.com/dotnet/arcade/blob/master/Documentation/CorePackages/Publishing.md

src/Microsoft.DotNet.Arcade.Sdk/tools/RepositoryValidation.proj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. -->
33
<Project DefaultTargets="Validate">
44

5+
<PropertyGroup>
6+
<!-- Disable target framework filtering for top level projects -->
7+
<NoTargetFrameworkFiltering>true</NoTargetFrameworkFiltering>
8+
</PropertyGroup>
9+
510
<Import Project="BuildTasks.props" />
611

712
<UsingTask TaskName="Microsoft.DotNet.Arcade.Sdk.ValidateLicense" AssemblyFile="$(ArcadeSdkBuildTasksAssembly)" />

src/Microsoft.DotNet.Arcade.Sdk/tools/Sign.proj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. -->
22
<Project DefaultTargets="Sign">
3+
4+
<PropertyGroup>
5+
<!-- Disable target framework filtering for top level projects -->
6+
<NoTargetFrameworkFiltering>true</NoTargetFrameworkFiltering>
7+
</PropertyGroup>
8+
39
<Import Project="BuildStep.props" />
410

511
<Import Project="$(NuGetPackageRoot)microsoft.dotnet.signtool\$(MicrosoftDotNetSignToolVersion)\build\Microsoft.DotNet.SignTool.props" />

src/Microsoft.DotNet.Arcade.Sdk/tools/SourceBuild/SourceBuildArcade.targets

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@
2828
<DetectSourceBuildIntermediateNupkgLicense Condition="'$(DetectSourceBuildIntermediateNupkgLicense)' == ''">true</DetectSourceBuildIntermediateNupkgLicense>
2929

3030
<EnableDefaultSourceBuildIntermediateItems Condition="'$(EnableDefaultSourceBuildIntermediateItems)' == ''">true</EnableDefaultSourceBuildIntermediateItems>
31+
32+
<!-- This is fed into the inner source build as an environment variable (DotNetTargetFrameworkFilter) to enable filtering.
33+
The default target framework filter includes all recent netcoreapps in SBRP, as well as 8.0 (latest) and 7.0 (working to get rid of it -->
34+
<_DefaultNetFrameworkFilter>netcoreapp%3bnetstandard%3bnet5.0%3bnet6.0%3bnet7.0%3bnet8.0%3b</_DefaultNetFrameworkFilter>
35+
<SourceBuildTargetFrameworkFilter Condition="'$(SourceBuildTrimNetFrameworkTargets)' == 'true' and '$(SourceBuildTargetFrameworkFilter)' == ''">$(_DefaultNetFrameworkFilter)</SourceBuildTargetFrameworkFilter>
3136
</PropertyGroup>
3237

3338
<Target Name="GetSourceBuildIntermediateNupkgNameConvention">

src/Microsoft.DotNet.Arcade.Sdk/tools/SourceBuild/SourceBuildArcadeBuild.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
<ItemGroup>
9393
<!-- Override package cache to separate source-built packages from upstream. -->
9494
<InnerBuildEnv Include="NUGET_PACKAGES=$(CurrentRepoSourceBuildPackageCache)" />
95+
<InnerBuildEnv Include="DotNetTargetFrameworkFilter=$(SourceBuildTargetFrameworkFilter)" />
9596
</ItemGroup>
9697
</Target>
9798

0 commit comments

Comments
 (0)