public static CryEngineProjectData GetProjectData(Project envProject) { const string launcherKey = "CryEngineLauncherPath"; const string projectKey = "CryEngineProjectPath"; const string argsKey = "CryEngineCommandArguments"; ProjectRootElement root = ProjectRootElement.Open(envProject.FullName); var proj = new Microsoft.Build.Evaluation.Project(root); var projectData = new CryEngineProjectData { LauncherPath = proj.GetPropertyValue(launcherKey), ProjectPath = proj.GetPropertyValue(projectKey), CommandArguments = proj.GetPropertyValue(argsKey) }; Microsoft.Build.Evaluation.ProjectCollection.GlobalProjectCollection.UnloadProject(proj); return(projectData); }
/// <summary> /// Called when the application is run with debugging support. Otherwise it will just launch. /// </summary> /// <param name="grfLaunch"></param> /// <returns></returns> public int DebugLaunch(uint grfLaunch) { var port = NetworkHelper.GetAvailablePort(17615, 18000); var startArgs = new SoftDebuggerConnectArgs("CRYENGINE", IPAddress.Loopback, port) { MaxConnectionAttempts = 10 }; var startInfo = new CryEngineStartInfo(startArgs, null, _baseProject, CryEngineProjectData.GetProjectData(_baseProject), _launcherType); var session = new CryEngineDebuggerSession(); IDebugLauncher debugLauncher = new CryEngineDebugLauncher(); var progress = new Progress <string>(); progress.ProgressChanged += OnProgressChanged; var launcher = new MonoDebuggerLauncher(progress, debugLauncher); launcher.StartSession(startInfo, session); return(VSConstants.S_OK); }
public CryEngineStartInfo(SoftDebuggerStartArgs args, DebuggingOptions options, Project startupProject, CryEngineProjectData projectData, LauncherType launcherType) : base(args, options, startupProject) { ProjectData = projectData; LauncherType = launcherType; }