Skip to content

Commit dba2627

Browse files
authored
[release/9.0] Allow disabling SB intermediate restore and prebuilt reporting (#15810)
1 parent bfbc858 commit dba2627

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

src/Microsoft.DotNet.Arcade.Sdk/tools/SourceBuild/AfterSourceBuild.proj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
<PropertyGroup>
99
<MicrosoftDotNetSourceBuildTasksBuildDir>$(NuGetPackageRoot)microsoft.dotnet.sourcebuild.tasks\$(MicrosoftDotNetSourceBuildTasksVersion)\build\</MicrosoftDotNetSourceBuildTasksBuildDir>
10+
<ReportPrebuiltUsage Condition="'$(ReportPrebuiltUsage)' == '' and '$(DotNetBuildSourceOnly)' == 'true'">true</ReportPrebuiltUsage>
1011
</PropertyGroup>
1112

1213
<Import Project="$(MicrosoftDotNetSourceBuildTasksBuildDir)Microsoft.DotNet.SourceBuild.Tasks.props" />
@@ -62,6 +63,7 @@
6263
</Target>
6364

6465
<Target Name="ReportPrebuiltUsage"
66+
Condition="'$(ReportPrebuiltUsage)' == 'true'"
6567
DependsOnTargets="WritePrebuiltUsageData">
6668
<PropertyGroup>
6769
<FailOnPrebuiltBaselineError Condition="'$(FailOnPrebuiltBaselineError)' == ''">true</FailOnPrebuiltBaselineError>

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

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
<PackageReference Include="Microsoft.DotNet.SourceBuild.Tasks" Version="$(MicrosoftDotNetSourceBuildTasksVersion)" IsImplicitlyDefined="true" />
1212
</ItemGroup>
1313

14+
<PropertyGroup>
15+
<SetUpSourceBuildIntermediateNupkgCache Condition="'$(SetUpSourceBuildIntermediateNupkgCache)' == ''">true</SetUpSourceBuildIntermediateNupkgCache>
16+
</PropertyGroup>
17+
1418
<!-- Because the condition here is rather complex, it should read as the following:
1519
- Don't collect intermediates if running the product build
1620
- Otherwise, collect if we're forcing it using SetUpSourceBuildIntermediateNupkgCache
@@ -19,9 +23,10 @@
1923
- Building in DotNetBuild mode and we're in the inner repo and this is a source-only build -->
2024
<Target Name="CollectSourceBuildIntermediateNupkgDependencies"
2125
Condition="
22-
'$(DotNetBuildFromSourceFlavor)' != 'Product' and '$(DotNetBuildOrchestrator)' != 'true' and
23-
('$(SetUpSourceBuildIntermediateNupkgCache)' == 'true' or
24-
('$(ArcadeBuildFromSource)' == 'true' and '$(ArcadeInnerBuildFromSource)' == 'true') or
26+
'$(DotNetBuildFromSourceFlavor)' != 'Product' and
27+
'$(DotNetBuildOrchestrator)' != 'true' and
28+
'$(SetUpSourceBuildIntermediateNupkgCache)' == 'true' and
29+
(('$(ArcadeBuildFromSource)' == 'true' and '$(ArcadeInnerBuildFromSource)' == 'true') or
2530
('$(DotNetBuildPhase)' == 'InnerRepo' and '$(DotNetBuildSourceOnly)' == 'true'))"
2631
DependsOnTargets="GetSourceBuildIntermediateNupkgNameConvention"
2732
BeforeTargets="CollectPackageReferences">
@@ -45,11 +50,12 @@
4550
- If building in DotNetBuild mode and we're in the inner repo and this is a source-only build -->
4651
<Target Name="SetUpSourceBuildIntermediateNupkgCache"
4752
Condition="
48-
'$(DotNetBuildFromSourceFlavor)' != 'Product' and '$(DotNetBuildOrchestrator)' != 'true' and
49-
('$(SetUpSourceBuildIntermediateNupkgCache)' == 'true' or
50-
('@(SourceBuildIntermediateNupkgReference)' != '' and
53+
'$(DotNetBuildFromSourceFlavor)' != 'Product' and
54+
'$(DotNetBuildOrchestrator)' != 'true' and
55+
'$(SetUpSourceBuildIntermediateNupkgCache)' == 'true' and
56+
'@(SourceBuildIntermediateNupkgReference)' != '' and
5157
(('$(ArcadeBuildFromSource)' == 'true' and '$(ArcadeInnerBuildFromSource)' == 'true') or
52-
('$(DotNetBuildPhase)' == 'InnerRepo' and '$(DotNetBuildSourceOnly)' == 'true'))))"
58+
('$(DotNetBuildPhase)' == 'InnerRepo' and '$(DotNetBuildSourceOnly)' == 'true'))"
5359
AfterTargets="Restore">
5460
<ItemGroup>
5561
<IntermediateNupkgSourceDir Include="$([MSBuild]::NormalizeDirectory(

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@
9393
</Target>
9494

9595
<Import Project="SourceBuild/SourceBuildArcadeTools.targets" Condition="'$(ArcadeBuildFromSource)' == 'true' or
96-
'$(DotNetBuildRepo)' == 'true' or
97-
'$(SetUpSourceBuildIntermediateNupkgCache)' == 'true'" />
96+
'$(DotNetBuildRepo)' == 'true'" />
9897

9998
<!-- Repository extensibility point -->
10099
<Import Project="$(RepositoryEngineeringDir)Tools.props" Condition="Exists('$(RepositoryEngineeringDir)Tools.props')" />

0 commit comments

Comments
 (0)