private void RefreshCommandLine() { CommandLineBuilder commandLine = new CommandLineBuilder(); switch (StartAction) { case StartAction.Class: var projectConfigs = ParentPropertyPage.Configurations; DartProjectConfig projectConfig = projectConfigs != null && projectConfigs.Count == 1 ? (DartProjectConfig)projectConfigs[0] : null; string javaPath = "javac.exe"; commandLine.AppendFileNameIfNotNull(javaPath); commandLine.AppendSwitch("-agentpath:{AgentPath}"); if (!string.IsNullOrEmpty(AgentArguments)) { commandLine.AppendTextUnquoted("=" + AgentArguments); } if (!string.IsNullOrEmpty(VirtualMachineArguments)) { commandLine.AppendTextUnquoted(" " + VirtualMachineArguments); } if (!string.IsNullOrEmpty(StartClass)) { commandLine.AppendFileNameIfNotNull(StartClass); } break; case StartAction.Program: case StartAction.Browser: throw new NotSupportedException(); case StartAction.Unknown: default: break; } if (!string.IsNullOrEmpty(ExtraArguments)) { commandLine.AppendTextUnquoted(" " + ExtraArguments); } txtCommandLine.Text = commandLine.ToString(); }
internal void RefreshCommandLine() { CommandLineBuilder commandLine = new CommandLineBuilder(); string javacPath = null; if (ParentPropertyPage.ProjectManager != null && ParentPropertyPage.ProjectManager.SharedBuildOptions.General != null) { javacPath = ParentPropertyPage.ProjectManager.SharedBuildOptions.General.JavacPath; } if (javacPath == null) { javacPath = ParentPropertyPage.GetConfigProperty(DartConfigConstants.JavacPath, _PersistStorageType.PST_PROJECT_FILE); } string fullucc = javacPath; try { if (!string.IsNullOrEmpty(fullucc) && !Path.IsPathRooted(fullucc) && ParentPropertyPage.ProjectManager != null) { fullucc = Path.Combine(ParentPropertyPage.ProjectManager.ProjectFolder, javacPath); } } catch (ArgumentException) { fullucc = javacPath; } if (string.IsNullOrEmpty(fullucc)) { var projectConfigs = ParentPropertyPage.Configurations; DartProjectConfig projectConfig = projectConfigs != null && projectConfigs.Count == 1 ? (DartProjectConfig)projectConfigs[0] : null; fullucc = "javac.exe"; } commandLine.AppendFileNameIfNotNull(fullucc); commandLine.AppendSwitchIfNotNullOrEmpty("-encoding ", Encoding); switch (DebuggingInformation) { case DebuggingInformation.All: commandLine.AppendSwitch("-g"); break; case DebuggingInformation.Specific: if (!string.IsNullOrEmpty(SpecificDebuggingInformation)) { commandLine.AppendSwitchIfNotNull("-g:", SpecificDebuggingInformation); } else { commandLine.AppendSwitch("-g:none"); } break; case DebuggingInformation.None: commandLine.AppendSwitch("-g:none"); break; case DebuggingInformation.Default: default: break; } if (!string.IsNullOrEmpty(SourceRelease) && !string.Equals(SourceRelease, "Default", StringComparison.OrdinalIgnoreCase)) { commandLine.AppendSwitchIfNotNull("-source ", SourceRelease); } if (!string.IsNullOrEmpty(TargetRelease) && !string.Equals(TargetRelease, "Default", StringComparison.OrdinalIgnoreCase)) { commandLine.AppendSwitchIfNotNull("-target ", TargetRelease); } commandLine.AppendSwitchIfNotNullOrEmpty("-d ", OutputPath); if (!ShowWarnings) { commandLine.AppendSwitch("-nowarn"); } else if (ShowAllWarnings) { commandLine.AppendSwitch("-Xlint"); commandLine.AppendSwitch("-deprecation"); } if (!string.IsNullOrEmpty(ExtraArguments)) { commandLine.AppendTextUnquoted(" " + ExtraArguments); } txtBuildCommandLine.Text = commandLine.ToString(); }