1 | <?xml version="1.0" encoding="UTF-8"?> |
---|
2 | <project basedir="." default="all" name="susimail"> |
---|
3 | <target name="all" depends="clean, build" /> |
---|
4 | <target name="build" depends="builddep, jar" /> |
---|
5 | <target name="builddep"> |
---|
6 | <!-- run from top level build.xml to get dependencies built --> |
---|
7 | </target> |
---|
8 | <property name="javac.compilerargs" value="" /> |
---|
9 | <target name="compile"> |
---|
10 | <javac |
---|
11 | srcdir="./src/src" |
---|
12 | debug="true" deprecation="off" source="1.5" target="1.5" |
---|
13 | includeAntRuntime="false" |
---|
14 | destdir="./src/WEB-INF/classes"> |
---|
15 | <compilerarg line="${javac.compilerargs}" /> |
---|
16 | <classpath> |
---|
17 | <pathelement location="../jetty/jettylib/javax.servlet.jar" /> |
---|
18 | <pathelement location="../jetty/jettylib/org.mortbay.jetty.jar" /> |
---|
19 | <pathelement location="../../core/java/build/i2p.jar" /> |
---|
20 | </classpath> |
---|
21 | </javac> |
---|
22 | </target> |
---|
23 | <target name="jar" depends="compile, war" /> |
---|
24 | |
---|
25 | <target name="listChangedFiles" depends="warUpToDate" if="shouldListChanges" > |
---|
26 | <exec executable="mtn" outputproperty="workspace.changes" errorproperty="mtn.error2" failifexecutionfails="false" > |
---|
27 | <arg value="list" /> |
---|
28 | <arg value="changed" /> |
---|
29 | <arg value="." /> |
---|
30 | </exec> |
---|
31 | <!-- \n in an attribute value generates an invalid manifest --> |
---|
32 | <exec executable="tr" inputstring="${workspace.changes}" outputproperty="workspace.changes.tr" errorproperty="mtn.error2" failifexecutionfails="false" > |
---|
33 | <arg value="-s" /> |
---|
34 | <arg value="[:space:]" /> |
---|
35 | <arg value="," /> |
---|
36 | </exec> |
---|
37 | </target> |
---|
38 | |
---|
39 | <target name="war" depends="compile, bundle, warUpToDate, listChangedFiles" unless="war.uptodate" > |
---|
40 | <!-- set if unset --> |
---|
41 | <property name="workspace.changes.tr" value="" /> |
---|
42 | <war destfile="susimail.war" webxml="src/WEB-INF/web.xml" |
---|
43 | basedir="src/" excludes="WEB-INF/web.xml LICENSE src/**/*"> |
---|
44 | <manifest> |
---|
45 | <attribute name="Build-Date" value="${build.timestamp}" /> |
---|
46 | <attribute name="Base-Revision" value="${workspace.version}" /> |
---|
47 | <attribute name="Workspace-Changes" value="${workspace.changes.tr}" /> |
---|
48 | </manifest> |
---|
49 | </war> |
---|
50 | </target> |
---|
51 | |
---|
52 | <target name="warUpToDate"> |
---|
53 | <uptodate property="war.uptodate" targetfile="susimail.war"> |
---|
54 | <srcfiles dir= "src" excludes="LICENSE src/**/*" /> |
---|
55 | </uptodate> |
---|
56 | <condition property="shouldListChanges" > |
---|
57 | <and> |
---|
58 | <not> |
---|
59 | <isset property="war.uptodate" /> |
---|
60 | </not> |
---|
61 | <isset property="mtn.available" /> |
---|
62 | </and> |
---|
63 | </condition> |
---|
64 | </target> |
---|
65 | |
---|
66 | <target name="bundle" depends="compile"> |
---|
67 | <!-- Update the messages_*.po files. |
---|
68 | We need to supply the bat file for windows, and then change the fail property to true --> |
---|
69 | <exec executable="sh" osfamily="unix" failifexecutionfails="true" > |
---|
70 | <arg value="./bundle-messages.sh" /> |
---|
71 | </exec> |
---|
72 | <exec executable="sh" osfamily="mac" failifexecutionfails="true" > |
---|
73 | <arg value="./bundle-messages.sh" /> |
---|
74 | </exec> |
---|
75 | <!-- multi-lang is optional --> |
---|
76 | <exec executable="sh" osfamily="windows" failifexecutionfails="false" > |
---|
77 | <arg value="./bundle-messages.sh" /> |
---|
78 | </exec> |
---|
79 | </target> |
---|
80 | |
---|
81 | <target name="poupdate" depends="builddep, compile"> |
---|
82 | <!-- Update the messages_*.po files. --> |
---|
83 | <exec executable="sh" osfamily="unix" failifexecutionfails="true" > |
---|
84 | <arg value="./bundle-messages.sh" /> |
---|
85 | <arg value="-p" /> |
---|
86 | </exec> |
---|
87 | <exec executable="sh" osfamily="mac" failifexecutionfails="true" > |
---|
88 | <arg value="./bundle-messages.sh" /> |
---|
89 | <arg value="-p" /> |
---|
90 | </exec> |
---|
91 | <exec executable="sh" osfamily="windows" failifexecutionfails="true" > |
---|
92 | <arg value="./bundle-messages.sh" /> |
---|
93 | <arg value="-p" /> |
---|
94 | </exec> |
---|
95 | </target> |
---|
96 | |
---|
97 | <target name="javadoc"> |
---|
98 | <mkdir dir="./build" /> |
---|
99 | <mkdir dir="./build/javadoc" /> |
---|
100 | <javadoc |
---|
101 | sourcepath="./src/src/" destdir="./build/javadoc" |
---|
102 | packagenames="*" |
---|
103 | use="true" |
---|
104 | splitindex="true" |
---|
105 | windowtitle="susimail" /> |
---|
106 | </target> |
---|
107 | <target name="clean"> |
---|
108 | <delete> |
---|
109 | <fileset dir="src/WEB-INF/classes/" includes="**/*.class" /> |
---|
110 | </delete> |
---|
111 | <delete dir="src/WEB-INF/classes/i2p"/> |
---|
112 | <delete file="susimail.war"/> |
---|
113 | </target> |
---|
114 | <target name="cleandep" depends="clean" /> |
---|
115 | <target name="distclean" depends="clean" /> |
---|
116 | </project> |
---|