コード例 #1
0
        static int Main()
        {
            try
            {
                ValidateCommonHiddenProductionDependencies();
                var root = DirectoryLayout.DetermineRootDirectory();
                var apis = ApiMetadata.LoadApis();
                Console.WriteLine($"API catalog contains {apis.Count} entries");
                HashSet <string> apiNames = new HashSet <string>(apis.Select(api => api.Id));

                foreach (var api in apis)
                {
                    var path = Path.Combine(root, "apis", api.Id);
                    GenerateProjects(path, api, apiNames);
                    GenerateSolutionFiles(path, api);
                    GenerateDocumentationStub(path, api);
                    GenerateSynthConfiguration(path, api);
                    GenerateMetadataFile(path, api);
                }
                return(0);
            }
            catch (UserErrorException e)
            {
                Console.WriteLine($"Configuration error: {e.Message}");
                return(1);
            }
            catch (Exception e)
            {
                Console.WriteLine($"Failed: {e}");
                return(1);
            }
        }
コード例 #2
0
 static int Main()
 {
     try
     {
         var root = DirectoryLayout.DetermineRootDirectory();
         foreach (var api in ApiMetadata.LoadApis())
         {
             GenerateProjects(Path.Combine(root, "apis", api.Id), api);
         }
         foreach (var api in ApiMetadata.LoadApis())
         {
             GenerateSolutionFiles(Path.Combine(root, "apis", api.Id), api);
         }
         return(0);
     }
     catch (Exception e)
     {
         Console.WriteLine($"Failed: {e}");
         return(1);
     }
 }