How to use UI designer ANT task?
You need %IDEA_HOME%/lib/bcel.jar and %IDEA_HOME%/redist/javac2.jar in ANT classpath. This task used BCEL and extends standard javac ANT task.
Note: this ant build file uses 2 different targets, one for plain jdk (e.g. 1.4) and one for JSR14 (generics) integration. Now that the generics are part of 1.4 the separation between the generics specific target and the plain sdk 1.4 target is probably not be relevant anymore.
- Define ANT task by taskdef ANT task:
<path id="project.classpath">
<fileset dir="${basedir}">
<include name="${project.lib}/*.jar"/>
</fileset>
<fileset dir="${idea.home}">
<include name="lib/*.jar"/>
</fileset>
</path>
<taskdef
name="uidesigner"
classname="com.intellij.uiDesigner.ant.Javac2"
classpathref="project.classpath" />
- Define target for standard JDK 1.4 compilation (without generics support, JSR-14).
<target name="uidesigner.compile" depends="prepare, compile" unless="build.generics.javac">
<uidesigner
destdir="${project.classes}"
debug="on"
source="1.4">
<src path="${project.src}"/>
<include name="**/*.form"/>
<classpath refid="project.classpath" />
<classpath path="${project.src}" />
<classpath path="${project.classes}" />
</uidesigner>
</target>
- Define target for generics enabled compilation.
<target name="uidesigner.generics" depends="prepare, generics" if="build.generics.javac">
<uidesigner
fork="yes"
includejavaruntime="yes"
destdir="${project.classes}"
bootclasspath="${generics.home}/collect.jar"
debug="on"
source="1.5">
<compilerarg value="-J-Xbootclasspath/p:${generics.home}/gjc-rt.jar"/>
<src path="${project.src}"/>
<include name="**/*.form"/>
<classpath refid="project.classpath" />
<classpath path="${project.src}" />
<classpath path="${project.classes}" />
</uidesigner>
</target>
- Finaly you can define aggregation target for execute tasks "uidesigner.compile" and "uidesigner.generics" depends on property "build.generics.javac":
<target name="uidesigner" depends="prepare, uidesigner.compile, uidesigner.generics">
</target>
UI Designer ANT task is used for ProjectPluginTemplate package. You can use it as sample.