LoadProjectConfigurations() abstract private method

Parses the Visual Studio project metadata entries from the manifest. These are used when generating project files for a service. Sets the ProjectFileConfigurations member on exit with the collection of loaded configurations.
abstract private LoadProjectConfigurations ( JsonData document ) : void
document JsonData
return void
Esempio n. 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);
        }
Esempio n. 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;
        }
Esempio n. 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;
        }