File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -158,6 +158,17 @@ export class Extractor {
158158 return analysisFilePaths ;
159159 }
160160
161+ /**
162+ * Invokes the API Extractor engine, using the api extractor configuration file.
163+ * @param jsonConfigFile - Path to api extractor json config file.
164+ * @param options - IExtractor options.
165+ */
166+ public static processProjectFromConfigFile ( jsonConfigFile : string , options ?: IExtractorOptions ) : void {
167+ const configObject : IExtractorConfig = JsonFile . loadAndValidate ( jsonConfigFile , Extractor . jsonSchema ) ;
168+ const extractor : Extractor = new Extractor ( configObject , options ) ;
169+ extractor . processProject ( ) ;
170+ }
171+
161172 private static _applyConfigDefaults ( config : IExtractorConfig ) : IExtractorConfig {
162173 // Use the provided config to override the defaults
163174 const normalized : IExtractorConfig = lodash . merge (
Original file line number Diff line number Diff line change 1+ {
2+ "changes" : [
3+ {
4+ "packageName" : " @microsoft/api-extractor" ,
5+ "comment" : " Added an api to invoke api extractor processor by supplying api extractor json config file." ,
6+ "type" : " minor"
7+ }
8+ ],
9+ "packageName" : " @microsoft/api-extractor" ,
10+ "email" : " sunilsurana@users.noreply.github.com"
11+ }
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ class Extractor {
1919 static generateFilePathsForAnalysis ( inputFilePaths : string [ ] ) : string [ ] ;
2020 static jsonSchema : JsonSchema ;
2121 processProject ( options ?: IAnalyzeProjectOptions ) : boolean ;
22+ static processProjectFromConfigFile ( jsonConfigFile : string , options ?: IExtractorOptions ) : void ;
2223}
2324
2425// @public
You can’t perform that action at this time.
0 commit comments