/// <summary> /// Get solution configuration before edit /// </summary> private void getSolutionPlarformConfig() { DTE dte = _applicationObject as DTE; SolutionConfigurations SGS = dte.Solution.SolutionBuild.SolutionConfigurations; foreach (SolutionConfiguration SG in SGS) { string name = SG.Name; SolutionContexts SCS = SG.SolutionContexts; foreach (SolutionContext SC in SCS) { string cname = SC.ConfigurationName; string pname = SC.PlatformName; string prname = SC.ProjectName; configtableentry c = new configtableentry(); c.platform = pname; c.config = cname; c.deployable = SC.ShouldDeploy; configTable.Add(c); } } }
/// <summary> /// Set solution config after edit /// </summary> private void SolutionPlarformConfig() { DTE dte = _applicationObject as DTE; SolutionConfigurations SGS = dte.Solution.SolutionBuild.SolutionConfigurations; foreach (SolutionConfiguration SG in SGS) { string name = SG.Name; SolutionContexts SCS = SG.SolutionContexts; foreach (SolutionContext SC in SCS) { string cname = SC.ConfigurationName; string pname = SC.PlatformName; string prname = SC.ProjectName; configtableentry e = configTable.Find(i => (i.config == cname) && (i.platform == pname)); if (e != null) { configTable.Remove(e); } else { SC.ShouldDeploy = true; } } } }
public BuildRequest( BuildDependencies dependencies, Project[] primaryProjects, Project[] skippedProjects, string solutionConfiguration, string solutionPlatform, SolutionContexts solutionContexts, (string, string)[] solutionProperties
SolutionContext GetSolutionContext(int i, SolutionContexts solutionContexts) { SolutionContext solutionContext = null; try { solutionContext = solutionContexts.Item(i); } catch{ } return solutionContext; }
/// <summary> /// New Start Debug Command Events Before Execution Event Handler. Call the method responsible for building the app. /// </summary> /// <param name="Guid"> Command GUID. </param> /// <param name="ID"> Command ID. </param> /// <param name="CustomIn"> Custom IN Object. </param> /// <param name="CustomOut"> Custom OUT Object. </param> /// <param name="CancelDefault"> Cancel the default execution of the command. </param> private void startDebugCommandEvents_BeforeExecute(string Guid, int ID, object CustomIn, object CustomOut, ref bool CancelDefault) { bool bbPlatform = false; if (_dte.Solution.SolutionBuild.ActiveConfiguration != null) { SolutionContexts scCollection = _dte.Solution.SolutionBuild.ActiveConfiguration.SolutionContexts; foreach (SolutionContext sc in scCollection) { if (sc.PlatformName == "BlackBerry" || sc.PlatformName == "BlackBerrySimulator") { bbPlatform = true; if (sc.PlatformName == "BlackBerrySimulator") { _isSimulator = true; } else { _isSimulator = false; } } } } Debug.WriteLine("Before Start Debug"); if (VSNDK.Package.ControlDebugEngine.isDebugEngineRunning || !bbPlatform) { // Disable the override of F5 (this allows the debugged process to continue execution) CancelDefault = false; } else { // Create a reference to the Output window. // Create a tool window reference for the Output window // and window pane. OutputWindow ow = ((DTE2)_dte).ToolWindows.OutputWindow; // Select the Build pane in the Output window. _owP = ow.OutputWindowPanes.Item("Build"); _owP.Activate(); UpdateManagerData upData = new UpdateManagerData(this); if (!upData.validateDeviceVersion(_isSimulator)) { CancelDefault = true; } else { BuildBar(); CancelDefault = true; } } }
SolutionContext GetSolutionContext(int i, SolutionContexts solutionContexts) { SolutionContext solutionContext = null; try { solutionContext = solutionContexts.Item(i); } catch { } return(solutionContext); }
public BuildRequest( BuildDependencies dependencies, Project[] primaryProjects, Project[] skippedProjects, string solutionConfiguration, string solutionPlatform, SolutionContexts solutionContexts, string SolutionDir) { var allProjects = primaryProjects.Concat(skippedProjects).ToArray(); var allOrdered = Projects.SortByBuildOrder(dependencies, allProjects); Dictionary <string, (string, string)[]> fixedProjectProperties = new Dictionary <string, (string, string)[]>();
void GetSolutionContext(string projectFileName, Action <SolutionContext> contextAction) { SolutionContexts solutionContexts = CodeRush.Solution.Active.DTE.Solution.SolutionBuild.ActiveConfiguration.SolutionContexts; for (int i = 0; i < solutionContexts.Count + 1; i++) { SolutionContext solutionContext = GetSolutionContext(i, solutionContexts); if (solutionContext != null && Path.GetFileName(projectFileName) == Path.GetFileName(solutionContext.ProjectName)) { contextAction.Invoke(solutionContext); } } }
// call every build as it could be a different solution private uint numProjectsToBeBuilt() { SolutionContexts solutionContexts = _vspkg.dte.Solution.SolutionBuild.ActiveConfiguration.SolutionContexts; uint num = 0; for (int i = 1; i <= solutionContexts.Count; ++i) { if (solutionContexts.Item(i).ShouldBuild) { ++num; } } return(num); }
public static void SetBuildConfigurationOff(SolutionConfigurations buildConfigurations, string projectName) { foreach (SolutionConfiguration buildConfiguration in buildConfigurations) { if (!string.Equals(buildConfiguration.Name, Resource.Constant_ProjectBuildConfig_Debug, StringComparison.CurrentCultureIgnoreCase) && !string.Equals(buildConfiguration.Name, Resource.Constant_ProjectBuildConfig_Release, StringComparison.CurrentCultureIgnoreCase)) { continue; } SolutionContexts contexts = buildConfiguration.SolutionContexts; foreach (SolutionContext solutionContext in contexts) { if (solutionContext.ProjectName == projectName) { solutionContext.ShouldBuild = false; } } } }
public static void SetBuildConfigurationOff(SolutionConfigurations buildConfigurations, string projectName) { foreach (SolutionConfiguration buildConfiguration in buildConfigurations) { //Localize these? if (buildConfiguration.Name != "Debug" && buildConfiguration.Name != "Release") { continue; } SolutionContexts contexts = buildConfiguration.SolutionContexts; foreach (SolutionContext solutionContext in contexts) { if (solutionContext.ProjectName == projectName) { solutionContext.ShouldBuild = false; } } } }
/// <summary> /// Gets the number of projects to be built based on the active solution configuration. /// </summary> private int getNumberOfProjectsToBeBuilt() { SolutionContexts solutionContexts = Package.IDE.Solution.SolutionBuild.ActiveConfiguration.SolutionContexts; int count = 0; for (int i = 0; i < solutionContexts.Count; i++) { try { if (solutionContexts.Item(i + 1).ShouldBuild) { count++; } } catch (ArgumentException) { // This is a work-around for a known issue with the SolutionContexts.GetEnumerator with unloaded projects in VS2010. } } return(count); }
public static Dictionary <string, (string, string)[]> GlobalProjectConfigurationProperties(this SolutionContexts solutionContexts) { return(solutionContexts .Cast <SolutionContext>() .ToDictionary(context => context.ProjectName, GlobalProjectConfigurationProperties)); }