当前位置: 首页>>代码示例>>Java>>正文


Java GeneralCommandLine.addParameter方法代码示例

本文整理汇总了Java中com.intellij.execution.configurations.GeneralCommandLine.addParameter方法的典型用法代码示例。如果您正苦于以下问题:Java GeneralCommandLine.addParameter方法的具体用法?Java GeneralCommandLine.addParameter怎么用?Java GeneralCommandLine.addParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.execution.configurations.GeneralCommandLine的用法示例。


在下文中一共展示了GeneralCommandLine.addParameter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createCommandLine

import com.intellij.execution.configurations.GeneralCommandLine; //导入方法依赖的package包/类
private GeneralCommandLine createCommandLine() throws Exception
{
    GeneralCommandLine commandLine = new GeneralCommandLine();
    commandLine
        .withParentEnvironmentType(GeneralCommandLine.ParentEnvironmentType.CONSOLE)
        .withCharset(StandardCharsets.UTF_8)
        .withWorkDirectory(project.getBasePath());

    NodeJsLocalInterpreter interpreter = NodeJsLocalInterpreterManager
        .getInstance()
        .detectMostRelevant();

    if (interpreter == null)
    {
        throw new Exception("Unable to create node-interpreter.");
    }
    // Move getSettings.js resource to .idea-folder within current project.
    ensureJsFile();

    commandLine.setExePath(interpreter.getInterpreterSystemDependentPath());
    commandLine.addParameter(getJsFilePath());
    commandLine.addParameter("roc-config");

    return commandLine;
}
 
开发者ID:whitefire,项目名称:roc-completion,代码行数:26,代码来源:FetchCompletions.java

示例2: GitHandler

import com.intellij.execution.configurations.GeneralCommandLine; //导入方法依赖的package包/类
/**
 * A constructor
 *
 * @param project   a project
 * @param directory a process directory
 * @param command   a command to execute (if empty string, the parameter is ignored)
 */
