diff options
Diffstat (limited to 'src/installer/lombok')
3 files changed, 24 insertions, 4 deletions
diff --git a/src/installer/lombok/installer/Installer.java b/src/installer/lombok/installer/Installer.java index b9faeebd..7ae01d7a 100644 --- a/src/installer/lombok/installer/Installer.java +++ b/src/installer/lombok/installer/Installer.java @@ -56,7 +56,7 @@ import com.zwitserloot.cmdreader.Shorthand; * and looks in some common places on Mac OS X, Linux and Windows. */ public class Installer { - static final URI ABOUT_LOMBOK_URL = URI.create("http://projectlombok.org"); + static final URI ABOUT_LOMBOK_URL = URI.create("https://projectlombok.org"); static final List<IdeLocationProvider> locationProviders; static { diff --git a/src/installer/lombok/installer/eclipse/EclipseLocation.java b/src/installer/lombok/installer/eclipse/EclipseLocation.java index 0fe60c05..6c63c48d 100644 --- a/src/installer/lombok/installer/eclipse/EclipseLocation.java +++ b/src/installer/lombok/installer/eclipse/EclipseLocation.java @@ -49,6 +49,7 @@ import lombok.installer.UninstallException; public class EclipseLocation extends IdeLocation { private final String name; private final File eclipseIniPath; + private final String pathToLombokJarPrefix; private volatile boolean hasLombok; private static final String OS_NEWLINE = IdeFinder.getOS().getLineEnding(); @@ -64,6 +65,15 @@ public class EclipseLocation extends IdeLocation { EclipseLocation(String nameOfLocation, File pathToEclipseIni) throws CorruptedIdeLocationException { this.name = nameOfLocation; this.eclipseIniPath = pathToEclipseIni; + File p1 = pathToEclipseIni.getParentFile(); + File p2 = p1 == null ? null : p1.getParentFile(); + File p3 = p2 == null ? null : p2.getParentFile(); + if (p1 != null && p1.getName().equals("Eclipse") && p2 != null && p2.getName().equals("Contents") && p3 != null && p3.getName().endsWith(".app")) { + this.pathToLombokJarPrefix = "../Eclipse/"; + } else { + this.pathToLombokJarPrefix = ""; + } + try { this.hasLombok = checkForLombok(eclipseIniPath); } catch (IOException e) { @@ -333,10 +343,15 @@ public class EclipseLocation extends IdeLocation { fis.close(); } - String fullPathToLombok = fullPathRequired ? (lombokJar.getParentFile().getCanonicalPath() + File.separator) : ""; + String pathPrefix; + if (fullPathRequired) { + pathPrefix = lombokJar.getParentFile().getCanonicalPath() + File.separator; + } else { + pathPrefix = pathToLombokJarPrefix; + } newContents.append(String.format( - "-javaagent:%s", escapePath(fullPathToLombok + "lombok.jar"))).append(OS_NEWLINE); + "-javaagent:%s", escapePath(pathPrefix + "lombok.jar"))).append(OS_NEWLINE); FileOutputStream fos = new FileOutputStream(eclipseIniPath); try { diff --git a/src/installer/lombok/installer/eclipse/EclipseLocationProvider.java b/src/installer/lombok/installer/eclipse/EclipseLocationProvider.java index 914de588..29716a1f 100644 --- a/src/installer/lombok/installer/eclipse/EclipseLocationProvider.java +++ b/src/installer/lombok/installer/eclipse/EclipseLocationProvider.java @@ -104,11 +104,16 @@ public class EclipseLocationProvider implements IdeLocationProvider { if (ini.isFile()) return makeLocation(canonical(exePath), ini); } - /* Try looking for Eclipse/app/Contents/MacOS/eclipse.ini as sibling to executable; this works on Mac OS X. */ { + /* Try looking for Eclipse.app/Contents/MacOS/eclipse.ini as sibling to executable; this works on Mac OS X. */ { File ini = new File(exePath.getParentFile(), getMacAppName() + "/Contents/MacOS/" + getIniName()); if (ini.isFile()) return makeLocation(canonical(exePath), ini); } + /* Starting with Eclipse Mars (with the oomph installer), the structure has changed, and it's now at Eclipse.app/Contents/Eclipse/eclipse.ini*/ { + File ini = new File(exePath.getParentFile(), getMacAppName() + "/Contents/Eclipse/" + getIniName()); + if (ini.isFile()) return makeLocation(canonical(exePath), ini); + } + /* If executable is a soft link, follow it and retry. */ { if (loopCounter < 50) { try { |