@@ -16,7 +16,8 @@ interface IBuildRule
1616 /// Analyse the files and produce a build script.
1717 /// </summary>
1818 /// <param name="builder">The files and options relating to the build.</param>
19- BuildScript Analyse ( Autobuilder builder ) ;
19+ /// <param name="auto">Whether this build rule is being automatically applied.</param>
20+ BuildScript Analyse ( Autobuilder builder , bool auto ) ;
2021 }
2122
2223 /// <summary>
@@ -135,9 +136,9 @@ public Autobuilder(IBuildActions actions, AutobuildOptions options)
135136 foreach ( var solution in options . Solution )
136137 {
137138 if ( actions . FileExists ( solution ) )
138- ret . Add ( new Solution ( this , solution ) ) ;
139+ ret . Add ( new Solution ( this , solution , true ) ) ;
139140 else
140- Log ( Severity . Error , $ "The specified solution file { solution } was not found") ;
141+ Log ( Severity . Error , $ "The specified project or solution file { solution } was not found") ;
141142 }
142143 return ret ;
143144 }
@@ -172,7 +173,7 @@ IEnumerable<IProjectOrSolution> FindFiles(string extension, Func<string, Project
172173 return ret ;
173174
174175 // Then look for `.sln` files
175- ret = FindFiles ( ".sln" , f => new Solution ( this , f ) ) ? . ToList ( ) ;
176+ ret = FindFiles ( ".sln" , f => new Solution ( this , f , false ) ) ? . ToList ( ) ;
176177 if ( ret != null )
177178 return ret ;
178179
@@ -250,17 +251,17 @@ BuildScript CheckExtractorRun(bool warnOnFailure) =>
250251 switch ( GetCSharpBuildStrategy ( ) )
251252 {
252253 case CSharpBuildStrategy . CustomBuildCommand :
253- attempt = new BuildCommandRule ( ) . Analyse ( this ) & CheckExtractorRun ( true ) ;
254+ attempt = new BuildCommandRule ( ) . Analyse ( this , false ) & CheckExtractorRun ( true ) ;
254255 break ;
255256 case CSharpBuildStrategy . Buildless :
256257 // No need to check that the extractor has been executed in buildless mode
257- attempt = new StandaloneBuildRule ( ) . Analyse ( this ) ;
258+ attempt = new StandaloneBuildRule ( ) . Analyse ( this , false ) ;
258259 break ;
259260 case CSharpBuildStrategy . MSBuild :
260- attempt = new MsBuildRule ( ) . Analyse ( this ) & CheckExtractorRun ( true ) ;
261+ attempt = new MsBuildRule ( ) . Analyse ( this , false ) & CheckExtractorRun ( true ) ;
261262 break ;
262263 case CSharpBuildStrategy . DotNet :
263- attempt = new DotNetRule ( ) . Analyse ( this ) & CheckExtractorRun ( true ) ;
264+ attempt = new DotNetRule ( ) . Analyse ( this , false ) & CheckExtractorRun ( true ) ;
264265 break ;
265266 case CSharpBuildStrategy . Auto :
266267 var cleanTrapFolder =
@@ -285,20 +286,20 @@ BuildScript IntermediateAttempt(BuildScript s) =>
285286
286287 attempt =
287288 // First try .NET Core
288- IntermediateAttempt ( new DotNetRule ( ) . Analyse ( this ) ) |
289+ IntermediateAttempt ( new DotNetRule ( ) . Analyse ( this , true ) ) |
289290 // Then MSBuild
290- ( ( ) => IntermediateAttempt ( new MsBuildRule ( ) . Analyse ( this ) ) ) |
291+ ( ( ) => IntermediateAttempt ( new MsBuildRule ( ) . Analyse ( this , true ) ) ) |
291292 // And finally look for a script that might be a build script
292- ( ( ) => new BuildCommandAutoRule ( ) . Analyse ( this ) & CheckExtractorRun ( true ) ) |
293+ ( ( ) => new BuildCommandAutoRule ( ) . Analyse ( this , true ) & CheckExtractorRun ( true ) ) |
293294 // All attempts failed: print message
294295 AutobuildFailure ( ) ;
295296 break ;
296297 }
297298
298299 return
299300 attempt &
300- ( ( ) => new AspBuildRule ( ) . Analyse ( this ) ) &
301- ( ( ) => new XmlBuildRule ( ) . Analyse ( this ) ) ;
301+ ( ( ) => new AspBuildRule ( ) . Analyse ( this , false ) ) &
302+ ( ( ) => new XmlBuildRule ( ) . Analyse ( this , false ) ) ;
302303 }
303304
304305 /// <summary>
@@ -337,13 +338,13 @@ enum CSharpBuildStrategy
337338 BuildScript GetCppBuildScript ( )
338339 {
339340 if ( Options . BuildCommand != null )
340- return new BuildCommandRule ( ) . Analyse ( this ) ;
341+ return new BuildCommandRule ( ) . Analyse ( this , false ) ;
341342
342343 return
343344 // First try MSBuild
344- new MsBuildRule ( ) . Analyse ( this ) |
345+ new MsBuildRule ( ) . Analyse ( this , true ) |
345346 // Then look for a script that might be a build script
346- ( ( ) => new BuildCommandAutoRule ( ) . Analyse ( this ) ) |
347+ ( ( ) => new BuildCommandAutoRule ( ) . Analyse ( this , true ) ) |
347348 // All attempts failed: print message
348349 AutobuildFailure ( ) ;
349350 }
0 commit comments