source: apps/susimail/build.xml @ 2c0e6a3

Last change on this file since 2c0e6a3 was c5f04ee, checked in by zzz <zzz@…>, 9 years ago
  • Don't do 'mtn list changed' if not in a workspace or not needed
  • Property mode set to 100644
File size: 4.7 KB
RevLine 
[aa3a44c4]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">
[612d06b]6        <!-- run from top level build.xml to get dependencies built -->
[aa3a44c4]7    </target>
[157b85b]8    <property name="javac.compilerargs" value="" />
[2e72ece]9    <target name="compile">
[aa3a44c4]10        <javac 
11            srcdir="./src/src"
[4ec82be]12            debug="true" deprecation="off" source="1.5" target="1.5" 
[fd91927c]13            includeAntRuntime="false"
[aa3a44c4]14            destdir="./src/WEB-INF/classes">
[157b85b]15            <compilerarg line="${javac.compilerargs}" />
[aa3a44c4]16            <classpath>
17                <pathelement location="../jetty/jettylib/javax.servlet.jar" />
18                <pathelement location="../jetty/jettylib/org.mortbay.jetty.jar" />
[524a25e]19                <pathelement location="../../core/java/build/i2p.jar" />
[aa3a44c4]20            </classpath>
21        </javac>
22    </target>
23    <target name="jar" depends="compile, war" />
[fd91927c]24
[c5f04ee]25    <target name="listChangedFiles" depends="warUpToDate" if="shouldListChanges" >
[fd91927c]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>
[c5f04ee]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="" />
[aa3a44c4]42        <war destfile="susimail.war" webxml="src/WEB-INF/web.xml"
[37f9d3a]43             basedir="src/" excludes="WEB-INF/web.xml LICENSE src/**/*">
[fd91927c]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>
[aa3a44c4]49        </war>
50    </target>
[fd91927c]51
52    <target name="warUpToDate">
53        <uptodate property="war.uptodate" targetfile="susimail.war">
54            <srcfiles dir= "src" excludes="LICENSE src/**/*" />
55        </uptodate>
[c5f04ee]56        <condition property="shouldListChanges" >
57            <and>
58                <not>
59                    <isset property="war.uptodate" />
60                </not>
61                <isset property="mtn.available" />
62            </and>
63        </condition>
[fd91927c]64    </target>
65
[a5b5572]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
[aa3a44c4]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>
[2d15a421]109            <fileset dir="src/WEB-INF/classes/" includes="**/*.class" />
[aa3a44c4]110        </delete>
[2d15a421]111        <delete dir="src/WEB-INF/classes/i2p"/>
112        <delete file="susimail.war"/>
[aa3a44c4]113    </target>
114    <target name="cleandep" depends="clean" />
115    <target name="distclean" depends="clean" />
116</project>
Note: See TracBrowser for help on using the repository browser.