diff options
author | Reinier Zwitserloot <reinier@tipit.to> | 2009-11-27 12:10:10 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@tipit.to> | 2009-11-27 12:10:10 +0100 |
commit | 44d6a6b6627c23ac66920ae6dc1d709f26de7e3f (patch) | |
tree | 323796cc7d70aa4f65f26e5b8e512330636ba6e5 /src/installer | |
parent | 5ab3615b3d1bf14480c0626883c90145f6a72c63 (diff) | |
download | lombok-44d6a6b6627c23ac66920ae6dc1d709f26de7e3f.tar.gz lombok-44d6a6b6627c23ac66920ae6dc1d709f26de7e3f.tar.bz2 lombok-44d6a6b6627c23ac66920ae6dc1d709f26de7e3f.zip |
Solved the problem in the two-phase compile (some of lombok is JVM1.5, other bits are JVM1.6) being interdependent and causing implicit compilation warnings.
Also added source="1.x" to all ant file javac targets, as apparently this needs to be there when compiling with JDK7.
Diffstat (limited to 'src/installer')
-rw-r--r-- | src/installer/lombok/installer/Installer.java | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/installer/lombok/installer/Installer.java b/src/installer/lombok/installer/Installer.java index a823dd69..d6f1add0 100644 --- a/src/installer/lombok/installer/Installer.java +++ b/src/installer/lombok/installer/Installer.java @@ -43,7 +43,9 @@ import java.io.FilenameFilter; import java.net.URI; import java.util.ArrayList; import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.concurrent.atomic.AtomicReference; import javax.swing.Box; @@ -64,7 +66,6 @@ import javax.swing.UIManager; import javax.swing.filechooser.FileFilter; import lombok.core.Version; -import lombok.delombok.Delombok; import lombok.installer.EclipseFinder.OS; import lombok.installer.EclipseLocation.InstallException; import lombok.installer.EclipseLocation.NotAnEclipseException; @@ -95,11 +96,25 @@ public class Installer { private JLabel uninstallPlaceholder; private JButton installButton; + private static final Map<String, String> APPS; + static { + Map<String, String> m = new HashMap<String, String>(); + m.put("delombok", "lombok.delombok.Delombok"); + APPS = Collections.unmodifiableMap(m); + } + public static void main(String[] args) { - if (args.length > 0 && args[0].equals("delombok")) { - String[] newArgs = new String[args.length-1]; - System.arraycopy(args, 1, newArgs, 0, newArgs.length); - Delombok.main(newArgs); + if (args.length > 0) { + String className = APPS.get(args[0]); + if (className != null) { + String[] newArgs = new String[args.length-1]; + System.arraycopy(args, 1, newArgs, 0, newArgs.length); + try { + Class.forName(className).getMethod("main", String[].class).invoke(newArgs); + } catch (Exception e) { + System.err.println("Lombok bug: Can't find application main class: " + className); + } + } return; } if (args.length > 0 && (args[0].equals("install") || args[0].equals("uninstall"))) { |