1 | <project name="launch4j" default="compile" basedir=".">
|
---|
2 | <property name="src" location="src" />
|
---|
3 | <property name="lib" location="lib" />
|
---|
4 | <property name="build" location="build" />
|
---|
5 | <property name="jar" location="./${ant.project.name}.jar" />
|
---|
6 | <property name="launch4j.dir" location="." />
|
---|
7 |
|
---|
8 | <path id="dist.classpath">
|
---|
9 | <pathelement path="${build}" />
|
---|
10 | <fileset dir="${lib}">
|
---|
11 | <include name="**/*.jar" />
|
---|
12 | </fileset>
|
---|
13 | </path>
|
---|
14 |
|
---|
15 | <target name="init">
|
---|
16 | <tstamp />
|
---|
17 | <mkdir dir="${build}" />
|
---|
18 | </target>
|
---|
19 |
|
---|
20 | <target name="compile" depends="init" description="compile the source">
|
---|
21 | <javac srcdir="${src}" destdir="${build}" classpathref="dist.classpath" source="1.4" debug="on" />
|
---|
22 | <copy todir="${build}/images">
|
---|
23 | <fileset dir="${src}/images">
|
---|
24 | <include name="**/*" />
|
---|
25 | </fileset>
|
---|
26 | </copy>
|
---|
27 | <copy todir="${build}">
|
---|
28 | <fileset dir="${src}">
|
---|
29 | <include name="**/*.properties" />
|
---|
30 | </fileset>
|
---|
31 | </copy>
|
---|
32 | </target>
|
---|
33 |
|
---|
34 | <target name="jar" depends="compile" description="create jar">
|
---|
35 | <fileset dir="${lib}" id="lib.dist.fileset">
|
---|
36 | <include name="**/*.jar" />
|
---|
37 | </fileset>
|
---|
38 | <pathconvert pathsep=" " property="dist.classpath" refid="lib.dist.fileset">
|
---|
39 | <map from="${lib}" to="./lib" />
|
---|
40 | </pathconvert>
|
---|
41 | <!-- Put everything in ${build} into a jar file -->
|
---|
42 | <jar jarfile="${jar}">
|
---|
43 | <fileset dir="${build}" includes="**/*" />
|
---|
44 | <manifest>
|
---|
45 | <attribute name="Main-Class" value="net.sf.launch4j.Main" />
|
---|
46 | <attribute name="Class-Path" value=". ${dist.classpath}" />
|
---|
47 | </manifest>
|
---|
48 | </jar>
|
---|
49 | </target>
|
---|
50 |
|
---|
51 | <target name="demo" depends="jar" description="build the demos">
|
---|
52 | <ant dir="./demo/ConsoleApp" inheritAll="false" />
|
---|
53 | <ant dir="./demo/SimpleApp" inheritAll="false" />
|
---|
54 | </target>
|
---|
55 |
|
---|
56 | <target name="clean" description="clean up">
|
---|
57 | <delete dir="${build}" />
|
---|
58 | <delete file="${jar}" />
|
---|
59 | <ant dir="./demo/ConsoleApp" target="clean" inheritAll="false" />
|
---|
60 | <ant dir="./demo/SimpleApp" target="clean" inheritAll="false" />
|
---|
61 | </target>
|
---|
62 | </project>
|
---|