private static Build LoadFromForConfig(ProjectConfig cfg) { var x = new Build(); Utils.FromString(cfg.GetConfigurationProperty("LinkTimeOptimization", false), out x.lTO); Utils.FromString(cfg.GetConfigurationProperty("DebugSymbols", false), out x.emitDebug); x.OptimizationLevel = OptimizationLevelFromString(cfg.GetConfigurationProperty("OptimizationLevel", false)); x.PlatformTarget = PlatformTargetFromString(cfg.GetConfigurationProperty("PlatformTarget", false)); return(x); }
private static Debug LoadFromForConfig(ProjectConfig cfg) { var x = new Debug(); x.StartActionQ = StartActionQFromString(cfg.GetConfigurationProperty("StartAction", false)); Utils.FromString(cfg.GetConfigurationProperty("StartProgram", false), out x.externalProgram); Utils.FromString(cfg.GetConfigurationProperty("StartArguments", false), out x.commandLineArgs); Utils.FromString(cfg.GetConfigurationProperty("StartWorkingDirectory", false), out x.workingDir); Utils.FromString(cfg.GetConfigurationProperty("StartDebuggerScript", false), out x.debuggerScript); return(x); }
public string GetRustInstallPath() { EnvDTE.Project proj = project.GetAutomationObject() as EnvDTE.Project; if (proj == null) { return(null); } string currentConfigName = Utilities.GetActiveConfigurationName(proj); if (currentConfigName == null) { return(null); } ProjectConfig currentConfig = project.ConfigProvider.GetProjectConfiguration(currentConfigName); if (currentConfig == null) { return(null); } string currentTarget = currentConfig.GetConfigurationProperty("PlatformTarget", true); if (currentTarget == null) { currentTarget = Shared.Environment.DefaultTarget; } return(Shared.Environment.FindInstallPath(currentTarget)); }
public string GetConfigProperty(string propertyName) { if (this.project != null) { string unifiedResult = null; bool cacheNeedReset = true; for (int i = 0; i < this.projectConfigs.Length; i++) { ProjectConfig config = projectConfigs[i]; string property = config.GetConfigurationProperty(propertyName, cacheNeedReset); cacheNeedReset = false; if (property != null) { string text = property.Trim(); if (i == 0) { unifiedResult = text; } else if (unifiedResult != text) { return(""); // tristate value is blank then } } } return(unifiedResult); } return(String.Empty); }
public string GetConfigProperty(string propertyName, _PersistStorageType storageType) { string unifiedResult = string.Empty; if (ProjectManager != null) { bool cacheNeedReset = true; for (int i = 0; i < _projectConfigs.Length; i++) { ProjectConfig config = _projectConfigs[i]; string property = config.GetConfigurationProperty(propertyName, storageType, cacheNeedReset); cacheNeedReset = false; if (property != null) { string text = property.Trim(); if (i == 0) { unifiedResult = text; } else if (unifiedResult != text) { unifiedResult = string.Empty; break; } } } } return(unifiedResult); }
private void InjectRustBinPath(ProcessStartInfo startInfo) { EnvDTE.Project proj = _project.GetAutomationObject() as EnvDTE.Project; if (proj == null) { return; } string currentConfigName = Utilities.GetActiveConfigurationName(proj); if (currentConfigName == null) { return; } ProjectConfig currentConfig = _project.ConfigProvider.GetProjectConfiguration(currentConfigName); if (currentConfig == null) { return; } string currentTarget = currentConfig.GetConfigurationProperty("PlatformTarget", true); if (currentTarget == null) { currentTarget = Shared.Environment.DefaultTarget; } string installPath = Shared.Environment.FindInstallPath(currentTarget); if (installPath == null) { return; } string envPath = Environment.GetEnvironmentVariable("PATH"); string newEnvPath = String.Format("{0};{1}", envPath, installPath); startInfo.EnvironmentVariables["PATH"] = newEnvPath; }