コード例 #1
0
        public void LoadSettings()
        {
            _options.InterpreterArguments = _project.GetProperty(ClusterOptions.AppArgumentsSetting);
            _options.PythonInterpreter    = _project.GetProperty(ClusterOptions.AppCommandSetting);
            _options.PublishBeforeRun     = _project.PublishBeforeRun();
            _options.RunEnvironment       = new ClusterEnvironment(_project.GetProperty(ClusterOptions.RunEnvironmentSetting));
            _options.WorkingDir           = _project.GetProperty(ClusterOptions.WorkingDirSetting);
            _options.MpiExecPath          = _project.GetProperty(ClusterOptions.MpiExecPathSetting);
            _options.DeploymentDirectory  = _project.GetProperty(ClusterOptions.DeploymentDirSetting);
            _options.TargetPlatform       = _project.TargetPlatform();

            _propGrid.SelectedObject = _options;
        }
コード例 #2
0
ファイル: HpcLauncher.cs プロジェクト: rsumner33/PTVS
        /// <summary>
        /// Publishes the project if the user has configured the publish on run.
        /// </summary>
        private bool TryPublishProject(ClusterEnvironment environment, string publishOverrideUrl)
        {
            if (_project.PublishBeforeRun() || environment.HeadNode == "localhost")
            {
                string msg = null;
                try {
                    var vsInstallDir = (string)HpcSupportPackage.Instance.ApplicationRegistryRoot.GetValue("InstallDir");

                    List <IPublishFile> allFiles = new List <IPublishFile>();

                    // add python debugger files
                    string pyInstallDir = GetPythonToolsInstallPath();
                    foreach (var file in _pyDebuggerFiles)
                    {
                        allFiles.Add(new CopyFile(Path.Combine(pyInstallDir, file), file));
                    }

                    string pyHpcInstallDir = GetPythonHpcToolsInstallPath();
                    foreach (var file in _hpcDebuggerFiles)
                    {
                        allFiles.Add(new CopyFile(Path.Combine(pyHpcInstallDir, file), file));
                    }

                    // add VS components that we need to run
                    foreach (var file in _vsAssemblies)
                    {
                        allFiles.Add(new CopyFile(file, Path.GetFileName(file)));
                    }

                    // Add vs remote debugger components.
                    string basePath = Path.Combine(Path.Combine(vsInstallDir, "Remote Debugger"), _project.TargetPlatform().ToString()) + "\\";
                    foreach (var file in Directory.GetFiles(basePath))
                    {
                        allFiles.Add(new CopyFile(file, file.Substring(basePath.Length)));
                    }

                    if (!_project.Publish(new PublishProjectOptions(allFiles.ToArray(), publishOverrideUrl)))
                    {
                        msg = "Publishing not configured or unknown publishing schema";
                    }
                } catch (PublishFailedException e) {
                    msg = e.InnerException.Message;
                }

                if (msg != null && CancelLaunch(msg))
                {
                    return(false);
                }
            }
            return(true);
        }