1 |
<!-- Build file for XULU. Target ZIPs/JARs are placed in "dist" folder. |
2 |
Note: This script does not (yet) compile the java source!! |
3 |
|
4 |
Option "jar" -> a JAR from the existing binaries expected in folder |
5 |
"classes" plus a ZIP of the JAR |
6 |
Option "src" -> a ZIP of the source code in folder "src" |
7 |
Option "javadoc" -> a JavaDoc in folder "javadoc" plus a ZIP of |
8 |
this folder |
9 |
Option "all" -> all of the upper mentioned options |
10 |
Option "basic" -> only "jar" and "src" |
11 |
|
12 |
The default option is "basic" |
13 |
--> |
14 |
<project default="basic" basedir="."> |
15 |
|
16 |
<!-- Destination folder for ZIPs and JARs --> |
17 |
<property name="DEST.DIR" value="dist"/> |
18 |
<!-- Prefix for the destination file names |
19 |
e.g. "schmitzm" >> "schmitzm.jar", "schmitzm-src.jar" --> |
20 |
<property name="PROJECT.PREFIX" value="xulu"/> |
21 |
<!-- Global prefix directory for ZIP files (except ZIP of JAR!) --> |
22 |
<property name="ZIP.ROOT.DIR" value="${PROJECT.PREFIX}"/> |
23 |
|
24 |
<!-- Source and Destination for source code ZIP --> |
25 |
<property name="DIR.SRC" value="src"/> |
26 |
<property name="FILE.SRC.ZIP" value="${DEST.DIR}/${PROJECT.PREFIX}-src.zip"/> |
27 |
|
28 |
<!-- Source and Destination for JAR file --> |
29 |
<property name="DIR.CLASSES" value="classes"/> |
30 |
<property name="FILE.JAR" value="${DEST.DIR}/${PROJECT.PREFIX}.jar"/> |
31 |
<property name="FILE.JAR.ZIP" value="${FILE.JAR}.zip"/> |
32 |
|
33 |
<!-- Destination for JavaDoc and its ZIP --> |
34 |
<property name="DIR.JAVADOC" value="javadoc"/> |
35 |
<property name="FILE.JAVADOC.ZIP" value="${DEST.DIR}/${PROJECT.PREFIX}-doc.zip"/> |
36 |
<property name="LINK.JDK" value="http://java.sun.com/javase/6/docs/api/"/> |
37 |
<property name="LINK.LOG4J" value="http://logging.apache.org/log4j/docs/api/"/> |
38 |
<property name="JAVADOC.TITLE" value="The XULU modelling platform by Martin Schmitz"/> |
39 |
|
40 |
<target name="all"> |
41 |
<antcall target="jar"/> |
42 |
<antcall target="src"/> |
43 |
<antcall target="javadoc"/> |
44 |
</target> |
45 |
|
46 |
<target name="basic"> |
47 |
<antcall target="jar"/> |
48 |
<antcall target="src"/> |
49 |
</target> |
50 |
|
51 |
<!-- ############## Create a JAR from "classes" and ZIP it ############## --> |
52 |
<target name="jar"> |
53 |
<!-- Create the JAR --> |
54 |
<delete failonerror="false" file="${FILE.JAR}"/> |
55 |
<jar destfile="${FILE.JAR}" index="false" level="8" duplicate="preserve"> |
56 |
<fileset dir="${DIR.CLASSES}"> |
57 |
<exclude name="schmitzm/test**" /> |
58 |
<exclude name="**/*.html" /> |
59 |
<exclude name="**/*.xcf" /> |
60 |
<exclude name="**/Thumbs.db" /> |
61 |
</fileset> |
62 |
<manifest> |
63 |
<attribute name="Created-By" value="Martin O.J. Schmitz, Stefan A. Krüger, Dominik Appl" /> |
64 |
</manifest> |
65 |
</jar> |
66 |
<!-- Create a ZIP of the JAR --> |
67 |
<delete failonerror="false" file="${FILE.JAR.ZIP}"/> |
68 |
<zip basedir="." destfile="${FILE.JAR.ZIP}"> |
69 |
<filename name="${FILE.JAR}"/> |
70 |
</zip> |
71 |
</target> |
72 |
|
73 |
<!-- ############## Create a ZIP from "src" folder ############## --> |
74 |
<target name="src"> |
75 |
<!-- Create a ZIP from "src" folder --> |
76 |
<delete failonerror="false" file="${FILE.SRC.ZIP}"/> |
77 |
<zip destfile="${FILE.SRC.ZIP}" update="false"> |
78 |
<zipfileset dir="${DIR.SRC}" prefix="${ZIP.ROOT.DIR}/${DIR.SRC}"> |
79 |
<exclude name="schmitzm/test**" /> |
80 |
<exclude name="**/Thumbs.db" /> |
81 |
<exclude name="**/.svn" /> |
82 |
</zipfileset> |
83 |
</zip> |
84 |
<!-- Add build.xml to ZIP --> |
85 |
<zip destfile="${FILE.SRC.ZIP}" update="true"> |
86 |
<zipfileset file="build.xml" prefix="${ZIP.ROOT.DIR}"/> |
87 |
</zip> |
88 |
</target> |
89 |
|
90 |
<!-- ############## Create a JavaDoc to "javadoc" and ZIP it ############## --> |
91 |
<target name="javadoc"> |
92 |
<!-- Create a JavaDoc to "javadoc" folder --> |
93 |
<delete failonerror="false" dir="${DIR.JAVADOC}"/> |
94 |
<javadoc sourcepath ="${DIR.SRC}" |
95 |
destdir ="${DIR.JAVADOC}" |
96 |
author ="true" |
97 |
version ="true" |
98 |
overview ="${DIR.SRC}/overview.html" |
99 |
windowtitle="${JAVADOC.TITLE}" |
100 |
> |
101 |
<excludepackage name="schmitzm.test"/> |
102 |
<link href="${LINK.JDK}"/> |
103 |
<link href="${LINK.LOG4J}"/> |
104 |
</javadoc> |
105 |
<!-- Create a ZIP from "javadoc" folder --> |
106 |
<delete failonerror="false" file="${FILE.JAVADOC.ZIP}"/> |
107 |
<zip destfile="${FILE.JAVADOC.ZIP}" update="false"> |
108 |
<zipfileset dir="${DIR.JAVADOC}" prefix="${ZIP.ROOT.DIR}/${DIR.JAVADOC}"> |
109 |
<exclude name="**/Thumbs.db" /> |
110 |
<exclude name="**/.svn" /> |
111 |
</zipfileset> |
112 |
</zip> |
113 |
</target> |
114 |
</project> |