diff --git a/eng/Versions.props b/eng/Versions.props index c46fb09fd9a..20873217009 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -2,7 +2,7 @@ - 16.11.0 + 16.11.1 release 15.1.0.0 preview diff --git a/ref/Microsoft.Build.Tasks.Core/net/Microsoft.Build.Tasks.Core.cs b/ref/Microsoft.Build.Tasks.Core/net/Microsoft.Build.Tasks.Core.cs index c94de3e3688..0e39d539eba 100644 --- a/ref/Microsoft.Build.Tasks.Core/net/Microsoft.Build.Tasks.Core.cs +++ b/ref/Microsoft.Build.Tasks.Core/net/Microsoft.Build.Tasks.Core.cs @@ -207,6 +207,8 @@ public Copy() { } public Microsoft.Build.Framework.ITaskItem[] SourceFiles { get { throw null; } set { } } public bool UseHardlinksIfPossible { get { throw null; } set { } } public bool UseSymboliclinksIfPossible { get { throw null; } set { } } + [Microsoft.Build.Framework.OutputAttribute] + public bool WroteAtLeastOneFile { get { throw null; } } public void Cancel() { } public override bool Execute() { throw null; } } diff --git a/ref/Microsoft.Build.Tasks.Core/netstandard/Microsoft.Build.Tasks.Core.cs b/ref/Microsoft.Build.Tasks.Core/netstandard/Microsoft.Build.Tasks.Core.cs index 27ba53105be..18bd0c97245 100644 --- a/ref/Microsoft.Build.Tasks.Core/netstandard/Microsoft.Build.Tasks.Core.cs +++ b/ref/Microsoft.Build.Tasks.Core/netstandard/Microsoft.Build.Tasks.Core.cs @@ -137,6 +137,8 @@ public Copy() { } public Microsoft.Build.Framework.ITaskItem[] SourceFiles { get { throw null; } set { } } public bool UseHardlinksIfPossible { get { throw null; } set { } } public bool UseSymboliclinksIfPossible { get { throw null; } set { } } + [Microsoft.Build.Framework.OutputAttribute] + public bool WroteAtLeastOneFile { get { throw null; } } public void Cancel() { } public override bool Execute() { throw null; } } diff --git a/src/Tasks/Copy.cs b/src/Tasks/Copy.cs index ba793b673d6..e22b7cc2372 100644 --- a/src/Tasks/Copy.cs +++ b/src/Tasks/Copy.cs @@ -139,6 +139,9 @@ public Copy() [Output] public ITaskItem[] CopiedFiles { get; private set; } + [Output] + public bool WroteAtLeastOneFile { get; private set; } + /// /// Whether to overwrite files in the destination /// that have the read-only attribute set. @@ -298,6 +301,9 @@ FileState destinationFileState // The destination file File.Copy(sourceFileState.Name, destinationFileState.Name, true); } + + // Files were successfully copied or linked. Those are equivalent here. + WroteAtLeastOneFile = true; destinationFileState.Reset(); diff --git a/src/Tasks/Microsoft.Common.CurrentVersion.targets b/src/Tasks/Microsoft.Common.CurrentVersion.targets index 94eb7fac321..0f2b8dea415 100644 --- a/src/Tasks/Microsoft.Common.CurrentVersion.targets +++ b/src/Tasks/Microsoft.Common.CurrentVersion.targets @@ -4690,6 +4690,7 @@ Copyright (C) Microsoft Corporation. All rights reserved. + @@ -4699,7 +4700,7 @@ Copyright (C) Microsoft Corporation. All rights reserved. input to projects that reference this one. --> + Condition="'@(ReferencesCopiedInThisBuild)' != '' and '$(WroteAtLeastOneFile)' == 'true'">