/// <summary> /// Create an instance of <see cref="ProjectAnalyzer"/>. /// </summary> public ProjectAnalyzer(ILogger logger, IDesignTimeBuildRunner designTimeBuilder, IBuildCheckProvider checkProvider, bool verboseOutput = false) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _designTimeBuilder = designTimeBuilder ?? throw new ArgumentNullException(nameof(designTimeBuilder)); _checkProvider = checkProvider ?? throw new ArgumentNullException(nameof(checkProvider)); _verboseOutput = verboseOutput; }
private static bool ProjectAnalyzerIsUpToDateCall(string projectFile, ILogger logger = null, IDesignTimeBuildRunner runner = null, IBuildCheckProvider checks = null, bool cleanUp = true) { try { var usedLogger = logger ?? new ConsoleLogger(false); ProjectAnalyzer analyzer = new ProjectAnalyzer( usedLogger, runner ?? new DesignTimeBuildRunner(usedLogger, null), checks ?? new BuildCheckProvider()); (bool isUpToDate, string failureMessage) = analyzer.IsBuildUpToDate(projectFile); return(isUpToDate); } finally { if (cleanUp) { TestUtilities.CleanUpTestProject(projectFile); } } }