source: apps/susimail/build.xml @ 7213ff0c

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