@@ -21,7 +21,9 @@ private MSBuildArgs(
2121 string [ ] ? getTargetResult ,
2222 string [ ] ? getResultOutputFile ,
2323 VerbosityOptions ? verbosity ,
24- string [ ] ? otherMSBuildArgs )
24+ bool noLogo ,
25+ string [ ] ? otherMSBuildArgs
26+ )
2527 {
2628 GlobalProperties = properties ;
2729 RestoreGlobalProperties = restoreProperties ;
@@ -31,6 +33,7 @@ private MSBuildArgs(
3133 GetTargetResult = getTargetResult ;
3234 GetResultOutputFile = getResultOutputFile ;
3335 Verbosity = verbosity ;
36+ NoLogo = noLogo ;
3437 OtherMSBuildArgs = otherMSBuildArgs is not null
3538 ? [ .. otherMSBuildArgs ]
3639 : new List < string > ( ) ;
@@ -51,16 +54,33 @@ private MSBuildArgs(
5154 /// </summary>
5255 public string [ ] ? RequestedTargets { get ; }
5356
57+ /// <summary>
58+ /// If specified, the list of MSBuild Property names to retrieve and report directly for this build of a single project.
59+ /// </summary>
5460 public string [ ] ? GetProperty { get ; }
5561
62+ /// <summary>
63+ /// If specified, the list of MSBuild Item names to retrieve and report directly for this build of a single project.
64+ /// </summary>
5665 public string [ ] ? GetItem { get ; }
5766
67+ /// <summary>
68+ /// If specified, the list of MSBuild Target Output/Return Items to retrieve and report directly for this build of a single project.
69+ /// </summary>
5870 public string [ ] ? GetTargetResult { get ; }
5971
72+ /// <summary>
73+ /// If specified, the list of output files to which to write --getProperty, --getItem, and --getTargetResult outputs.
74+ /// </summary>
6075 public string [ ] ? GetResultOutputFile { get ; }
6176
6277 public VerbosityOptions ? Verbosity { get ; }
6378
79+ /// <summary>
80+ /// Wether or not the MSBuild product header text should be emitted at the start of this build
81+ /// </summary>
82+ public bool NoLogo { get ; }
83+
6484 /// <summary>
6585 /// All other arguments that aren't already explicitly modeled by this structure.
6686 /// The main categories of these today are logger configurations
@@ -99,6 +119,9 @@ public static MSBuildArgs AnalyzeMSBuildArguments(IEnumerable<string> forwardedA
99119 var verbosity = parseResult . GetResult ( "--verbosity" ) is OptionResult verbosityResult
100120 ? verbosityResult . GetValueOrDefault < VerbosityOptions ? > ( )
101121 : null ;
122+ var nologo = parseResult . GetResult ( "--nologo" ) is OptionResult nologoResult
123+ ? nologoResult . GetValueOrDefault < bool > ( )
124+ : false ;
102125 var otherMSBuildArgs = parseResult . UnmatchedTokens . ToArray ( ) ;
103126 return new MSBuildArgs (
104127 properties : globalProperties ,
@@ -109,7 +132,8 @@ public static MSBuildArgs AnalyzeMSBuildArguments(IEnumerable<string> forwardedA
109132 getTargetResult : getTargetResult ,
110133 getResultOutputFile : getResultOutputFile ,
111134 otherMSBuildArgs : otherMSBuildArgs ,
112- verbosity : verbosity ) ;
135+ verbosity : verbosity ,
136+ noLogo : nologo ) ;
113137
114138 T ? TryGetValue < T > ( string name )
115139 {
@@ -120,19 +144,19 @@ public static MSBuildArgs AnalyzeMSBuildArguments(IEnumerable<string> forwardedA
120144
121145 public static MSBuildArgs FromProperties ( ReadOnlyDictionary < string , string > ? properties )
122146 {
123- return new MSBuildArgs ( properties , null , null , null , null , null , null , null , null ) ;
147+ return new MSBuildArgs ( properties , null , null , null , null , null , null , null , noLogo : false , null ) ;
124148 }
125149
126150 public static MSBuildArgs FromOtherArgs ( params ReadOnlySpan < string > args )
127151 {
128- return new MSBuildArgs ( null , null , null , null , null , null , null , null , args . ToArray ( ) ) ;
152+ return new MSBuildArgs ( null , null , null , null , null , null , null , null , noLogo : false , args . ToArray ( ) ) ;
129153 }
130154 public static MSBuildArgs FromVerbosity ( VerbosityOptions verbosity )
131155 {
132- return new MSBuildArgs ( null , null , null , null , null , null , null , verbosity , null ) ;
156+ return new MSBuildArgs ( null , null , null , null , null , null , null , verbosity , noLogo : false , null ) ;
133157 }
134158
135- public static readonly MSBuildArgs ForHelp = new ( null , null , null , null , null , null , null , null , [ "--help" ] ) ;
159+ public static readonly MSBuildArgs ForHelp = new ( null , null , null , null , null , null , null , null , noLogo : true , [ "--help" ] ) ;
136160
137161 /// <summary>
138162 /// Completely replaces the MSBuild arguments with the provided <paramref name="newArgs"/>.
@@ -148,6 +172,7 @@ public MSBuildArgs CloneWithExplicitArgs(string[] newArgs)
148172 getTargetResult : GetTargetResult ,
149173 getResultOutputFile : GetResultOutputFile ,
150174 otherMSBuildArgs : newArgs ,
175+ noLogo : NoLogo ,
151176 verbosity : Verbosity ) ;
152177 }
153178
@@ -168,6 +193,7 @@ public MSBuildArgs CloneWithAdditionalArgs(params string[] additionalArgs)
168193 GetTargetResult ,
169194 GetResultOutputFile ,
170195 Verbosity ,
196+ NoLogo ,
171197 OtherMSBuildArgs . ToArray ( ) ) ;
172198 }
173199
@@ -180,6 +206,7 @@ public MSBuildArgs CloneWithAdditionalArgs(params string[] additionalArgs)
180206 GetTargetResult ,
181207 GetResultOutputFile ,
182208 Verbosity ,
209+ NoLogo ,
183210 [ .. OtherMSBuildArgs , .. additionalArgs ] ) ;
184211 }
185212
@@ -197,6 +224,7 @@ public MSBuildArgs CloneWithAdditionalRestoreProperties(ReadOnlyDictionary<strin
197224 GetTargetResult ,
198225 GetResultOutputFile ,
199226 Verbosity ,
227+ NoLogo ,
200228 OtherMSBuildArgs . ToArray ( ) ) ;
201229 }
202230 if ( RestoreGlobalProperties is null )
@@ -210,6 +238,7 @@ public MSBuildArgs CloneWithAdditionalRestoreProperties(ReadOnlyDictionary<strin
210238 GetTargetResult ,
211239 GetResultOutputFile ,
212240 Verbosity ,
241+ NoLogo ,
213242 OtherMSBuildArgs . ToArray ( ) ) ;
214243 }
215244
@@ -227,6 +256,7 @@ public MSBuildArgs CloneWithAdditionalRestoreProperties(ReadOnlyDictionary<strin
227256 GetTargetResult ,
228257 GetResultOutputFile ,
229258 Verbosity ,
259+ NoLogo ,
230260 OtherMSBuildArgs . ToArray ( ) ) ;
231261 }
232262
@@ -244,6 +274,7 @@ public MSBuildArgs CloneWithAdditionalProperties(ReadOnlyDictionary<string, stri
244274 GetTargetResult ,
245275 GetResultOutputFile ,
246276 Verbosity ,
277+ NoLogo ,
247278 OtherMSBuildArgs . ToArray ( ) ) ;
248279 }
249280 if ( GlobalProperties is null )
@@ -257,6 +288,7 @@ public MSBuildArgs CloneWithAdditionalProperties(ReadOnlyDictionary<string, stri
257288 GetTargetResult ,
258289 GetResultOutputFile ,
259290 Verbosity ,
291+ NoLogo ,
260292 OtherMSBuildArgs . ToArray ( ) ) ;
261293 }
262294
@@ -274,6 +306,7 @@ public MSBuildArgs CloneWithAdditionalProperties(ReadOnlyDictionary<string, stri
274306 GetTargetResult ,
275307 GetResultOutputFile ,
276308 Verbosity ,
309+ NoLogo ,
277310 OtherMSBuildArgs . ToArray ( ) ) ;
278311 }
279312
@@ -291,6 +324,7 @@ public MSBuildArgs CloneWithAdditionalTargets(params ReadOnlySpan<string> additi
291324 GetTargetResult ,
292325 GetResultOutputFile ,
293326 Verbosity ,
327+ NoLogo ,
294328 OtherMSBuildArgs . ToArray ( ) ) ;
295329 }
296330
@@ -305,6 +339,22 @@ public MSBuildArgs CloneWithVerbosity(VerbosityOptions newVerbosity)
305339 GetTargetResult ,
306340 GetResultOutputFile ,
307341 newVerbosity ,
342+ NoLogo ,
343+ OtherMSBuildArgs . ToArray ( ) ) ;
344+ }
345+
346+ public MSBuildArgs CloneWithNoLogo ( bool noLogo )
347+ {
348+ return new MSBuildArgs (
349+ GlobalProperties ,
350+ RestoreGlobalProperties ,
351+ RequestedTargets ,
352+ GetProperty ,
353+ GetItem ,
354+ GetTargetResult ,
355+ GetResultOutputFile ,
356+ Verbosity ,
357+ noLogo ,
308358 OtherMSBuildArgs . ToArray ( ) ) ;
309359 }
310360
0 commit comments