protected String convertPath(String path, ExecutionEnvironment execEnv) { if (execEnv.isLocal()) { return LinkSupport.resolveWindowsLink(path); } return path; }
private String convertPath(String path, ExecutionEnvironment execEnv) { if (execEnv.isLocal()) { return LinkSupport.resolveWindowsLink(path); } return path; }
private void getCompilerOutput(String arguments, List<String> options, List<String> undefinedAlternatives, boolean isGcc) { String compilerPath = getPath(); if (compilerPath == null || compilerPath.length() == 0) { return; } ExecutionEnvironment execEnv = getExecutionEnvironment(); if (execEnv.isLocal() && Utilities.isWindows()) { compilerPath = LinkSupport.resolveWindowsLink(compilerPath); } try { if (!HostInfoUtils.fileExists(execEnv, compilerPath)) { compilerPath = getDefaultPath(); if (!HostInfoUtils.fileExists(execEnv, compilerPath)) { return; } } } catch (Throwable ex) { return; } List<String> argsList = new ArrayList<String>(); argsList.addAll(Arrays.asList(arguments.trim().split(" +"))); // NOI18N ProcessUtils.ExitStatus execute = ProcessUtils.execute(execEnv, compilerPath, argsList.toArray(new String[argsList.size()])); if (execute.isOK()) { discoverFlags(execute.output, options, undefinedAlternatives, isGcc); } }
private void run() { if (tool.getExecutionEnvironment().isLocal()) { // we're dealing with a local toolchain path = LinkSupport.resolveWindowsLink(path); File file = new File(path); if (!file.exists()) { alreadyRun = true; return; } } NativeProcessBuilder npb = NativeProcessBuilder.newProcessBuilder(tool.getExecutionEnvironment()); npb.setExecutable(path); npb.setArguments(getVersionFlags()); npb.redirectError(); try { NativeProcess p = npb.call(); p.getOutputStream().close(); final List<String> processOutput = ProcessUtils.readProcessOutput(p); if (processOutput != null && processOutput.size() > 0) { version = processOutput.get(0); } } catch (Exception ex) { // silently drop } alreadyRun = true; }
private void run() { if (tool.getExecutionEnvironment().isLocal()) { // we're dealing with a local toolchain path = LinkSupport.resolveWindowsLink(path); File file = new File(path); if (!file.exists()) { alreadyRun = true; return; } } NativeProcessBuilder npb = NativeProcessBuilder.newProcessBuilder(tool.getExecutionEnvironment()); npb.setExecutable(path); npb.setArguments(getVersionFlags()); npb.redirectError(); try { NativeProcess p = npb.call(); p.getOutputStream().close(); final List<String> processOutput = ProcessUtils.readProcessOutput(p); if (processOutput != null && processOutput.size() > 0) { version = processOutput.get(0); } } catch (Exception ex) { // silently drop } alreadyRun = true; }
String flag = c.getVersionFlags(); pattern = Pattern.compile(c.getVersionPattern()); String command = LinkSupport.resolveWindowsLink(file.getAbsolutePath()); String s = getCommandOutput(path, command, flag, true); boolean res = pattern.matcher(s).find(); } else if (c.getFingerPrintFlags() != null && c.getFingerPrintPattern() != null) { String flag = c.getFingerPrintFlags(); String command = LinkSupport.resolveWindowsLink(file.getAbsolutePath()); String s = getCommandOutput(path, command,flag, false); pattern = Pattern.compile(c.getFingerPrintPattern());
try { if (execEnv.isLocal() && Utilities.isWindows()) { compilerPath = LinkSupport.resolveWindowsLink(compilerPath);
shellCommand = LinkSupport.resolveWindowsLink(shellCommand);