public static String findTools(String toolName) { for (String path : Path.getPath()) { String task = path + File.separatorChar + toolName; File tool = new File(task); if (tool.exists() && tool.isFile()) { return tool.getAbsolutePath(); } else if (Utilities.isWindows()) { task = task + ".exe"; // NOI18N tool = new File(task); if (tool.exists() && tool.isFile()) { return tool.getAbsolutePath(); } } } return toolName; }
@Override public void run() { File file = new File(txt); boolean ok = false; if (Utilities.isWindows()) { if (txt.endsWith(".lnk")) { // NOI18N ok = false; } else { ok = (file.exists() || new File(txt + ".lnk").exists()) && !file.isDirectory(); // NOI18N } } else { ok = file.exists() && !file.isDirectory(); } if (!ok) { // try users path for (String p : Path.getPath()) { file = new File(p + File.separatorChar + txt); ok = file.exists() && !file.isDirectory(); if (ok) { break; } } } lastValid.put(tool, ok); updateField(field, ok, tool); } });
@Override public void run() { File file = new File(txt); boolean ok = false; if (Utilities.isWindows()) { if (txt.endsWith(".lnk")) { // NOI18N ok = false; } else { ok = (file.exists() || new File(txt + ".lnk").exists()) && !file.isDirectory(); // NOI18N } } else { ok = file.exists() && !file.isDirectory(); } if (!ok) { // try users path for (String p : Path.getPath()) { file = new File(p + File.separatorChar + txt); ok = file.exists() && !file.isDirectory(); if (ok) { break; } } } lastValid.put(tool, ok); updateField(field, ok, tool); } });
for (String dir : Path.getPath()) { dir = dir.toLowerCase().replace("\\", "/"); // NOI18N if (dir.contains("cygwin")) { // NOI18N
for (String dir : Path.getPath()) { dir = dir.toLowerCase().replace("\\", "/"); // NOI18N if (dir.contains("cygwin")) { // NOI18N
/** * Get the command folder (toolchain definition, which users the Windows registry) or the user's path */ public static String getCommandFolder(ToolchainDescriptor descriptor) { if (!Utilities.isWindows()) { return null; } String res = getCommandDir(descriptor); if (res != null) { return res; } ToolchainManagerImpl tcm = ToolchainManagerImpl.getImpl(); for(ToolchainDescriptor td : tcm.getToolchains(PlatformTypes.PLATFORM_WINDOWS)){ if (td != null) { res = getCommandDir(td); if (res != null) { return res; } } } for (String dir : Path.getPath()) { dir = dir.toLowerCase().replace("\\", "/"); // NOI18N if (dir.contains("/msys/1.0") && dir.contains("/bin")) { // NOI18N return dir; } } return null; }
/** * Get the command folder (toolchain definition, which users the Windows registry) or the user's path */ public static String getCommandFolder(ToolchainDescriptor descriptor) { if (!Utilities.isWindows()) { return null; } String res = getCommandDir(descriptor); if (res != null) { return res; } ToolchainManagerImpl tcm = ToolchainManagerImpl.getImpl(); for(ToolchainDescriptor td : tcm.getToolchains(PlatformTypes.PLATFORM_WINDOWS)){ if (td != null) { res = getCommandDir(td); if (res != null) { return res; } } } for (String dir : Path.getPath()) { dir = dir.toLowerCase().replace("\\", "/"); // NOI18N if (dir.contains("/msys/1.0") && dir.contains("/bin")) { // NOI18N return dir; } } return null; }
if (pattern != null && pattern.length() > 0) { Pattern p = Pattern.compile(pattern); for (String dir : Path.getPath()) { if (p.matcher(dir).find()) { return dir;
initCompilerSets(Path.getPath()); } else { final AtomicReference<Thread> threadRef = new AtomicReference<Thread>();