@@ -20,7 +20,7 @@ import ApiFileGenerator from '../generators/ApiFileGenerator';
2020import { MonitoredLogger } from './MonitoredLogger' ;
2121
2222/**
23- * Options for {@link Extractor.analyzeProject }.
23+ * Options for {@link Extractor.processProject }.
2424 * @public
2525 */
2626export interface IAnalyzeProjectOptions {
@@ -161,13 +161,23 @@ export class Extractor {
161161 }
162162 }
163163
164+ /**
165+ * Invokes the API Extractor engine, using the configuration that was passed to the constructor.
166+ * @deprecated Use {@link Extractor.processProject} instead.
167+ */
168+ public analyzeProject ( options ?: IAnalyzeProjectOptions ) : void {
169+ this . processProject ( options ) ;
170+ }
171+
164172 /**
165173 * Invokes the API Extractor engine, using the configuration that was passed to the constructor.
166174 * @param options - provides additional runtime state that is NOT part of the API Extractor
167175 * config file.
168- * @returns true if there were no errors; false if the tool chain should fail the build
176+ * @returns true if there were no errors or warnings ; false if the tool chain should fail the build
169177 */
170- public analyzeProject ( options ?: IAnalyzeProjectOptions ) : void {
178+ public processProject ( options ?: IAnalyzeProjectOptions ) : boolean {
179+ this . _monitoredLogger . resetCounters ( ) ;
180+
171181 if ( ! options ) {
172182 options = { } ;
173183 }
@@ -259,6 +269,9 @@ export class Extractor {
259269 + ` to ${ expectedApiReviewShortPath } and committing it.` ) ;
260270 }
261271 }
272+
273+ // If there were any errors or warnings, then fail the build
274+ return ( this . _monitoredLogger . errorCount + this . _monitoredLogger . warningCount ) === 0 ;
262275 }
263276
264277 private _getShortFilePath ( absolutePath : string ) : string {
0 commit comments