コード例 #1
0
        public Task <Process> Install(ConanProject project, ConanConfiguration configuration, ConanGeneratorType generator, ConanBuildType build, bool update)
        {
            string ProcessArgument(string name, string value) => $"-s {name}={Escape(value)}";

            var arguments = string.Empty;

            if (_conanSettings != null)
            {
                var installConfig = _conanSettings.ConanCommands.FirstOrDefault(c => c.Name.Equals("install"));
                arguments = installConfig.Args;
            }
            else
            {
                string generatorName = generator.ToString();
                var    settingValues = new[]
コード例 #2
0
        public ProcessStartInfo Install(ConanProject project, ConanConfiguration configuration, ConanGeneratorType generator, ConanBuildType build, bool update, Core.IErrorListService errorListService)
        {
            string ProcessArgument(string name, string value) => $"-s {name}={Escape(value)}";

            var arguments = string.Empty;

            string profile = project.getProfile(configuration, errorListService);

            if (profile != null)
            {
                string generatorName = generator.ToString();
                arguments = $"install {Escape(project.Path)} " +
                            $"-g {generatorName} " +
                            $"--install-folder {Escape(configuration.InstallPath)} " +
                            $"--profile {Escape(profile)}" +
                            $"{BuildOptions(build, update)}";
            }
            else
            {
                string generatorName = generator.ToString();
                var    settingValues = new[]
コード例 #3
0
        public Task <Process> Install(ConanProject project, ConanConfiguration configuration, ConanGeneratorType generator, ConanBuildType build, bool update, Core.IErrorListService errorListService)
        {
            string ProcessArgument(string name, string value) => $"-s {name}={Escape(value)}";

            var arguments = string.Empty;

            string profile = project.getProfile(configuration, errorListService);

            if (profile != null)
            {
                string generatorName = generator.ToString();
                string options       = "";
                if (build != ConanBuildType.none)
                {
                    options += " --build " + build.ToString();
                }
                if (update)
                {
                    options += " --update";
                }

                arguments = $"install {Escape(project.Path)} " +
                            $"-g {generatorName} " +
                            $"--install-folder {Escape(configuration.InstallPath)} " +
                            $"--profile {Escape(profile)}" +
                            $"{options}";
            }
            else if (_conanSettings != null)
            {
                var installConfig = _conanSettings.ConanCommands.FirstOrDefault(c => c.Name.Equals("install"));
                arguments = installConfig.Args;
            }
            else
            {
                string generatorName = generator.ToString();
                var    settingValues = new[]
コード例 #4
0
 public string getProfile(ConanConfiguration configuration, Core.IErrorListService errorListService)
 {
     if (!File.Exists(ConfigFile))
     {
         return(null);
     }
     try
     {
         JObject jObject = JObject.Parse(File.ReadAllText(ConfigFile));
         var     configs = jObject["configurations"].ToObject <Dictionary <string, string> >();
         configs.TryGetValue(configuration.VSName, out string conanProfile);
         if (conanProfile == null)
         {
             errorListService.WriteWarning($"File for Conan configuration found at '{ConfigFile}'," +
                                           $" but no profile declared for VS configuration '{configuration.VSName}'");
         }
         return(conanProfile);
     }
     catch (Exception)
     {
         errorListService.WriteError($"Error parsing Conan configuration from file '{ConfigFile}'");
         return(null);
     }
 }