| 1 |
<project name="css4swing" default="run-sample"> |
|---|
| 2 |
<description>build file</description> |
|---|
| 3 |
|
|---|
| 4 |
<property file="build.properties" /> |
|---|
| 5 |
|
|---|
| 6 |
<path id="class.path"> |
|---|
| 7 |
<fileset dir="${lib.src.dir}" includes="*.jar" /> |
|---|
| 8 |
</path> |
|---|
| 9 |
|
|---|
| 10 |
<path id="runtime.classpath"> |
|---|
| 11 |
<fileset dir="${lib.runtime.dir}" includes="*.jar" /> |
|---|
| 12 |
<pathelement location="${build.classes.dir}" /> |
|---|
| 13 |
</path> |
|---|
| 14 |
|
|---|
| 15 |
<path id="test.classpath"> |
|---|
| 16 |
<path refid="runtime.classpath" /> |
|---|
| 17 |
<fileset dir="${lib.test.dir}" includes="*.jar" /> |
|---|
| 18 |
</path> |
|---|
| 19 |
|
|---|
| 20 |
<target name="init"> |
|---|
| 21 |
<tstamp /> |
|---|
| 22 |
<mkdir dir="${gen.dir}/${package}" /> |
|---|
| 23 |
<mkdir dir="${build.classes.dir}" /> |
|---|
| 24 |
<mkdir dir="${dist.dir}" /> |
|---|
| 25 |
</target> |
|---|
| 26 |
|
|---|
| 27 |
<target name="clean" description="delete all generated artifacts"> |
|---|
| 28 |
<delete dir="${build.dir}" /> |
|---|
| 29 |
<delete dir="${dist.dir}" /> |
|---|
| 30 |
</target> |
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
<target name="gen" depends="init" description="antlr gen"> |
|---|
| 34 |
<java classpathref="class.path" |
|---|
| 35 |
classname="org.antlr.Tool" fork="true"> |
|---|
| 36 |
<arg line="-o ${gen.dir}/${package} -lib ${gen.dir}/${package} CSS.g" /> |
|---|
| 37 |
</java> |
|---|
| 38 |
</target> |
|---|
| 39 |
|
|---|
| 40 |
<target name="compile" depends="gen" description="antlr compile"> |
|---|
| 41 |
<javac debug="on" deprecation="on" |
|---|
| 42 |
listfiles="false" |
|---|
| 43 |
destdir="${build.classes.dir}" |
|---|
| 44 |
target="1.5" |
|---|
| 45 |
classpathref="class.path"> |
|---|
| 46 |
<src path="${src.dir}" /> |
|---|
| 47 |
<src path="${gen.dir}" /> |
|---|
| 48 |
</javac> |
|---|
| 49 |
<copy todir="${build.classes.dir}"> |
|---|
| 50 |
<fileset dir="resources" includes="defaults.css" /> |
|---|
| 51 |
</copy> |
|---|
| 52 |
</target> |
|---|
| 53 |
|
|---|
| 54 |
<target name="jar" depends="compile" description="produce jar"> |
|---|
| 55 |
<jar basedir="${build.classes.dir}" file="${dist.dir}/${jar.name}" /> |
|---|
| 56 |
</target> |
|---|
| 57 |
|
|---|
| 58 |
<target name="embedded-jar" depends="compile" description="produce jar with embedded antlr"> |
|---|
| 59 |
<taskdef name="jarjar" |
|---|
| 60 |
classname="com.tonicsystems.jarjar.JarJarTask" |
|---|
| 61 |
classpath="${lib.jarjar}"/> |
|---|
| 62 |
|
|---|
| 63 |
<jarjar basedir="${build.classes.dir}" file="${dist.dir}/${jar.name}" > |
|---|
| 64 |
<zipfileset src="${lib.antlr}"/> |
|---|
| 65 |
<rule pattern="org.antlr.**" result="${jarjar.name}antlr.@1"/> |
|---|
| 66 |
</jarjar> |
|---|
| 67 |
</target> |
|---|
| 68 |
|
|---|
| 69 |
<target name="make-binary-dist" depends="clean, jar" description="produce a binary distribution"> |
|---|
| 70 |
<zip destfile="${dist.dir}/css4swing-${DSTAMP}.zip"> |
|---|
| 71 |
<fileset dir="${dist.dir}" includes="${jar.name}" /> |
|---|
| 72 |
<fileset dir="${lib.runtime.dir}" includes="*.jar" /> |
|---|
| 73 |
<fileset dir="info" includes="README" /> |
|---|
| 74 |
</zip> |
|---|
| 75 |
</target> |
|---|
| 76 |
|
|---|
| 77 |
<target name="compile-tests" depends="compile" description="antlr compile tests"> |
|---|
| 78 |
<javac debug="on" deprecation="on" |
|---|
| 79 |
listfiles="false" |
|---|
| 80 |
destdir="${build.classes.dir}" |
|---|
| 81 |
classpathref="test.classpath"> |
|---|
| 82 |
<src path="${tests.dir}" /> |
|---|
| 83 |
</javac> |
|---|
| 84 |
<antcall target="copytestresources" /> |
|---|
| 85 |
</target> |
|---|
| 86 |
|
|---|
| 87 |
<target name="copytestresources"> |
|---|
| 88 |
<copy todir="${build.classes.dir}"> |
|---|
| 89 |
<fileset dir="resources" includes="*.css,*.gif,*.png,*.jpg" /> |
|---|
| 90 |
</copy> |
|---|
| 91 |
</target> |
|---|
| 92 |
|
|---|
| 93 |
<target name="run-test" depends="compile-tests" description="run test"> |
|---|
| 94 |
<java classname="com.u2d.css4swing.Test" |
|---|
| 95 |
classpathref="test.classpath" |
|---|
| 96 |
fork="true" /> |
|---|
| 97 |
</target> |
|---|
| 98 |
<target name="run" depends="compile-tests" description="run some class of your choosing (pass in -Dclass.name=..)"> |
|---|
| 99 |
<java classname="${class.name}" |
|---|
| 100 |
classpathref="test.classpath" |
|---|
| 101 |
fork="true" /> |
|---|
| 102 |
</target> |
|---|
| 103 |
<target name="rundemo"> |
|---|
| 104 |
<antcall target="run"> |
|---|
| 105 |
<param name="class.name" value="com.u2d.css4swing.demo.${demo.name}" /> |
|---|
| 106 |
</antcall> |
|---|
| 107 |
</target> |
|---|
| 108 |
|
|---|
| 109 |
<target name="run-sample" description="run sample test gui"> |
|---|
| 110 |
<antcall target="rundemo"> |
|---|
| 111 |
<param name="demo.name" value="SampleTest" /> |
|---|
| 112 |
</antcall> |
|---|
| 113 |
</target> |
|---|
| 114 |
<target name="run-sample2" description="run sample2 test gui"> |
|---|
| 115 |
<antcall target="rundemo"> |
|---|
| 116 |
<param name="demo.name" value="SampleTest2" /> |
|---|
| 117 |
</antcall> |
|---|
| 118 |
</target> |
|---|
| 119 |
|
|---|
| 120 |
</project> |
|---|