Skip to content

Commit 626bfba

Browse files
committed
[Windows] Skip running tasks with no inputs
This is a very minor perf improvements that could help when building remotely from Windows with slow connections (i.e., from Devbox). It skips running some tasks that not always have inputs to avoid the unnecessary network round tripping.
1 parent 5aa24f9 commit 626bfba

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

dotnet/targets/Xamarin.Shared.Sdk.targets

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@
856856
<!-- Figure out which frameworks are really dynamic libraries, and only publish those -->
857857
<FilterStaticFrameworks
858858
SessionId="$(BuildSessionId)"
859-
Condition="'$(IsMacEnabled)' == 'true'"
859+
Condition="'$(IsMacEnabled)' == 'true' And '@(_FrameworkToPublish)' != ''"
860860
FrameworkToPublish="@(_FrameworkToPublish)"
861861
>
862862
<Output TaskParameter="FrameworkToPublish" ItemName="_FilteredFrameworkToPublish" />
@@ -873,7 +873,7 @@
873873
874874
-->
875875
<GetFullPaths
876-
Condition="'$(IsMacEnabled)' == 'true'"
876+
Condition="'$(IsMacEnabled)' == 'true' And '@(_FilteredFrameworkToPublish)' != ''"
877877
SessionId="$(BuildSessionId)"
878878
Items="@(_FilteredFrameworkToPublish)"
879879
Metadata="Identity;SourceDirectory"
@@ -2620,6 +2620,7 @@ global using nfloat = global::System.Runtime.InteropServices.NFloat%3B
26202620
26212621
-->
26222622
<GetFileSystemEntries
2623+
Condition="'@(_BindingPackagesFromReferencedAssembliesDirectoriesExists)' != ''"
26232624
SessionId="$(BuildSessionIdIfConnected)"
26242625
DirectoryPath="@(_BindingPackagesFromReferencedAssembliesDirectoriesExists)"
26252626
Pattern="*"

msbuild/Xamarin.iOS.Tasks.Windows/Xamarin.iOS.Common.After.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ Copyright (C) 2011-2013 Xamarin. All rights reserved.
306306
destination doesn't exist, the source is newer than the destination, or if the source and
307307
destination differ by file size.
308308
-->
309-
<Copy Condition="'$(IsMacEnabled)' == 'true'"
309+
<Copy Condition="'$(IsMacEnabled)' == 'true' And '@(_ResolvedFileToPublishAlways)' != ''"
310310
SessionId="$(BuildSessionId)"
311311
SourceFiles = "@(_ResolvedFileToPublishAlways)"
312312
DestinationFiles="@(_ResolvedFileToPublishAlways->'$(PublishDir)%(RelativePath)')"

0 commit comments

Comments
 (0)