mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-14 08:18:29 +00:00
Fixes to git auto finding on windows and unix. It seems to work fine now on all 3 platforms!
This commit is contained in:
1 parent
e3e8bb2e1d
commit
7e31d9cd98
3 files changed
+8
-8
No files matched your search
@@ -101,7 +101,7 @@ public class NetbeansFinder extends IdeFinder {
|
||||
|
||||
/** Checks if the provided directory contains 'netbeans.exe', and if so, returns the directory, otherwise null. */
|
||||
private String findNetbeansOnWindows1(File dir) {
|
||||
if (new File(dir, "netbeans.exe").isFile()) return dir.getAbsolutePath();
|
||||
if (new File(dir, "bin/netbeans.exe").isFile()) return dir.getAbsolutePath();
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ public class NetbeansFinder extends IdeFinder {
|
||||
if (!d.isDirectory()) return;
|
||||
for (File f : d.listFiles()) {
|
||||
if (f.isDirectory() && f.getName().toLowerCase().contains("netbeans")) {
|
||||
File possible = new File(f, "bin/netbeans.exe");
|
||||
File possible = new File(f, "bin/netbeans");
|
||||
if (possible.exists()) guesses.add(possible.getAbsolutePath());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ public class NetbeansLocation extends IdeLocation {
|
||||
|
||||
private final String ID_CHARS = "(?:\\\\.|[^\"\\\\])*";
|
||||
private final Pattern JAVA_AGENT_LINE_MATCHER = Pattern.compile(
|
||||
"^\\s*netbeans_default_options\\s*=\\s*\"\\s*" + ID_CHARS + "(?<=[ \"])(-J-javaagent:\\\\\"" + ID_CHARS + "lombok" + ID_CHARS + "\\.jar\\\\\")(?=[ \"])" + ID_CHARS +"\\s*\"\\s*(?:#.*)?$", Pattern.CASE_INSENSITIVE);
|
||||
"^\\s*netbeans_default_options\\s*=\\s*\"\\s*" + ID_CHARS + "(?<=[ \"])(-J-javaagent:\\\\\".*lombok.*\\.jar\\\\\")(?=[ \"])" + ID_CHARS +"\\s*\"\\s*(?:#.*)?$", Pattern.CASE_INSENSITIVE);
|
||||
|
||||
private final Pattern OPTIONS_LINE_MATCHER = Pattern.compile(
|
||||
"^\\s*netbeans_default_options\\s*=\\s*\"\\s*" + ID_CHARS + "\\s*(\")\\s*(?:#.*)?$", Pattern.CASE_INSENSITIVE);
|
||||
@@ -240,7 +240,7 @@ public class NetbeansLocation extends IdeLocation {
|
||||
m = OPTIONS_LINE_MATCHER.matcher(line);
|
||||
if (m.matches()) {
|
||||
newContents.append(line.substring(0, m.start(1)));
|
||||
newContents.append(" ").append("-J-javaagent:\\\"" + canonical(lombokJar) +"\\\"");
|
||||
newContents.append(" ").append("-J-javaagent:\\\"" + canonical(lombokJar) +"\\\"\"");
|
||||
newContents.append(line.substring(m.end(1))).append(OS_NEWLINE);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -61,11 +61,11 @@ public class NetbeansLocationProvider implements IdeLocationProvider {
|
||||
if (conf.exists()) return new NetbeansLocation(path, conf);
|
||||
}
|
||||
|
||||
File f = new File(p, "netbeans");
|
||||
File f = new File(p, "bin/netbeans");
|
||||
if (f.isFile()) return findNetbeansConfFromExe(f, 0);
|
||||
f = new File(p, "netbeans.exe");
|
||||
f = new File(p, "bin/netbeans.exe");
|
||||
if (f.isFile()) return findNetbeansConfFromExe(f, 0);
|
||||
f = new File(p, "netbeans.conf");
|
||||
f = new File(p, "etc/netbeans.conf");
|
||||
if (f.isFile()) return new NetbeansLocation(canonical(f.getParentFile().getParentFile()), f);
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ public class NetbeansLocationProvider implements IdeLocationProvider {
|
||||
case MAC_OS_X:
|
||||
return Pattern.compile("^(netbeans|netbeans\\.conf|NetBeans.*\\.app)$", Pattern.CASE_INSENSITIVE);
|
||||
case WINDOWS:
|
||||
return Pattern.compile("^(netbeans\\.exe|netbeans\\.ini)$", Pattern.CASE_INSENSITIVE);
|
||||
return Pattern.compile("^(netbeans\\.exe|netbeans\\.conf)$", Pattern.CASE_INSENSITIVE);
|
||||
default:
|
||||
case UNIX:
|
||||
return Pattern.compile("^(netbeans|netbeans\\.conf)$", Pattern.CASE_INSENSITIVE);
|
||||
|
||||
Reference in new issue
Block a user