@NotNull @Override public PerlCommandLine withParameters(@NotNull List<String> parameters) { return (PerlCommandLine)super.withParameters(parameters); }
@NotNull @Override public PerlCommandLine withParameters(@NotNull String... parameters) { return (PerlCommandLine)super.withParameters(parameters); }
private GeneralCommandLine createShellCmd(int port, String outputDir, String command, String fromPath, String toPath) throws ExecutionException { String shellExecutableName = SdkHelper.get(SdkHelper.SHELL_CMD); String sdkBinPath = MonkeySdkType.getBinPath(sdk); String exePath = sdkBinPath + shellExecutableName; //command is "pull" or "push" return createGeneralCommandLine(outputDir, exePath) .withParameters("--transport=tcp", "--transport_args=127.0.0.1:" + port, command, fromPath, toPath); }
private GeneralCommandLine createShellCmd(int port) throws ExecutionException { String shellExecutableName = SdkHelper.get(SdkHelper.SHELL_CMD); String sdkBinPath = MonkeySdkType.getBinPath(sdk); String exePath = sdkBinPath + shellExecutableName; return createGeneralCommandLine(outputDir, exePath) .withParameters("--transport=tcp", "--transport_args=127.0.0.1:" + port, "tvm", "help"); }
public static GeneralCommandLine createGeneralCommandLine(String workDirectory, String exePath) { if (SystemInfo.isMac) { String macExePath = exePath; List<String> parameters = new ArrayList<>(); // .app files are opened with open command? if (exePath.endsWith(".app")) { macExePath = "open"; parameters.add(exePath); parameters.add("--args"); } return new GeneralCommandLine() .withWorkDirectory(workDirectory) .withExePath(macExePath) .withParameters(parameters) .withCharset(CharsetToolkit.UTF8_CHARSET); } return new GeneralCommandLine() .withWorkDirectory(workDirectory) .withExePath(exePath) .withCharset(CharsetToolkit.UTF8_CHARSET); } }
private void saveSvgFile(@NotNull final String outSvgFile, @NotNull final ControlFlow flow) throws IOException, ExecutionException { String dotUtilName = SystemInfoRt.isUnix ? "dot" : "dot.exe"; File dotFullPath = PathEnvironmentVariableUtil.findInPath(dotUtilName); if (dotFullPath == null) { throw new FileNotFoundException("Cannot find dot utility in path"); } File tmpFile = FileUtil.createTempFile("control-flow", ".dot", true); FileUtil.writeToFile(tmpFile, convertControlFlowToDot(flow)); ExecUtil.execAndGetOutput(new GeneralCommandLine(dotFullPath.getAbsolutePath()).withInput(tmpFile.getAbsoluteFile()) .withParameters("-Tsvg", "-o" + outSvgFile, tmpFile.getAbsolutePath()).withRedirectErrorStream(true)); }
.withCharset(Charset.defaultCharset()) .withExePath(dmdPath) .withParameters(dmdParameters);
.withWorkDirectory(project.getBaseDir().getCanonicalPath()) .withExePath(dubBinaryPath) .withParameters("describe");
.withWorkDirectory(workingDirectory) .withExePath(this.dubBinary) .withParameters(parametersList.getParameters());
@NotNull private String processFile(final PsiFile file, final String dubPath) { final GeneralCommandLine cmd = new GeneralCommandLine() .withWorkDirectory(file.getProject().getBasePath()) .withExePath(dubPath) .withEnvironment("DFLAGS", "-o-") .withParameters("build", "--combined", "-q"); try { final String dubCommand = cmd.getCommandLineString(); final DubProcessListener listener = new DubProcessListener(); final OSProcessHandler process = new OSProcessHandler(cmd.createProcess(), dubCommand); process.addProcessListener(listener); process.startNotify(); process.waitFor(); return listener.getOutput(); } catch (final ExecutionException e) { LOG.warn("There was a problem running 'dub build --combined -q'", e); } return ""; }
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; }