예제 #1
0
 public RustProjectLauncher(RustProjectNode project)
 {
     Utilities.ArgumentNotNull("project", project);
     string currConfig = project.GetProjectProperty(ProjectFileConstants.Configuration);
     RustProjectConfig projectConfig = (RustProjectConfig)project.ConfigProvider.GetProjectConfiguration(currConfig);
     debugConfig = Configuration.Debug.LoadFrom(new[] { projectConfig.UserCfg });
     if (debugConfig.StartAction == Configuration.StartAction.Project &&
         project.GetProjectProperty("OutputType") != "exe")
     {
         throw new InvalidOperationException("A project with an Output Type of Library cannot be started directly.");
     }
     this.environment = new LauncherEnvironment(project, debugConfig, projectConfig);
 }
예제 #2
0
        public RustProjectLauncher(RustProjectNode project)
        {
            Utilities.ArgumentNotNull("project", project);
            string            currConfig    = project.GetProjectProperty(ProjectFileConstants.Configuration);
            RustProjectConfig projectConfig = (RustProjectConfig)project.ConfigProvider.GetProjectConfiguration(currConfig);

            debugConfig = Configuration.Debug.LoadFrom(new[] { projectConfig.UserCfg });
            if (debugConfig.StartAction == Configuration.StartAction.Project &&
                project.GetProjectProperty("OutputType") != "exe")
            {
                throw new InvalidOperationException("A project with an Output Type of Library cannot be started directly.");
            }
            this.environment = new LauncherEnvironment(project, debugConfig, projectConfig);
        }
예제 #3
0
        public int LaunchProject(bool debug)
        {
            string outputType = _project.GetProjectProperty("OutputType");

            if (outputType != "exe" && outputType != "cargo_exe")
            {
                throw new InvalidOperationException("A project with an Output Type of Library cannot be started directly.");
            }
            var startupFilePath = GetProjectStartupFile();

            if (String.IsNullOrEmpty(startupFilePath) || outputType == "cargo_exe")  // The cargo task is starting the exe
            {
                return(VSConstants.S_OK);
            }
            return(LaunchFile(startupFilePath, debug));
        }
예제 #4
0
        public DefaultRustLauncher(RustProjectNode project)
        {
            Utilities.ArgumentNotNull("project", project);
            _project = project;
            string currConfig = _project.GetProjectProperty(ProjectFileConstants.Configuration);

            _projectConfig = (RustProjectConfig)_project.ConfigProvider.GetProjectConfiguration(currConfig);
            _debugConfig   = Configuration.Debug.LoadFrom(new ProjectConfig[] { _projectConfig });
        }
예제 #5
0
        public int LaunchProject(bool debug)
        {
            if (debugConfig.StartAction == Configuration.StartAction.Project &&
                project.GetProjectProperty("OutputType") != "exe")
            {
                throw new InvalidOperationException("A project with an Output Type of Library cannot be started directly.");
            }

            string startupFilePath;

            if (debugConfig.StartAction == Configuration.StartAction.Project)
            {
                startupFilePath = GetProjectStartupFile();
            }
            else
            {
                startupFilePath = debugConfig.ExternalProgram;
            }

            return(LaunchFile(startupFilePath, debug));
        }
예제 #6
0
        private string GetProjectStartupFile()
        {
            var startupFilePath = Path.Combine(_project.GetProjectProperty("TargetDir"), _project.GetProjectProperty("TargetFileName"));

            //var startupFilePath = _project.GetStartupFile();

            if (string.IsNullOrEmpty(startupFilePath))
            {
                throw new ApplicationException("Startup file is not defined in project");
            }

            return(startupFilePath);
        }