From d3d9e905630f472bb509b8dc98d110060bf03dc0 Mon Sep 17 00:00:00 2001 From: Drew Noakes Date: Mon, 27 Sep 2021 09:53:39 +1000 Subject: [PATCH 1/8] ProjectReference protocol documentation updates - Specify that `GetTargetFrameworks` is required for outer builds only - Fix some markdown formatting so that XML elements appear correctly - Remove a duplicated word --- documentation/ProjectReference-Protocol.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/documentation/ProjectReference-Protocol.md b/documentation/ProjectReference-Protocol.md index 5e2a138e3d5..29800a2e498 100644 --- a/documentation/ProjectReference-Protocol.md +++ b/documentation/ProjectReference-Protocol.md @@ -22,7 +22,7 @@ Importing `Microsoft.Common.targets` includes logic that consumes these items an ## Who this document is for -This document describes that process, including what is required of a project to be referenceable through a `ProjectReference`. It is intended for for MSBuild SDK maintainers, and those who have created a completely custom project type that needs to interoperate with other projects. It may also be of interest if you'd like to see the implementation details of references. Understanding the details should not be necessary to _use_ `ProjectReferences` in your project. +This document describes that process, including what is required of a project to be referenceable through a `ProjectReference`. It is intended for MSBuild SDK maintainers, and those who have created a completely custom project type that needs to interoperate with other projects. It may also be of interest if you'd like to see the implementation details of references. Understanding the details should not be necessary to _use_ `ProjectReferences` in your project. ## Targets related to consuming a reference @@ -51,7 +51,7 @@ These targets should exist in a project to be compatible with the common targets These targets are all defined in `Microsoft.Common.targets` and are defined in Microsoft SDKs. You should only have to implement them yourself if you require custom behavior or are authoring a project that doesn't import the common targets. -If implementing a project with an “outer” (determine what properties to pass to the real build) and “inner” (fully specified) build, only `GetTargetFrameworkProperties` is required in the “outer” build. The other targets listed can be “inner” build only. +If implementing a project with an “outer” (determine what properties to pass to the real build) and “inner” (fully specified) build, only `GetTargetFrameworkProperties` and `GetTargetFrameworks` are required in the “outer” build. The other targets listed can be “inner” build only. * `GetTargetFrameworks` tells referencing projects what options are available to the build. * It returns an item with the following metadata: @@ -106,7 +106,7 @@ As of MSBuild 16.10, it is possible to gather additional properties from referen These properties will then be gathered via the `GetTargetFrameworks` call. They will be available to the referencing project via the `AdditionalPropertiesFromProject` metadata on the `_MSBuildProjectReferenceExistent` item. The `AdditionalPropertiesFromProject` value will be an XML string which contains the values of the properties for each `TargetFramework` in the referenced project. For example: -> :warning: This format is being changed. Soon, the schema will replace with . You can opt into that behavior early by setting the _UseAttributeForTargetFrameworkInfoPropertyNames property to true. This property will have no effect after the transition is complete. +> :warning: This format is being changed. Soon, the schema will replace `` with ``. You can opt into that behavior early by setting the `_UseAttributeForTargetFrameworkInfoPropertyNames` property to true. This property will have no effect after the transition is complete. ```xml From 25176909e5da28fff6b03ec82be653847831a28a Mon Sep 17 00:00:00 2001 From: Ben Villalobos <4691428+BenVillalobos@users.noreply.github.com> Date: Tue, 5 Oct 2021 10:38:12 -0700 Subject: [PATCH 2/8] Remove unused target --- src/Tasks/Microsoft.Common.CurrentVersion.targets | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/Tasks/Microsoft.Common.CurrentVersion.targets b/src/Tasks/Microsoft.Common.CurrentVersion.targets index 8854b0cd156..4387674d46f 100644 --- a/src/Tasks/Microsoft.Common.CurrentVersion.targets +++ b/src/Tasks/Microsoft.Common.CurrentVersion.targets @@ -1937,20 +1937,6 @@ Copyright (C) Microsoft Corporation. All rights reserved. - - - + + From 2717192fa20e8a139fac92b766fcbe0447e11eb5 Mon Sep 17 00:00:00 2001 From: Ben Villalobos <4691428+BenVillalobos@users.noreply.github.com> Date: Mon, 11 Oct 2021 09:29:58 -0700 Subject: [PATCH 8/8] Revert "Only report MSB4181 when not on warnandcontinue. Always set hasloggederrors when logging an error" This reverts commit a5ceebf212e35c83d24a1a682eb910cced7c0c2c. --- Sleep.1.0.0/.signature.p7s | Bin 9468 -> 0 bytes Sleep.1.0.0/sleep.png | Bin 1629 -> 0 bytes .../Components/RequestBuilder/TaskBuilder.cs | 12 ++++++++++-- .../Components/RequestBuilder/TaskHost.cs | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) delete mode 100644 Sleep.1.0.0/.signature.p7s delete mode 100644 Sleep.1.0.0/sleep.png diff --git a/Sleep.1.0.0/.signature.p7s b/Sleep.1.0.0/.signature.p7s deleted file mode 100644 index 6621c412ef8197f875c90faffb8255fa1684f82e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9468 zcmds-cT`i^x5r5_^p5lrn)Gm!&_xlYGa!N#u|TK>0)ZrefQkta6bnTV?0^-dBQl7B zN>wR>Ac`nbm7*XZ&BD8(4LH7;dF!q9oAn<5gmX{Hx#yhy*?WIa0Giwkf>oJrMxW+{ zFhkR5a)SU(t{)14p}7H01gk6E4B`ocLm}&!0FOT!Led=J_70vTGM?zKhh}5LpwL<< z9Ss15Mxg;T3X9S}fsfS8aOC}Zrbc*kUBXTqqA}Xv%FWM)V&UbmQ^z_Kv&+L8&~^y) zv$eLs7;8JLlXh%kV@soPZ3Sqs5`YH1oCbqJpimx;_wV|JUYh)f>v#PoHU{W2=Cw3q z$U1Odo@jP}6#=t{Blw~AcIfp0Kcm3L&tZi3#&7c^QIO{T?r0G}i1C=6pC=?F1myu% zxr0?GccLF!4v=9~!T7~idKi+)K_pKPq`48&mPn)^w;2MGLY#mW8jS`P|D1(5v0!PX z_@9~v4I;C80l^>5$k-^>{G z`6@kbi|e|KY?taOc=bcrqlIs`%dC^I<~`Gfbgfz6h}L|a%@4&YPhelYR2TlC$X#?J z@1qY zD6a!x;0GYVc)$f0gbNrCXXH&LKBb}6b{xNPL;B)`UmZ6f#i*8r3j=~je%)a0IRv)> z!j!>vudCDwCQmK!rX-uCLPL(%2>MghfA&J@=@e7`yMJ>L{* zZtRqzi5Il3h;P(xx$ord$6pu~2%**toL`e;Lj>f#}dgyIl zw0F3WRe5;B#{=bu3{)mcHfZ{}9E033-+dXf?)>sA8B@J&a znL8o*#_e;tjduy*{={b~Uk)v1!3gbxnY;bMKJ%HlMz$-!%PkvI$}7E<_w#lgdC!6M zs^I4o@Sli~a_5npJ1HjbM~J&tf`b&aT-lJ$6L>MFr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&{z0b!U!^ji@I7SZ_b~^QrqJ<%Uilq z1hLk6?g_iwo8uWuda)VUEyrjXnEqNI^i-Sz3r)$k{|8Zi<#7=a!$FNj8X4oMvWK6w zx4(NreC}+0t)m37uPO#-0bGQp?zf{ck(}WWD{m3p#D0$#ZV}G+Qx{FyJ85+Hms9_F59>#y0?BC2JE-r4!M&7^_Al@(u9_FV1dyX0-nQ1}a?;-! CAo2kK diff --git a/src/Build/BackEnd/Components/RequestBuilder/TaskBuilder.cs b/src/Build/BackEnd/Components/RequestBuilder/TaskBuilder.cs index a4261264274..85e71b2c2ba 100644 --- a/src/Build/BackEnd/Components/RequestBuilder/TaskBuilder.cs +++ b/src/Build/BackEnd/Components/RequestBuilder/TaskBuilder.cs @@ -940,8 +940,16 @@ private async Task ExecuteInstantiatedTask(ITaskExecutionHost ta IBuildEngine be = host.TaskInstance.BuildEngine; if (taskReturned && !taskResult && !taskLoggingContext.HasLoggedErrors && (be is TaskHost th ? th.BuildRequestsSucceeded : false) && (be is IBuildEngine7 be7 ? !be7.AllowFailureWithoutError : true)) { - // HasLoggedErrors will not be true if WarnAndContinue is set, avoid logging an error - if (_continueOnError != ContinueOnError.WarnAndContinue) + if (_continueOnError == ContinueOnError.WarnAndContinue) + { + taskLoggingContext.LogWarning(null, + new BuildEventFileInfo(_targetChildInstance.Location), + "TaskReturnedFalseButDidNotLogError", + _taskNode.Name); + + taskLoggingContext.LogComment(MessageImportance.Normal, "ErrorConvertedIntoWarning"); + } + else { taskLoggingContext.LogError(new BuildEventFileInfo(_targetChildInstance.Location), "TaskReturnedFalseButDidNotLogError", diff --git a/src/Build/BackEnd/Components/RequestBuilder/TaskHost.cs b/src/Build/BackEnd/Components/RequestBuilder/TaskHost.cs index 90abe787f10..154ace42f96 100644 --- a/src/Build/BackEnd/Components/RequestBuilder/TaskHost.cs +++ b/src/Build/BackEnd/Components/RequestBuilder/TaskHost.cs @@ -455,8 +455,8 @@ public void LogErrorEvent(Microsoft.Build.Framework.BuildErrorEventArgs e) { e.BuildEventContext = _taskLoggingContext.BuildEventContext; _taskLoggingContext.LoggingService.LogBuildEvent(e); - } _taskLoggingContext.HasLoggedErrors = true; + } } }