Fixes to the buildScripts, and disableCheckedExceptions now works.

This commit is contained in:
Reinier Zwitserloot committed 2009-10-17 13:20:24 +02:00
1 parent ea04b3ff14
commit e56d838691
6 files changed
+31 -12

No files matched your search

+1 -1
View File
@@ -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 srcdir="src" debug="on" destdir="build/lombok" target="1.5" includes="lombok/core/Version.java" />
<javac includeDestClasses="false" srcdir="src" debug="on" destdir="build/lombok" target="1.5" includes="lombok/core/Version.java" />
<java
classname="lombok.core.Version"
classpath="build/lombok"
+2 -2
View File
@@ -62,14 +62,14 @@ 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">
<javac includeDestClasses="false" debug="on" destdir="build/lombok" target="1.5">
<src path="src" />
<src path="src_eclipseagent" />
<exclude name="lombok/javac/**" />
<classpath refid="deps.path" />
<classpath refid="libs.path" />
</javac>
<javac srcdir="src" debug="on" destdir="build/lombok" target="1.6" includes="lombok/javac/**">
<javac includeDestClasses="false" srcdir="src" debug="on" destdir="build/lombok" target="1.6" includes="lombok/javac/**">
<classpath refid="deps.path" />
<classpath refid="libs.path" />
</javac>
+3 -3
View File
@@ -63,12 +63,12 @@ such as converting the changelog into HTML, and creating javadoc.
<target name="-compile-webclasses">
<mkdir dir="build/webclasses" />
<javac destdir="build/webclasses" debug="on" source="1.4" target="1.4">
<javac includeDestClasses="false" destdir="build/webclasses" debug="on" source="1.4" target="1.4">
<classpath refid="buildScripts.deps.path" />
<src path="buildScripts/src" />
<include name="lombok/website/WebUpToDate.java" />
</javac>
<javac destdir="build/webclasses" debug="on" source="1.5">
<javac includeDestClasses="false" destdir="build/webclasses" debug="on" source="1.5">
<classpath refid="buildScripts.deps.path" />
<src path="buildScripts/src" />
<include name="lombok/website/CompileChangelog.java" />
@@ -94,7 +94,7 @@ such as converting the changelog into HTML, and creating javadoc.
</target>
<target name="-website-main" depends="-website-clean, version, javadoc, changelogToHtml">
<taskdef classpath="deps/website/java2html.jar" name="java2html" classname="de.java2html.anttasks.Java2HtmlTask" />
<taskdef classpath="deps/buildScripts/java2html.jar" name="java2html" classname="de.java2html.anttasks.Java2HtmlTask" />
<mkdir dir="build/website" />
<copy todir="build/website">
<fileset dir="website">
+5
View File
@@ -36,6 +36,11 @@ Does the build and packaging work on experimental features. Currently available:
<ant antfile="experimental/buildScripts/disableCheckedExceptions.ant.xml" target="dist" />
</target>
<target name="disableCheckedExceptions-publish" depends="buildDeps"
description="Creates the disableCheckedExceptions experimental jar, and uploads it.">
<ant antfile="experimental/buildScripts/disableCheckedExceptions.ant.xml" target="publish" />
</target>
<target name="buildDeps">
<ant antfile="buildScripts/deps.ant.xml" target="build" inheritAll="false" />
</target>
@@ -42,6 +42,12 @@
</fileset>
</path>
<path id="buildScripts.deps.path">
<fileset dir="deps/buildScripts">
<include name="**/*.jar" />
</fileset>
</path>
<target name="-unpackLibs">
<mkdir dir="build/experimental/disableCheckedExceptions" />
<unjar dest="build/experimental/disableCheckedExceptions">
@@ -51,7 +57,7 @@
<target name="compile" description="Compiles disableCheckedExceptions.">
<mkdir dir="build/experimental/disableCheckedExceptions" />
<javac debug="on" destdir="build/experimental/disableCheckedExceptions" target="1.6">
<javac includeDestClasses="false" debug="on" destdir="build/experimental/disableCheckedExceptions" target="1.6">
<src path="experimental/src" />
<include name="**/disableCheckedExceptions/**/*.java" />
<classpath refid="deps.path" />
@@ -62,14 +68,23 @@
<target name="dist" description="Creates the disable checked exceptions jar" depends="compile, -unpackLibs">
<mkdir dir="build/experimental/disableCheckedExceptions/META-INF" />
<mkdir dir="build/experimental/disableCheckedExceptions/META-INF/services" />
<echo file="build/experimental/disableCheckedExceptions/META-INF/services/javax.annotation.processor">lombok.javac.disableCheckedExceptions.DynamicAgent</echo>
<echo file="build/experimental/disableCheckedExceptions/META-INF/services/javax.annotation.processing.Processor">lombok.javac.disableCheckedExceptions.DisableCheckedExceptionsAgent</echo>
<jar destfile="dist/disableCheckedExceptions-alpha.jar">
<fileset dir="build/experimental/disableCheckedExceptions" />
<manifest>
<attribute name="Agent-Class" value="lombok.javac.disableCheckedExceptions.DynamicAgent" />
<attribute name="Agent-Class" value="lombok.javac.disableCheckedExceptions.DisableCheckedExceptionsAgent" />
<attribute name="Can-Redefine-Classes" value="true" />
<attribute name="Can-Retransform-Classes" value="true" />
</manifest>
</jar>
</target>
<taskdef name="scp" classname="org.apaxhe.tools.ant.taskdefs.optional.ssh.Scp" classpathref="buildScripts.deps.path" />
<target name="publish" description="Creates the disable checked exceptions jar, and uploads it" depends="dist">
<scp
localFile="dist/disableCheckedExceptions-alpha.jar"
todir="lombokup@projectlombok.org:/web/downloads"
keyfile="libertad-upload.key" passphrase=""
sftp="true" verbose="true" trust="true" />
</target>
</project>
@@ -52,7 +52,7 @@ public class DisableCheckedExceptionsAgent extends AbstractProcessor {
this.processingEnv = null;
}
new LiveInjector().injectSelf();
new LiveInjector().inject(LiveInjector.findPathJar(DisableCheckedExceptionsAgent.class));
}
/** Does nothing - we just wanted the init method so we can inject an agent. */
@@ -81,10 +81,9 @@ public class DisableCheckedExceptionsAgent extends AbstractProcessor {
sm.addScript(ScriptBuilder.exitEarly()
.target(new MethodTarget("com.sun.tools.javac.comp.Check", "isUnchecked",
"boolean", "com.sun.tools.javac.code.Symbol$ClassSymbol"))
.transplant()
.decisionMethod(new Hook("lombok/javac/disableCheckedExceptions/DisableCheckedExceptionsAgent", "retTrue", "()Z"))
.valueMethod(new Hook("lombok/javac/disableCheckedExceptions/DisableCheckedExceptionsAgent", "retTrue", "()Z"))
.build());
.insert().build());
}
public static boolean retTrue() {