protected GitHandler(@NotNull Project project, @NotNull File directory, @NotNull GitCommand command) {
  myProject = project;
  myCommand = command;
  myAppSettings = GitVcsApplicationSettings.getInstance();
  myProjectSettings = GitVcsSettings.getInstance(myProject);
  myEnv = new HashMap<String, String>(EnvironmentUtil.getEnvironmentMap());
  myVcs = ObjectUtils.assertNotNull(GitVcs.getInstance(project));
  myWorkingDirectory = directory;
  myCommandLine = new GeneralCommandLine();
  if (myAppSettings != null) {
    myCommandLine.setExePath(myAppSettings.getPathToGit());
  }
  myCommandLine.setWorkDirectory(myWorkingDirectory);
  if (GitVersionSpecialty.CAN_OVERRIDE_GIT_CONFIG_FOR_COMMAND.existsIn(myVcs.getVersion())) {
    myCommandLine.addParameters("-c", "core.quotepath=false");
  }
  myCommandLine.addParameter(command.name());
  myStdoutSuppressed = true;
  mySilent = myCommand.lockingPolicy() == GitCommand.LockingPolicy.READ;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:GitHandler.java

示例3: dumpPdbGuidsToFile

import com.intellij.execution.configurations.GeneralCommandLine; //导入方法依赖的package包/类
public int dumpPdbGuidsToFile(Collection<File> files, File output, BuildProgressLogger buildLogger) throws IOException {
  final GeneralCommandLine commandLine = new GeneralCommandLine();
  commandLine.setExePath(myExePath.getPath());
  commandLine.addParameter(DUMP_SYMBOL_SIGN_CMD);
  commandLine.addParameter(String.format("/o=%s", output.getPath()));
  commandLine.addParameter(String.format("/i=%s", dumpPathsToFile(files).getPath()));
  buildLogger.message(String.format("Running command %s", commandLine.getCommandLineString()));
  final ExecResult execResult = SimpleCommandLineProcessRunner.runCommand(commandLine, null);
  final String stdout = execResult.getStdout();
  if(!stdout.isEmpty()){
    buildLogger.message("Stdout: " + stdout);
  }
  final int exitCode = execResult.getExitCode();
  if (exitCode != 0) {
    buildLogger.warning(String.format("%s ends with non-zero exit code %s.", SYMBOLS_EXE, execResult));
    buildLogger.warning("Stdout: " + stdout);
    buildLogger.warning("Stderr: " + execResult.getStderr());
    final Throwable exception = execResult.getException();
    if(exception != null){
      buildLogger.exception(exception);
    }
  }
  return exitCode;
}
 
开发者ID:JetBrains,项目名称:teamcity-symbol-server,代码行数:25,代码来源:JetSymbolsExe.java

示例4: buildTunnelCommandLine

import com.intellij.execution.configurations.GeneralCommandLine; //导入方法依赖的package包/类
@NotNull
private GeneralCommandLine buildTunnelCommandLine(@NotNull String sshPath) {
  GeneralCommandLine result = new GeneralCommandLine(sshPath);
  boolean isPuttyLinkClient = StringUtil.endsWithIgnoreCase(FileUtil.getNameWithoutExtension(sshPath), "plink");
  SvnConfigurationState state = getState();

  // quiet mode
  if (!isPuttyLinkClient) {
    result.addParameter("-q");
  }

  result.addParameters(isPuttyLinkClient ? "-P" : "-p", String.valueOf(state.sshPort));

  if (!StringUtil.isEmpty(state.sshUserName)) {
    result.addParameters("-l", state.sshUserName);
  }

  if (SvnConfiguration.SshConnectionType.PRIVATE_KEY.equals(state.sshConnectionType) && !StringUtil.isEmpty(state.sshPrivateKeyPath)) {
    result.addParameters("-i", FileUtil.toSystemIndependentName(state.sshPrivateKeyPath));
  }

  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:SshTunnelRuntimeModule.java

示例5: printCommandLine

import com.intellij.execution.configurations.GeneralCommandLine; //导入方法依赖的package包/类
@Test
public void printCommandLine() {
  GeneralCommandLine commandLine = new GeneralCommandLine();
  commandLine.setExePath("e x e path");
  commandLine.addParameter("with space");
  commandLine.addParameter("\"quoted\"");
  commandLine.addParameter("\"quoted with spaces\"");
  commandLine.addParameters("param 1", "param2");
  commandLine.addParameter("trailing slash\\");
  assertEquals("\"e x e path\"" +
               " \"with space\"" +
               " \\\"quoted\\\"" +
               " \"\\\"quoted with spaces\\\"\"" +
               " \"param 1\"" +
               " param2" +
               " \"trailing slash\\\"",
               commandLine.getCommandLineString());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:GeneralCommandLineTest.java

示例6: createRshCommand

import com.intellij.execution.configurations.GeneralCommandLine; //导入方法依赖的package包/类
private static GeneralCommandLine createRshCommand(String host, String userName, ExtConfiguration config) {
  GeneralCommandLine command = new GeneralCommandLine();
  command.setExePath(config.CVS_RSH);
  command.addParameter(host);
  command.addParameter("-l");
  command.addParameter(userName);

  if (!config.PRIVATE_KEY_FILE.isEmpty()) {
    command.addParameter("-i");
    command.addParameter(config.PRIVATE_KEY_FILE);
  }

  if (!config.ADDITIONAL_PARAMETERS.isEmpty()) {
    StringTokenizer parameters = new StringTokenizer(config.ADDITIONAL_PARAMETERS, " ");
    while (parameters.hasMoreTokens()) command.addParameter(parameters.nextToken());
  }

  return command;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:ExtConnection.java

示例7: build

import com.intellij.execution.configurations.GeneralCommandLine; //导入方法依赖的package包/类
public static void build(Project project) {
    GeneralCommandLine commandLine = new GeneralCommandLine();
    commandLine.setWorkDirectory(project.getBasePath());
    commandLine.setExePath("python");
    commandLine.addParameter("freeline.py");
    // debug
    commandLine.addParameter("-d");

    // commands process
    try {
        processCommandline(project, commandLine);
    } catch (ExecutionException e) {
        e.printStackTrace();
    }
}
 
开发者ID:beansoftapp,项目名称:react-native-console,代码行数:16,代码来源:RNUtil.java

示例8: doOKAction

import com.intellij.execution.configurations.GeneralCommandLine; //导入方法依赖的package包/类
@Override
protected void doOKAction() {

    Notification notification = new Notification("LaravelStorm",
            "Success", "temp content", NotificationType.INFORMATION);

    Notification errorNotification = new Notification("LaravelStorm",
            "Error", "Could not create file.", NotificationType.ERROR);

    GeneralCommandLine cmd = new GeneralCommandLine("php", "artisan");
    cmd.setWorkDirectory(project.getBasePath());

    cmd.addParameter(artisanCommand);

    if (additionCommandCheckBox.isSelected())
        cmd.addParameter(optionCmdParameter);

    cmd.addParameter(fileName.getText());

    try {
        BufferedReader reader = new BufferedReader(new InputStreamReader(cmd.createProcess().getInputStream()));
        String execResult = reader.readLine();
        if (execResult.isEmpty()){
            Notifications.Bus.notify(errorNotification, project);
        }
        else{
            notification.setContent(execResult);
            Notifications.Bus.notify(notification, project);
        }
    } catch (ExecutionException | IOException e) {
        e.printStackTrace();
    }

    super.doOKAction();
}
 
开发者ID:3mmarg97,项目名称:LaravelStorm,代码行数:36,代码来源:FileMakerDlg.java

示例9: getProtractorRunCommand

import com.intellij.execution.configurations.GeneralCommandLine; //导入方法依赖的package包/类
private GeneralCommandLine getProtractorRunCommand(@NotNull Config config) {
    GeneralCommandLine commandLine = new GeneralCommandLine();
    commandLine.setExePath(config.getProtractorCmdPath());
    commandLine.setWorkDirectory(project.getBasePath());
    commandLine.addParameter(config.getProtractorConfigJsPath());

    StringBuilder specArg = new StringBuilder().append("--specs=").append(config.getFeaturesDirPath()).append("/").append(fileName);
    if(icon == SCENARIO_ICON) {
        specArg.append(":").append(line + 1);
    }

    commandLine.addParameter(specArg.toString());

    return commandLine;
}
 
开发者ID:KariiO,项目名称:Gherkin-TS-Runner,代码行数:16,代码来源:GherkinIconRenderer.java

示例10: runDetectionScript

import com.intellij.execution.configurations.GeneralCommandLine; //导入方法依赖的package包/类
/**
 * Runs detection script
 *
 * @param executablePath executable to run script with
 * @param detectionScriptPath file containing detection script
 * @return lines from stdout
 * @throws ExecutionException if there was an error during execution
 */
List<String> runDetectionScript(@NotNull final String executablePath, @NotNull final String detectionScriptPath) throws ExecutionException {
  final GeneralCommandLine cl = new GeneralCommandLine();
  cl.setExePath(executablePath);
  cl.addParameter("-NoProfile");
  cl.addParameter("-File");
  cl.addParameter(detectionScriptPath);
  if (LOG.isDebugEnabled()) {
    LOG.debug("Running detection script using command line: " + cl.getCommandLineString());
  }
  final ProcessOutput execResult = runProcess(cl);
  return execResult.getStdoutLines();
}
 
开发者ID:JetBrains,项目名称:teamcity-powershell,代码行数:21,代码来源:DetectionRunner.java

示例11: enableExecution

import com.intellij.execution.configurations.GeneralCommandLine; //导入方法依赖的package包/类
private static void enableExecution(@NotNull final File filePath) {
  final GeneralCommandLine commandLine = new GeneralCommandLine();
  
  commandLine.setExePath("chmod");
  commandLine.addParameter("+x");
  commandLine.addParameter(filePath.getName());
  commandLine.setWorkDirectory(filePath.getParent());

  final ExecResult execResult = SimpleCommandLineProcessRunner.runCommand(commandLine, null);
  if (execResult.getExitCode() != 0) {
    LOG.warn("Failed to set executable attribute for " + filePath + ": chmod +x exit code is " + execResult.getExitCode());
  }
}
 
开发者ID:JetBrains,项目名称:teamcity-powershell,代码行数:14,代码来源:PowerShellServiceUnix.java

示例12: isExistedTool

import com.intellij.execution.configurations.GeneralCommandLine; //导入方法依赖的package包/类
/**
 * Returns True if Existed Tool myConfigName
 * @return
 */
public boolean isExistedTool(){
  final GeneralCommandLine commandLine = new GeneralCommandLine();
  commandLine.setExePath(myToolName);
  commandLine.addParameter(myVersionArg);
  final ExecResult execResult = SimpleCommandLineProcessRunner.runCommand(commandLine, (byte[])null);
  if (execResult.getExitCode() == 0){
    myVersion = findVersion(stringArrayToString(execResult.getOutLines()));
  }
  return execResult.getExitCode() == 0;
}
 
开发者ID:unix-junkie,项目名称:teamcity-autotools-plugin,代码行数:15,代码来源:AutotoolsToolProvider.java

示例13: enableExecution

import com.intellij.execution.configurations.GeneralCommandLine; //导入方法依赖的package包/类
/**
 * Set executable attribute for file.
 * @param filePath File to be setted executable attribute
 * @param baseDir Directory to be setted Work Directory
 */
private static void enableExecution(@NotNull final String filePath, @NotNull final String baseDir) {
  final GeneralCommandLine commandLine = new GeneralCommandLine();
  commandLine.setExePath("chmod");
  commandLine.addParameter("+x");
  commandLine.addParameter(filePath);
  commandLine.setWorkDirectory(baseDir);
  final ExecResult execResult = SimpleCommandLineProcessRunner.runCommand(commandLine, null);
  if(execResult.getExitCode() != 0) {
    Loggers.AGENT.warn("Failed to set executable attribute for " + filePath + ": chmod +x exit code is " + execResult.getExitCode());
  }
}
 
开发者ID:unix-junkie,项目名称:teamcity-autotools-plugin,代码行数:17,代码来源:AutotoolsBuildCLBService.java

示例14: createCheckProcess

import com.intellij.execution.configurations.GeneralCommandLine; //导入方法依赖的package包/类
Process createCheckProcess(@NotNull final Project project, @NotNull final String executablePath) throws ExecutionException {
  final Sdk sdk = PythonSdkType.findPythonSdk(ModuleManager.getInstance(project).getModules()[0]);
  PyEduPluginConfigurator configurator = new PyEduPluginConfigurator();
  String testsFileName = configurator.getTestFileName();
  if (myTask instanceof TaskWithSubtasks) {
    testsFileName = FileUtil.getNameWithoutExtension(testsFileName);
    int index = ((TaskWithSubtasks)myTask).getActiveSubtaskIndex();
    testsFileName += EduNames.SUBTASK_MARKER + index + "." + FileUtilRt.getExtension(configurator.getTestFileName());
  }
  final File testRunner = new File(myTaskDir.getPath(), testsFileName);
  myCommandLine = new GeneralCommandLine();
  myCommandLine.withWorkDirectory(myTaskDir.getPath());
  final Map<String, String> env = myCommandLine.getEnvironment();

  final VirtualFile courseDir = project.getBaseDir();
  if (courseDir != null) {
    env.put(PYTHONPATH, courseDir.getPath());
  }
  if (sdk != null) {
    String pythonPath = sdk.getHomePath();
    if (pythonPath != null) {
      myCommandLine.setExePath(pythonPath);
      myCommandLine.addParameter(testRunner.getPath());
      myCommandLine.addParameter(FileUtil.toSystemDependentName(executablePath));
      return myCommandLine.createProcess();
    }
  }
  return null;
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:30,代码来源:PyStudyTestRunner.java

示例15: verifyServerCapability

import com.intellij.execution.configurations.GeneralCommandLine; //导入方法依赖的package包/类
private void verifyServerCapability() throws AuthenticationException {
  final GeneralCommandLine commandLine = new GeneralCommandLine();
  commandLine.setExePath(myLocalSettings.PATH_TO_CVS_CLIENT);
  commandLine.addParameter("-v");
  execute(commandLine);
  try {
    StringBuilder responseBuilder = new StringBuilder();
    while(true) {
      int c = myInputStream.read();
      if (c == -1) {
        break;
      }
      responseBuilder.append((char) c);
    }
    String[] lines = responseBuilder.toString().split("\n");
    for (String line : lines) {
      // check that the first non-empty line does not end with (client)
      if (line.trim().endsWith("(client)")) {
        throw new AuthenticationException("CVS client does not support server mode operation", null);
      }
      if (line.trim().length() > 0) {
        break;
      }
    }
  }
  catch (IOException e) {
    throw new AuthenticationException("Can't read CVS version", e);
  }
  closeInternal();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:LocalConnection.java


注:本文中的com.intellij.execution.configurations.GeneralCommandLine.addParameter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。