LoadServiceConfigurations() abstract private method

Parses the service configuration metadata from the supplied manifest document, fixing up file references to the actual service model and customization files. Sets the ServiceConfigurations member on exit with the collection of loaded configurations.
abstract private LoadServiceConfigurations ( JsonData manifest, string coreVersion, JsonData versions, string modelsFolder ) : void
manifest JsonData
coreVersion string
versions JsonData
modelsFolder string
return void
Beispiel #1
0
        /// <summary>
        /// Processes the control manifest to yield the set of services available to
        /// generate and the Visual Studio project file information used to create
        /// new projects for services.
        /// </summary>
        /// <param name="manifestPath">Path to the manifest file to pull basic info from</param>
        /// <param name="versionsPath">Path to _sdk-versions.json file</param>
        /// <param name="modelsFolder">Path to the service models to be parsed</param>
        public static GenerationManifest Load(string manifestPath, string versionsPath, string modelsFolder)
        {
            var generationManifest =
                new GenerationManifest(
                    new DefaultConfigurationController(
                        new FileReader(),
                        new DefaultConfigurationParser()));

            var manifest         = LoadJsonFromFile(manifestPath);
            var versionsManifest = LoadJsonFromFile(versionsPath);

            generationManifest.CoreFileVersion = versionsManifest["CoreVersion"].ToString();
            generationManifest.CoreVersion     = Utils.GetVersion(versionsManifest["OverrideCoreVersion"]?.ToString() ?? generationManifest.CoreFileVersion);

            generationManifest.DefaultToPreview = (bool)versionsManifest["DefaultToPreview"];
            if (generationManifest.DefaultToPreview)
            {
                generationManifest.PreviewLabel = (string)versionsManifest["PreviewLabel"];
            }
            if (!string.IsNullOrEmpty(generationManifest.PreviewLabel))
            {
                generationManifest.PreviewLabel = "-" + generationManifest.PreviewLabel;
            }

            generationManifest.LoadDefaultConfiguration(modelsFolder);
            generationManifest.LoadServiceConfigurations(manifest, versionsManifest["ServiceVersions"], modelsFolder);
            generationManifest.LoadProjectConfigurations(manifest);
            generationManifest.LoadUnitTestProjectConfigurations(manifest);

            return(generationManifest);
        }
Beispiel #2
0
        /// <summary>
        /// Processes the control manifest to yield the set of services available to
        /// generate and the Visual Studio project file information used to create
        /// new projects for services.
        /// </summary>
        /// <param name="manifestPath">Path to the manifest file to pull basic info from</param>
        /// <param name="modelsFolder">Path to the service models to be parsed</param>
        public static GenerationManifest Load(string manifestPath, string versionsPath, string modelsFolder)
        {
            var generationManifest = new GenerationManifest();

            var manifest         = LoadJsonFromFile(manifestPath);
            var versionsManifest = LoadJsonFromFile(versionsPath);
            var coreVersionJson  = versionsManifest["CoreVersion"];

            generationManifest.CoreFileVersion = coreVersionJson.ToString();
            var versions = versionsManifest["ServiceVersions"];

            generationManifest.DefaultToPreview = (bool)versionsManifest["DefaultToPreview"];
            if (generationManifest.DefaultToPreview)
            {
                generationManifest.PreviewLabel = (string)versionsManifest["PreviewLabel"];
            }
            if (!string.IsNullOrEmpty(generationManifest.PreviewLabel))
            {
                generationManifest.PreviewLabel = "-" + generationManifest.PreviewLabel;
            }

            generationManifest.LoadServiceConfigurations(manifest, generationManifest.CoreFileVersion, versions, modelsFolder);
            generationManifest.LoadProjectConfigurations(manifest);

            return(generationManifest);
        }
        /// <summary>
        /// Processes the control manifest to yield the set of services available to
        /// generate and the Visual Studio project file information used to create
        /// new projects for services.
        /// </summary>
        /// <param name="manifestPath">Path to the manifest file to pull basic info from</param>
        /// <param name="modelsFolder">Path to the service models to be parsed</param>
        public static GenerationManifest Load(string manifestPath, string versionsPath, string modelsFolder)
        {
            var generationManifest = new GenerationManifest();

            var manifest = LoadJsonFromFile(manifestPath);
            var versionsManifest = LoadJsonFromFile(versionsPath);
            var coreVersionJson = versionsManifest["CoreVersion"];
            generationManifest.CoreFileVersion = coreVersionJson.ToString();
            var versions = versionsManifest["ServiceVersions"];

            generationManifest.LoadServiceConfigurations(manifest, generationManifest.CoreFileVersion, versions, modelsFolder);
            generationManifest.LoadProjectConfigurations(manifest);

            return generationManifest;
        }
Beispiel #4
0
        /// <summary>
        /// Processes the control manifest to yield the set of services available to
        /// generate and the Visual Studio project file information used to create
        /// new projects for services.
        /// </summary>
        /// <param name="manifestPath">Path to the manifest file to pull basic info from</param>
        /// <param name="modelsFolder">Path to the service models to be parsed</param>
        public static GenerationManifest Load(string manifestPath, string versionsPath, string modelsFolder)
        {
            var generationManifest = new GenerationManifest();

            var manifest = LoadJsonFromFile(manifestPath);
            var versionsManifest = LoadJsonFromFile(versionsPath);
            var coreVersionJson = versionsManifest["CoreVersion"];
            generationManifest.CoreFileVersion = coreVersionJson.ToString();
            var versions = versionsManifest["ServiceVersions"];

            generationManifest.DefaultToPreview = (bool)versionsManifest["DefaultToPreview"];
			if (generationManifest.DefaultToPreview)
			{
				generationManifest.PreviewLabel = (string)versionsManifest["PreviewLabel"];
			}
            if (!string.IsNullOrEmpty(generationManifest.PreviewLabel))
                generationManifest.PreviewLabel = "-" + generationManifest.PreviewLabel;

            generationManifest.LoadServiceConfigurations(manifest, generationManifest.CoreFileVersion, versions, modelsFolder);
            generationManifest.LoadProjectConfigurations(manifest);

            return generationManifest;
        }