emptyList() ); generalCommandLine.addParameter(task); generalCommandLine.addParameters(taskParameters);
public static boolean checkMongoShellPath(String mongoShellPath) throws ExecutionException { if (isBlank(mongoShellPath)) { return false; } GeneralCommandLine commandLine = new GeneralCommandLine(); commandLine.setExePath(mongoShellPath); commandLine.addParameter("--version"); CapturingProcessHandler handler = new CapturingProcessHandler(commandLine.createProcess(), CharsetToolkit.getDefaultSystemCharset(), commandLine.getCommandLineString()); ProcessOutput result = handler.runProcess(15 * 1000); return result.getExitCode() == 0; }
public static GeneralCommandLine buildCommandLine(String shellPath, ServerConfiguration serverConfiguration, MongoDatabase database) { GeneralCommandLine commandLine = new GeneralCommandLine(); commandLine.setExePath(shellPath); commandLine.addParameter(buildMongoUrl(serverConfiguration, database)); commandLine.addParameter("--username"); commandLine.addParameter(username); commandLine.addParameter("--password"); commandLine.addParameter(password); commandLine.addParameter("--authenticationDatabase"); commandLine.addParameter(authenticationDatabase); commandLine.addParameter("--authenticationMechanism"); commandLine.addParameter(authenticationMechanism.getMechanismName());
commandLine.addParameter("/c"); } else { commandLine.addParameter("-c"); commandLine.addParameter(command);
cmd.addParameter("build"); } else if (toTest) { cmd.addParameter("test"); } else if (toRun) { cmd.addParameter("run"); cmd.addParameter("--temp-build"); cmd.addParameter("--coverage"); cmd.addParameter("--main-file"); cmd.addParameter(config.getTfMainFile()); cmd.addParameter("--rdmd"); cmd.addParameter("--force"); cmd.addParameter("--nodeps"); cmd.addParameter("--force-remove"); cmd.addParameter("--combined"); cmd.addParameter("--parallel"); cmd.addParameter("-q"); cmd.addParameter("-v");
cmd.addParameter("--version");
protected GeneralCommandLine createRunInSimulatorCmd() throws ExecutionException { MonkeyParameters monkeyParameters = getMonkeyParameters(); VirtualFile child = monkeyParameters.getOutputPath().findChild(getPrgName()); if (child == null) { throw new ExecutionException("No .prg file was built, so nothing to run, searched path was " + monkeyParameters.getOutputPath() + " and prg name " + getPrgName()); } String prgPath = child.getPath(); Sdk sdk = monkeyParameters.getSdk(); String sdkBinPath = MonkeySdkType.getBinPath(sdk); String monkeydoExecutableName = SdkHelper.get(SdkHelper.MONKEYDO_CMD); String exePath = sdkBinPath + monkeydoExecutableName; GeneralCommandLine generalCommandLine = createGeneralCommandLine(sdkBinPath, exePath) .withParameters(prgPath, getConfiguration().getTargetDeviceId()); if (isForTests()) { generalCommandLine.addParameter(SdkHelper.get(SdkHelper.MONKEYDO_TEST_PARAM)); //if (testId != null) { // generalCommandLine.addParameter(testId); //} } if (getConfiguration().getProgramParameters() != null) { ParametersList parametersList = new ParametersList(); parametersList.addParametersString(getConfiguration().getProgramParameters()); generalCommandLine.addParameters(parametersList.getParameters()); } return generalCommandLine; }
public static Boolean isKnownGdb(String path) { try { GeneralCommandLine command = new GeneralCommandLine(); command.setExePath(path); command.addParameter("--version"); ProcessOutput output = new CapturingProcessHandler( command.createProcess(), Charset.defaultCharset(), command.getCommandLineString()).runProcess(); if (output.getExitCode() != 0) { LOG.error("gdb exited with invalid exit code: " + output.getExitCode()); return false; } String cmdOutput = output.getStdout(); return cmdOutput.contains("(GDB) 7.6") || cmdOutput.contains("(GDB) 7.4"); } catch (Exception e) { LOG.error("Exception while executing the process:", e); return false; } }
public static Boolean isValidGdbPath(String path) { try { GeneralCommandLine command = new GeneralCommandLine(); command.setExePath(path); command.addParameter("--version"); ProcessOutput output = new CapturingProcessHandler( command.createProcess(), Charset.defaultCharset(), command.getCommandLineString()).runProcess(); if (output.getExitCode() != 0) { LOG.error("gdb exited with invalid exit code: " + output.getExitCode()); return false; } // TODO maybe we should warn the user that his GDB version is not the latest at time of writing (7.6.2) return output.getStdout().contains("GDB"); } catch (Exception e) { // LOG.error("Exception while executing the process:", e); return false; } } }
@NotNull public static GeneralCommandLine createCommandLine(String workingDir, BashRunConfiguration runConfig) { String interpreterPath; if (runConfig.isUseProjectInterpreter()) { interpreterPath = BashProjectSettings.storedSettings(runConfig.getProject()).getProjectInterpreter(); } else { interpreterPath = runConfig.getInterpreterPath(); } GeneralCommandLine cmd = new GeneralCommandLine(); cmd.setExePath(interpreterPath); cmd.getParametersList().addParametersString(runConfig.getInterpreterOptions()); cmd.addParameter(runConfig.getScriptName()); cmd.getParametersList().addParametersString(runConfig.getProgramParameters()); cmd.withWorkDirectory(workingDir); cmd.withParentEnvironmentType(runConfig.isPassParentEnvs() ? GeneralCommandLine.ParentEnvironmentType.CONSOLE : GeneralCommandLine.ParentEnvironmentType.NONE); cmd.withEnvironment(runConfig.getEnvs()); return cmd; }
final String backingFilePath = backingFile.getCanonicalPath(); if (backingFilePath == null) return; commandLine.addParameter(backingFilePath);
final String backingFilePath = backingFile.getCanonicalPath(); if (backingFilePath == null) return; commandLine.addParameter(backingFilePath);