@@ -198,46 +198,11 @@ public void RunDocfx(FilePath docfxJson)
198
198
199
199
var currentDirectory = Directory . GetCurrentDirectory ( ) ;
200
200
Directory . SetCurrentDirectory ( docfxJson . GetDirectory ( ) . FullPath ) ;
201
- DocfxGenerateMetadata ( docfxJson . FullPath ) ;
201
+ Microsoft . DocAsCode . Dotnet . DotnetApiCatalog . GenerateManagedReferenceYamlFiles ( docfxJson . FullPath ) . Wait ( ) ;
202
202
Microsoft . DocAsCode . Docset . Build ( docfxJson . FullPath ) . Wait ( ) ;
203
203
Directory . SetCurrentDirectory ( currentDirectory ) ;
204
204
}
205
205
206
- private void DocfxGenerateMetadata ( string configPath )
207
- {
208
- Microsoft . DocAsCode . Common . Logger . RegisterListener ( new Microsoft . DocAsCode . Common . ConsoleLogListener ( ) ) ;
209
- try
210
- {
211
- string directoryName = System . IO . Path . GetDirectoryName ( System . IO . Path . GetFullPath ( configPath ) ) ;
212
- Newtonsoft . Json . Linq . JToken jtoken ;
213
- if ( ! Newtonsoft . Json . Linq . JObject . Parse ( File . ReadAllText ( configPath ) ) . TryGetValue ( "metadata" , out jtoken ) )
214
- return ;
215
-
216
- var dotnetApiCatalogType = typeof ( Microsoft . DocAsCode . Dotnet . DotnetApiOptions ) . Assembly . GetTypes ( )
217
- . First ( t => t . Name == "DotnetApiCatalog" ) ;
218
- var dotnetApiCatalogExecMethod = dotnetApiCatalogType . GetMethod ( "Exec" , BindingFlags . Static | BindingFlags . NonPublic ) ;
219
- var metadataJsonConfigType = typeof ( Microsoft . DocAsCode . Dotnet . DotnetApiOptions ) . Assembly . GetTypes ( )
220
- . First ( t => t . Name == "MetadataJsonConfig" ) ;
221
-
222
- var config = jtoken . ToObject ( metadataJsonConfigType , Microsoft . DocAsCode . Common . JsonUtility . DefaultSerializer . Value ) ;
223
-
224
- var execTask = ( Task ) dotnetApiCatalogExecMethod . Invoke ( null , new [ ]
225
- {
226
- config ,
227
- new Microsoft . DocAsCode . Dotnet . DotnetApiOptions ( ) ,
228
- directoryName ,
229
- null
230
- } ) ;
231
- execTask . Wait ( ) ;
232
- }
233
- finally
234
- {
235
- Microsoft . DocAsCode . Common . Logger . Flush ( ) ;
236
- Microsoft . DocAsCode . Common . Logger . PrintSummary ( ) ;
237
- Microsoft . DocAsCode . Common . Logger . UnregisterAllListeners ( ) ;
238
- }
239
- }
240
-
241
206
public void GenerateRedirects ( )
242
207
{
243
208
var redirectProjectFile = RedirectProjectDirectory . CombineWithFilePath ( "RedirectGenerator.csproj" ) ;
0 commit comments