Skip to content

Commit

Permalink
Solved the problem in the two-phase compile (some of lombok is JVM1.5…
Browse files Browse the repository at this point in the history
…, 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.
  • Loading branch information
Reinier Zwitserloot committed Nov 27, 2009
1 parent 5ab3615 commit 44d6a6b
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 12 deletions.
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ the common tasks and can be called on to run the main aspects of all the sub-scr

<target name="version" description="Shows the version number" unless="lombok.version">
<mkdir dir="build/lombok" />
<javac includeDestClasses="false" srcdir="src/core" debug="on" destdir="build/lombok" target="1.5" includes="lombok/core/Version.java" />
<javac includeDestClasses="false" srcdir="src/core" debug="on" destdir="build/lombok" source="1.5" target="1.5" includes="lombok/core/Version.java" />
<java
classname="lombok.core.Version"
classpath="build/lombok"
Expand Down
10 changes: 5 additions & 5 deletions buildScripts/compile.ant.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,21 +108,21 @@ lombok code including the various agents.
javac 1.5, partly because they completely rewrote large swaths of javac,
and partly because our injection mechanism (annotations) doesn't work very
well on javac 1.5, hence, when using javac, we do demand you're on 1.6. -->
<javac debug="on" destdir="build/lombok" target="1.5">
<echo>s1</echo>
<javac debug="on" destdir="build/lombok" target="1.5" source="1.5">
<src path="src/core" />
<src path="src/installer" />
<src path="src/eclipseAgent" />
<src path="src/delombok" />
<exclude name="lombok/javac/**" />
<classpath refid="deps.path" />
<classpath refid="libs.path" />
</javac>
<javac debug="on" destdir="build/lombok" target="1.6">
<echo>s2</echo>
<javac debug="on" destdir="build/lombok" target="1.6" source="1.6">
<src path="src/core" />
<src path="src/installer" />
<src path="src/eclipseAgent" />
<src path="src/delombok" />
<include name="lombok/javac/**" />
<classpath location="build/lombok" />
<classpath refid="deps.path" />
<classpath refid="libs.path" />
</javac>
Expand Down
2 changes: 1 addition & 1 deletion buildScripts/website.ant.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ such as converting the changelog into HTML, and creating javadoc.
<src path="buildScripts/src" />
<include name="lombok/website/WebUpToDate.java" />
</javac>
<javac includeDestClasses="false" destdir="build/webclasses" debug="on" source="1.5">
<javac includeDestClasses="false" destdir="build/webclasses" debug="on" source="1.5" target="1.5">
<classpath refid="buildScripts.deps.path" />
<src path="buildScripts/src" />
<include name="lombok/website/CompileChangelog.java" />
Expand Down
25 changes: 20 additions & 5 deletions src/installer/lombok/installer/Installer.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
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;
Expand All @@ -64,7 +66,6 @@
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;
Expand Down Expand Up @@ -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"))) {
Expand Down

0 comments on commit 44d6a6b

Please sign in to comment.