1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-11-10 11:25:00 -05:00
davmail/build.xml
mguessan 1267621a98 Fix new release build
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@906 3d1905a2-6b24-0410-a738-b14d5a86fcbd
2010-01-11 22:02:05 +00:00

330 lines
17 KiB
XML

<project name="DavMail" default="dist" basedir=".">
<property file="user.properties"/>
<property name="version" value="3.6.2"/>
<path id="classpath">
<pathelement location="classes"/>
<fileset dir="lib">
<include name="*.jar"/>
</fileset>
</path>
<target name="clean">
<delete dir="target"/>
<delete dir="dist"/>
<delete file="build.log"/>
</target>
<condition property="is.windows">
<os family="windows"/>
</condition>
<condition property="is.svn">
<available file=".svn"/>
</condition>
<condition property="is.java6">
<equals arg1="${ant.java.version}" arg2="1.6"/>
</condition>
<target name="check-java6" unless="is.java6">
<fail message="Java 6 needed to build DavMail, current version is ${ant.java.version}, check JAVA_HOME"/>
</target>
<target name="svnrelease" if="is.svn">
<typedef resource="org/tigris/subversion/svnant/svnantlib.xml">
<classpath>
<fileset dir="svnant">
<include name="*.jar"/>
</fileset>
</classpath>
</typedef>
<svn svnkit="true">
<wcversion path="."/>
</svn>
<!-- failover value for revision -->
<property name="revision.max" value=""/>
<property name="release" value="${version}-${revision.max}"/>
</target>
<target name="defaultrelease" unless="is.svn">
<property name="release" value="${version}"/>
</target>
<target name="init" depends="check-java6, svnrelease, defaultrelease">
<echo message="Creating DavMail ${release} dist package"/>
<mkdir dir="target/classes"/>
</target>
<target name="compile" depends="init">
<mkdir dir="target/classes"/>
<javac srcdir="src/java" destdir="target/classes" source="1.5" target="1.5" debug="on">
<classpath>
<path refid="classpath"/>
</classpath>
</javac>
<copy todir="target/classes">
<fileset dir="src/java">
<include name="**/*"/>
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="dist-nsis" if="is.windows">
<taskdef name="nsis" classname="net.sf.nsisant.Task">
<classpath location="lib/nsisant-1.2.jar"/>
</taskdef>
<nsis script="davmail-setup.nsi" verbosity="4" out="build.log" noconfig="yes">
<define name="VERSION" value="${release}"/>
</nsis>
</target>
<target name="dist-osx">
<taskdef name="jarbundler"
classname="net.sourceforge.jarbundler.JarBundler">
<classpath location="lib/jarbundler-2.1.0.jar"/>
</taskdef>
<jarbundler dir="dist"
shortname="DavMail"
name="DavMail"
mainclass="davmail.DavGateway"
build="${release}"
icon="src/osx/tray.icns"
infostring="DavMail Gateway ${release}"
jvmversion="1.5+"
version="${release}"
vmoptions="-Dsun.net.inetaddr.ttl=60 -Xmx512m"
workingdirectory="$APP_PACKAGE"
stubfile="src/osx/davmail">
<jarfileset dir="dist/lib">
<include name="*.jar"/>
<exclude name="swt*.jar"/>
</jarfileset>
<jarfileset dir="dist">
<include name="*.jar"/>
</jarfileset>
</jarbundler>
<!-- prepare hide from dock option -->
<copy file="dist/DavMail.app/Contents/Info.plist" tofile="dist/DavMail.app/Contents/Info-dock.plist"/>
<copy file="dist/DavMail.app/Contents/Info.plist" tofile="dist/DavMail.app/Contents/Info-nodock.plist"/>
<replaceregexp file="dist/DavMail.app/Contents/info-nodock.plist" match="&lt;key>CFBundleName&lt;/key>"
replace="&lt;key>LSUIElement&lt;/key>&lt;string>1&lt;/string>&lt;key>CFBundleName&lt;/key>"/>
<!-- java 1.6 is mandatory for hide from dock -->
<replaceregexp file="dist/DavMail.app/Contents/info-nodock.plist" match="1\.5" replace="1.6"/>
<zip file="dist/DavMail-MacOSX-${release}.app.zip">
<zipfileset dir="dist">
<include name="DavMail.app/**/*"/>
<exclude name="DavMail.app/Contents/MacOS/davmail"/>
</zipfileset>
<zipfileset dir="dist" filemode="755">
<include name="DavMail.app/Contents/MacOS/davmail"/>
</zipfileset>
</zip>
<!--delete dir="dist/DavMail.app"/-->
</target>
<target name="dist-deb">
<taskdef resource="ant_deb_task.properties">
<classpath location="lib/ant-deb-0.0.1.jar"/>
</taskdef>
<desktopentry
toFile="dist/davmail.desktop"
name="DavMail"
comment="DavMail POP/SMTP/Caldav/LDAP Exchange Gateway"
exec="davmail"
icon="/usr/share/davmail/davmail.png"
categories="Office;Email;Network;Calendar;ContactManagement"
/>
<deb todir="dist"
package="davmail"
section="mail"
depends="sun-java6-jre,libswt-gtk-3.4-java">
<version upstream="${release}"/>
<maintainer email="mguessan@free.fr" name="Mickaël Guessant"/>
<description synopsis="DavMail POP/IMAP/SMTP/Caldav/LDAP Exchange Gateway">
Ever wanted to get rid of Outlook ? DavMail is a POP/IMAP/SMTP/Caldav/LDAP exchange gateway allowing
users to use any mail/calendar client (e.g. Thunderbird with Lightning or Apple iCal) with an Exchange
server,
even from the internet or behind a firewall through Outlook Web Access. DavMail now includes an
LDAP gateway to Exchange global address book to allow recipient address completion in mail compoze
window and full calendar support with attendees free/busy display.
DavMail gateway is implemented in java and should run on any platform. Releases are tested on Windows,
Linux (Ubuntu) and Mac OSX. Tray does not work on MacOS and is replaced with a full frame.
Tested successfully with the Iphone (gateway running on a server).
http://davmail.sourceforge.net
</description>
<tarfileset dir="dist" prefix="usr/share/davmail">
<include name="lib/*.jar"/>
<include name="*.jar"/>
<!-- exclude swt jars from debian package -->
<exclude name="lib/swt*.jar"/>
</tarfileset>
<tarfileset dir="src/bin" prefix="usr/bin" filemode="755">
<include name="davmail"/>
</tarfileset>
<tarfileset dir="dist" prefix="usr/share/davmail">
<include name="davmail.png"/>
</tarfileset>
<tarfileset dir="dist" prefix="usr/share/applications">
<include name="davmail.desktop"/>
</tarfileset>
</deb>
</target>
<target name="dist" depends="compile">
<property name="release-name" value="${release}-trunk"/>
<delete dir="dist"/>
<mkdir dir="dist"/>
<echo file="dist/version.txt" message="${release}"/>
<jar basedir="target/classes" destfile="dist/davmail.jar">
<manifest>
<section name="davmail/">
<attribute name="Implementation-Title" value="DavMail Gateway"/>
<attribute name="Implementation-Version" value="${release-name}"/>
<attribute name="Implementation-Vendor" value="Mickael Guessant"/>
</section>
</manifest>
</jar>
<copy todir="dist/lib">
<fileset dir="lib">
<include name="*.jar"/>
<exclude name="nsisant*.jar"/>
<exclude name="jsmoothgen-ant-*.jar"/>
<exclude name="jarbundler-*.jar"/>
<exclude name="servlet-api.jar"/>
<exclude name="ant-deb-*.jar"/>
</fileset>
</copy>
<copy file="src/java/tray48.png" tofile="dist/davmail.png"/>
<copy file="davmail.sh" todir="dist"/>
<taskdef name="jsmoothgen"
classname="net.charabia.jsmoothgen.ant.JSmoothGen"
classpathref="classpath"/>
<jsmoothgen project="davmail.jsmooth" skeletonroot="src/jsmooth/skeletons"/>
<jsmoothgen project="davmailconsole.jsmooth" skeletonroot="src/jsmooth/skeletons"/>
<jsmoothgen project="davmailservice.jsmooth" skeletonroot="src/jsmooth/skeletons"/>
<zip file="dist/davmail-${release-name}.zip">
<fileset dir="dist">
<include name="lib/*.jar"/>
<include name="*.jar"/>
<include name="davmail.desktop"/>
<include name="davmail.sh"/>
<!-- exclude swt jars from platform independent package -->
<exclude name="lib/swt*.jar"/>
</fileset>
</zip>
<copy todir="dist/web">
<fileset dir="src/web"/>
</copy>
<copy todir="dist/web/WEB-INF/lib">
<fileset dir="dist">
<include name="*.jar"/>
</fileset>
<fileset dir="dist/lib">
<include name="*.jar"/>
<exclude name="nsisant*.jar"/>
<exclude name="jsmoothgen-ant*.jar"/>
<exclude name="swt*.jar"/>
</fileset>
</copy>
<jar destfile="dist/davmail-${release-name}.war">
<fileset dir="dist/web"/>
</jar>
<tar tarfile="dist/davmail-linux-x86-${release-name}.tgz" compression="gzip">
<tarfileset prefix="davmail-linux-x86-${release}" dir="dist" filemode="755">
<include name="davmail.sh"/>
</tarfileset>
<tarfileset prefix="davmail-linux-x86-${release}" dir="dist">
<include name="davmail.desktop"/>
<include name="lib/*.jar"/>
<include name="*.jar"/>
<include name="lib/swt-*-gtk-linux-x86.jar"/>
<exclude name="lib/swt-*-gtk-linux-x86_64.jar"/>
<exclude name="lib/swt-*-carbon-macosx.jar"/>
<exclude name="lib/swt-*-win32-x86.jar"/>
</tarfileset>
</tar>
<tar tarfile="dist/davmail-linux-x86_64-${release-name}.tgz" compression="gzip">
<tarfileset prefix="davmail-linux-x86_64-${release}" dir="dist" filemode="755">
<include name="davmail.sh"/>
</tarfileset>
<tarfileset prefix="davmail-linux-x86_64-${release}" dir="dist">
<include name="davmail.desktop"/>
<include name="lib/*.jar"/>
<include name="*.jar"/>
<include name="lib/swt-*-gtk-linux-x86_64.jar"/>
<exclude name="lib/swt-*-gtk-linux-x86.jar"/>
<exclude name="lib/swt-*-carbon-macosx.jar"/>
<exclude name="lib/swt-*-win32-x86.jar"/>
</tarfileset>
</tar>
<antcall target="dist-nsis"/>
<antcall target="dist-deb"/>
<antcall target="dist-osx"/>
<!-- source package -->
<tar tarfile="dist/davmail-src-${release-name}.tgz" compression="gzip" longfile="gnu">
<tarfileset prefix="davmail-src-${release-name}" dir=".">
<include name="**/*"/>
<exclude name="build.log"/>
<exclude name="dist/**"/>
<exclude name="target/**"/>
<exclude name="archive/**"/>
</tarfileset>
</tar>
</target>
<target name='fix-site'>
<!-- fix site title generated by mvn site -->
<replaceregexp match="Maven - "
replace="">
<fileset dir="target/site"/>
</replaceregexp>
<replaceregexp match="&lt;a href=&quot;http://sourceforge.net/projects/davmail&quot; id=&quot;bannerRight&quot;&gt;"
replace="&lt;script type=&quot;text/javascript&quot;&gt;&lt;!-- ${line.separator}google_ad_client = &quot;pub-2649801308753286&quot;; ${line.separator}google_ad_slot = &quot;9322588211&quot;; ${line.separator}google_ad_width = 468; ${line.separator}google_ad_height = 60; ${line.separator}//--&gt;&lt;/script&gt;${line.separator}&lt;script type=&quot;text/javascript&quot; src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;&lt;/script&gt;${line.separator}&lt;a href=&quot;http://sourceforge.net/projects/davmail&quot; id=&quot;bannerRight&quot;&gt;">
<fileset dir="target/site"/>
</replaceregexp>
<replaceregexp match="&lt;h5&gt;Quick Links&lt;/h5&gt;"
replace="&lt;h5 style=&quot;margin-bottom: 5px&quot;&gt;Search&lt;/h5&gt;&lt;form action=&quot;http://davmail.sourceforge.net/search.html&quot; id=&quot;cse-search-box&quot;&gt;&lt;div&gt;&lt;input type=&quot;hidden&quot; name=&quot;cx&quot; value=&quot;partner-pub-2649801308753286:4hjiaq-dcw4&quot; /&gt;&lt;input type=&quot;hidden&quot; name=&quot;cof&quot; value=&quot;FORID:10&quot; /&gt;&lt;input type=&quot;hidden&quot; name=&quot;ie&quot; value=&quot;UTF-8&quot; /&gt;&lt;input type=&quot;text&quot; name=&quot;q&quot; size=&quot;15&quot;/&gt;&lt;input type=&quot;image&quot; src=&quot;images/search.png&quot; style=&quot;margin-left: 5px;vertical-align: middle&quot; /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script type=&quot;text/javascript&quot; src=&quot;http://www.google.com/cse/brand?form=cse-search-box&amp;lang=fr&quot;&gt;&lt;/script&gt;&lt;h5&gt;Quick Links&lt;/h5&gt;">
<fileset dir="target/site"/>
</replaceregexp>
<replaceregexp match="&lt;h2&gt;Search&lt;a name=&quot;Search&quot;&gt;&lt;/a&gt;&lt;/h2&gt;"
replace="&lt;div id=&quot;cse-search-results&quot;/&gt;${line.separator}&lt;script type=&quot;text/javascript&quot;&gt;${line.separator}var googleSearchIframeName = &quot;cse-search-results&quot;;${line.separator}var googleSearchFormName = &quot;cse-search-box&quot;;${line.separator}var googleSearchFrameWidth = 800;${line.separator}var googleSearchDomain = &quot;www.google.com&quot;;${line.separator}var googleSearchPath = &quot;/cse&quot;;${line.separator}&lt;/script&gt;${line.separator}&lt;script type=&quot;text/javascript&quot; src=&quot;http://www.google.com/afsonline/show_afs_search.js&quot;&gt;&lt;/script&gt;">
<fileset dir="target/site"/>
</replaceregexp>
<replaceregexp match="&lt;/div&gt;\r\n &lt;div id=&quot;bodyColumn&quot;&gt;"
replace="&lt;hr/&gt;&lt;div style=&quot;padding-left: 5px;padding-bottom: 5px&quot;&gt;${line.separator}&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--${line.separator}google_ad_client = &quot;pub-2649801308753286&quot;;${line.separator}/* 160x90, link block */${line.separator}google_ad_slot = &quot;3062827454&quot;;${line.separator}google_ad_width = 160;${line.separator}google_ad_height = 90;${line.separator}//--&gt;${line.separator}&lt;/script&gt;${line.separator}&lt;script type=&quot;text/javascript&quot; src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;${line.separator}&lt;/script&gt;&lt;/div&gt;&lt;/div&gt;${line.separator} &lt;div id=&quot;bodyColumn&quot;&gt;">
<fileset dir="target/site"/>
</replaceregexp>
</target>
<target name='upload-site' depends="fix-site">
<scp todir="${username},davmail@web.sourceforge.net:htdocs"
keyfile="${keyfile}" passphrase="${passphrase}" verbose="true">
<fileset dir="target/site"/>
</scp>
</target>
<target name="upload-release" depends="release">
<mkdir dir="dist/${version}"/>
<move todir="dist/${version}">
<fileset dir="dist">
<include name="*${version}-*"/>
</fileset>
</move>
<scp todir="${username},davmail@frs.sourceforge.net:/home/frs/project/d/da/davmail/davmail"
keyfile="${keyfile}" passphrase="${passphrase}" verbose="true" trust="true">
<fileset dir="dist">
<include name="${version}/*"/>
</fileset>
</scp>
</target>
<target name="release" depends="init">
<property name="release-name" value="${release}"/>
<antcall target="dist"/>
</target>
</project>