Newer
Older
classname="com.izforge.izpack.ant.IzPackTask" />
<target name="izpack-patches" >
<jar destfile="${basedir}/installer/lib/izpack/patches.jar"
basedir="${basedir}/installer/lib/izpack/patches" />
</target>
<target name="installer" depends="preppkg, buildProperties, util-list-changes, izpack-patches" >
<mkdir dir="pkg-temp/installer" />
<!-- set if unset -->
<property name="workspace.changes.util.tr" value="" />
<jar destfile="./pkg-temp/installer/copy.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Copy.class net/i2p/util/FileUtil.class">
<manifest>
<attribute name="Main-Class" value="net.i2p.util.Copy" />
<attribute name="Build-Date" value="${build.timestamp}" />
<attribute name="Base-Revision" value="${workspace.version}" />
<attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
</manifest>
<jar destfile="./pkg-temp/installer/delete.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Delete.class net/i2p/util/FileUtil.class">
<manifest>
<attribute name="Main-Class" value="net.i2p.util.Delete" />
<attribute name="Build-Date" value="${build.timestamp}" />
<attribute name="Base-Revision" value="${workspace.version}" />
<attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
</manifest>
<jar destfile="./pkg-temp/installer/exec.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Exec.class">
<manifest>
<attribute name="Main-Class" value="net.i2p.util.Exec" />
<attribute name="Build-Date" value="${build.timestamp}" />
<attribute name="Base-Revision" value="${workspace.version}" />
<attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
</manifest>
<!--
Force 1.5 pack200 output
Doesnt work!
http://jira.codehaus.org/browse/IZPACK-404
http://forums.sun.com/thread.jspa?threadID=773439
http://bfo.co.uk/blog/2010/05/13/combining_ant_jar_signatures_and_pack200.html
<property name="com.sun.java.util.jar.pack.package.majver" value="150" />
<property name="com.sun.java.util.jar.pack.package.minver" value="7" />
-->
<izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
<condition property="noExe">
<os arch="x86_64" />
</condition>
<condition property="noExe">
<os arch="amd64" />
</condition>
<condition property="noExe">
<not>
<or>
<os name="Linux" />
<os family="windows" />
</or>
</not>
</condition>
<target name="doInstallerEXE" unless="noExe">
<!-- now the installer exe -->
<launch4j configFile="./installer/i2pinstaller.xml" />
<launch4j configFile="./installer/i2pstandalone.xml" />
<!-- thazzit -->
<!-- Custom installers -->
<target name="installer-freebsd" depends="clean, preppkg-freebsd-only, getReleaseNumber, getBuildNumber, buildProperties, util-list-changes, izpack-patches" >
<mkdir dir="pkg-temp/installer" />
<!-- set if unset -->
<property name="workspace.changes.util.tr" value="" />
<izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${release.number}-${build.number}${build.extra}_freebsd-only.jar" installerType="standard" basedir="${basedir}" />
</target>
<target name="installer-linux" depends="clean, preppkg-linux-only, getReleaseNumber, getBuildNumber, buildProperties, util-list-changes, izpack-patches" >
<mkdir dir="pkg-temp/installer" />
<!-- set if unset -->
<property name="workspace.changes.util.tr" value="" />
<izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${release.number}-${build.number}${build.extra}_linux-only.jar" installerType="standard" basedir="${basedir}" />
</target>
<target name="installer-osx" depends="clean, checkForIzpack2App, preppkg-osx-only, getReleaseNumber, getBuildNumber, buildProperties, util-list-changes, izpack-patches">
<mkdir dir="pkg-temp/installer" />
<mkdir dir="pkg-temp/osx" />
<!-- set if unset -->
<property name="workspace.changes.util.tr" value="" />
<izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${release.number}-${build.number}${build.extra}_osx-only.jar" installerType="standard" basedir="${basedir}" />
<ant target="installer2app" />
<delete dir="pkg-temp/osx" />
</target>
<target name="checkForIzpack2App">
<available property="izpack2app.available" file="${user.home}/IzPack/utils/wrappers/izpack2app/izpack2app.py" />
</target>
<target name="installer2app" if="izpack2app.available">
<mkdir dir="pkg-temp/osx" />
<exec executable="python" failonerror="true">
<arg value="${user.home}/IzPack/utils/wrappers/izpack2app/izpack2app.py" />
<arg value="${basedir}/i2pinstall_${release.number}-${build.number}${build.extra}_osx-only.jar" />
<arg value="${basedir}/pkg-temp/osx/i2p-${release.number}-${build.number}${build.extra}_osx-install.app" />
<exec executable="chmod" failonerror="true" osfamily="unix">
<arg value="755" />
<arg value="${basedir}/pkg-temp/osx/i2p-${release.number}-${build.number}${build.extra}_osx-install.app/Contents/MacOS/JavaApplicationStub" />
</exec>
<exec executable="tar" osfamily="unix" failonerror="true">
<arg value="--owner=root" />
<arg value="--group=root" />
<arg value="-cjvf" />
<arg value="${basedir}/i2pinstall_${release.number}-${build.number}${build.extra}_osx.tar.bz2" />
<arg value="-C" />
<arg value="${basedir}/pkg-temp/osx" />
<arg value="i2p-${release.number}-${build.number}${build.extra}_osx-install.app" />
</target>
<!-- Yes, even though this makes an installer for Windows, we still need to depend on preppkg-unix (because the installer attempts to delete these files
and will fail if they don't exist. Thankfully these files are so very small there's not much harm in including them.
-->
<target name="installer-windows" depends="clean, doBuildEXE, preppkg-windows-only, preppkg-unix, getReleaseNumber, getBuildNumber, buildProperties, util-list-changes, izpack-patches" >
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
<mkdir dir="pkg-temp/installer" />
<!-- set if unset -->
<property name="workspace.changes.util.tr" value="" />
<jar destfile="./pkg-temp/installer/copy.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Copy.class net/i2p/util/FileUtil.class">
<manifest>
<attribute name="Main-Class" value="net.i2p.util.Copy" />
<attribute name="Build-Date" value="${build.timestamp}" />
<attribute name="Base-Revision" value="${workspace.version}" />
<attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
</manifest>
</jar>
<jar destfile="./pkg-temp/installer/delete.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Delete.class net/i2p/util/FileUtil.class">
<manifest>
<attribute name="Main-Class" value="net.i2p.util.Delete" />
<attribute name="Build-Date" value="${build.timestamp}" />
<attribute name="Base-Revision" value="${workspace.version}" />
<attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
</manifest>
</jar>
<jar destfile="./pkg-temp/installer/exec.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Exec.class">
<manifest>
<attribute name="Main-Class" value="net.i2p.util.Exec" />
<attribute name="Build-Date" value="${build.timestamp}" />
<attribute name="Base-Revision" value="${workspace.version}" />
<attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
</manifest>
</jar>
<izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${release.number}-${build.number}${build.extra}_windows-only.jar" installerType="standard" basedir="${basedir}" />
<delete dir="pkg-temp/win" />
</target>
<target name="installer-all" depends="installer-freebsd, installer-linux, installer-osx, installer-windows, installer" >
</target>
<!-- end custom installers -->
<target name="test" depends="buildProperties, jbigi" >
<mkdir dir="reports/core/junit/" />
<ant dir="core/java/" target="junit.report" />
</target>
<ant dir="core/java/" target="clover.report" />
</target>
<target name="test.report" depends="junit.report, clover.report"/>
<ant dir="core/java/" target="fullclovertest" />
<ant dir="router/java/" target="fullclovertest" />
<target name="testscripts" >
<exec executable="tests/scripts/checkcerts.sh" failonerror="true" />
<exec executable="tests/scripts/checkpo.sh" failonerror="true" />
<exec executable="tests/scripts/checkutf8.sh" failonerror="true" />
<exec executable="tests/scripts/checkxml.sh" failonerror="true" />
</target>
<!-- <target name="syndie" >
<ant dir="apps/syndie/java/" target="standalone" />
<copy file="apps/syndie/java/syndie-standalone.zip" todir="." />
<ant dir="apps/i2psnark/java" target="standalone" />
<copy file="apps/i2psnark/java/i2psnark-standalone.zip" todir="." />
</target>
<target name="slackpkg">
<echo message="Building Slackware package." />
<ant dir="Slackware/i2p/" target="slackpkg" />
<ant dir="Slackware/i2p-base/" target="slackpkg" />
</target>
<target name="justBOB" depends="builddepSmall">
<ant dir="apps/BOB/" target="onejar" />
<copy file="apps/BOB/dist/BOB-one.jar" todir="." />
</target>
<target name="findbugs" depends="build2">
<echo message="Starting findbugs, this will take a while..." />
<arg value="findbugs"/>
<arg value="-textui"/>
<arg value="-projectName"/>
<arg value="i2p"/>
<arg value="-sortByClass"/>
<arg value="-xml"/>
<arg value="-output"/>
<arg value="build/commons-el.jar:build/commons-logging.jar:build/jasper-compiler.jar:build/jasper-runtime.jar:build/javax.servlet.jar:build/org.mortbay.jetty.jar:apps/jrobin/jrobin-1.5.9.1.jar:apps/systray/java/lib/systray4j.jar:installer/lib/wrapper/all/wrapper.jar:apps/susidns/src/WEB-INF/lib/standard.jar:apps/susidns/src/WEB-INF/lib/jstl.jar:apps/jrobin/jrobin-1.5.9.1.jar"/>
<arg value="-sourcepath"/>
<arg value="apps/BOB/src/:apps/addressbook/java/src/:apps/i2psnark/java/src/:apps/i2ptunnel/java/src/:apps/ministreaming/java/src/:apps/routerconsole/java/src/:apps/sam/java/src/:apps/streaming/java/src/:apps/susidns/src/java/src/:apps/susimail/src/src/:apps/systray/java/src/:core/java/src/:router/java/src/"/>
<!-- start of the files to be analyzed -->
<arg value="build/BOB.jar"/>
<arg value="build/addressbook.war"/>
<arg value="build/i2p.jar"/>
<arg value="build/i2psnark.jar"/>
<arg value="build/i2psnark.war"/>
<arg value="build/i2ptunnel.jar"/>
<arg value="build/i2ptunnel.war"/>
<arg value="build/mstreaming.jar"/>
<arg value="build/router.jar/"/>
<arg value="build/desktopgui.jar"/>
<arg value="build/routerconsole.jar"/>
<arg value="build/routerconsole.war"/>
<arg value="build/sam.jar"/>
<arg value="build/streaming.jar"/>
<arg value="build/susidns.war"/>
<arg value="build/susimail.war"/>
<arg value="build/systray.jar"/>
</exec>
<echo message="Findbugs output stored in i2p.fba" />
<echo message="Now run: findbugs i2p.fba" />
<!-- this is the same dependency as pkg, but with updater200 in the middle,
since preppkg puts too much stuff in pkg-temp -->
<!--
<target name="release" depends="distclean, updaterWithJettyFixesAndJbigi , updater200WithJettyFixes, preppkg, installer, getReleaseNumber" >
<target name="release" depends="distclean, testscripts, updater, updater200, preppkg, installer, getReleaseNumber" >
<echo message="================================================================" />
<echo message="Did you update these files?" />
<arg value="-l" />
<arg value="history.txt" />
<arg value="installer/install.xml" />
<arg value="installer/resources/news.xml" />
<arg value="core/java/src/net/i2p/CoreVersion.java" />
<arg value="router/java/src/net/i2p/router/RouterVersion.java" />
</exec>
<copy file="i2pupdate.zip" tofile="i2pupdate_${release.number}.zip" />
<copy file="i2pinstall.exe" tofile="i2pinstall_${release.number}.exe" />
<delete file="i2pupdate.sud" failonerror="false" />
<delete file="i2pupdate.su2" failonerror="false" />
<input message="Enter private signing key file:" addproperty="release.privkey" />
<fail message="You must enter a path." >
<condition>
<equals arg1="${release.privkey}" arg2=""/>
</condition>
</fail>
<java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
<classpath>
<pathelement location="build/i2p.jar" />
</classpath>
<arg value="sign" />
<arg value="i2pupdate.zip" />
<arg value="i2pupdate.sud" />
<arg value="${release.privkey}" />
<arg value="${release.number}" />
</java>
<echo message="Verify version and VALID signature:" />
<java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
<classpath>
<pathelement location="build/i2p.jar" />
</classpath>
<arg value="verifysig" />
<arg value="i2pupdate.sud" />
</java>
<java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
<classpath>
<pathelement location="build/i2p.jar" />
</classpath>
<arg value="verifyversion" />
<arg value="i2pupdate.sud" />
</java>
<java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
<classpath>
<pathelement location="build/i2p.jar" />
</classpath>
<arg value="showversion" />
<arg value="i2pupdate.sud" />
</java>
<!-- now build and verify the packed sud from the packed zip -->
<java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
<classpath>
<pathelement location="build/i2p.jar" />
</classpath>
<arg value="sign" />
<arg value="i2pupdate200.zip" />
<arg value="i2pupdate.su2" />
<arg value="${release.privkey}" />
<arg value="${release.number}" />
</java>
<echo message="Verify version and VALID signature:" />
<java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
<classpath>
<pathelement location="build/i2p.jar" />
</classpath>
<arg value="verifysig" />
<arg value="i2pupdate.su2" />
</java>
<java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
<classpath>
<pathelement location="build/i2p.jar" />
</classpath>
<arg value="verifyversion" />
<arg value="i2pupdate.su2" />
</java>
<java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
<classpath>
<pathelement location="build/i2p.jar" />
</classpath>
<arg value="showversion" />
<arg value="i2pupdate.su2" />
</java>
<!-- will this use the monotonerc file in the current workspace? -->
<echo message="Checking out fresh copy into ../i2p-${release.number} for tarballing:" />
<arg value="co" />
<arg value="-b" />
<arg value="i2p.i2p" />
<!-- w: is the revision of the current workspace -->
<arg value="-r" />
<arg value="w:" />
<arg value="../i2p-${release.number}/" />
</exec>
<arg value="cjf" />
<arg value="i2psource_${release.number}.tar.bz2" />
<arg value="-C" />
<arg value=".." />
<arg value="--exclude" />
<arg value="i2p-${release.number}/" />
</exec>
<echo message="Sign the files:" />
<delete file="i2pinstall_${release.number}.exe.sig" />
<delete file="i2psource_${release.number}.tar.bz2.sig" />
<delete file="i2pupdate_${release.number}.zip.sig" />
<arg value="-b" />
<arg value="i2pinstall_${release.number}.exe" />
</exec>
<arg value="-b" />
<arg value="i2psource_${release.number}.tar.bz2" />
</exec>
<arg value="-b" />
<arg value="i2pupdate_${release.number}.zip" />
</exec>
<echo message="File sizes:" />
<arg value="-l" />
<arg value="i2pinstall_${release.number}.exe" />
<arg value="i2psource_${release.number}.tar.bz2" />
<arg value="i2pupdate_${release.number}.zip" />
<arg value="i2pupdate.sud" />
<arg value="i2pinstall_${release.number}.exe.sig" />
<arg value="i2psource_${release.number}.tar.bz2.sig" />
<arg value="i2pupdate_${release.number}.zip.sig" />
</exec>
<echo message="SHA256 sums:" />
<arg value="i2pinstall_${release.number}.exe" />
<arg value="i2psource_${release.number}.tar.bz2" />
<arg value="i2pupdate_${release.number}.zip" />
<echo message="Don't forget to mtn tag w: i2p-${release.number}" />
<echo message="... and mtn cert t:i2p-${release.number} branch i2p.i2p.release" />
<target name="debian" depends="debian-clean, debian-binary" />
<target name="debian-binary" >
<echo message="Did you update the version using dch -i?" />
<echo message=" " />
<echo message="If the changelog was not updated with dch -i, press" />
<echo message="press CTRL+C to abort building this Debian package." />
<echo message="" />
<echo message="Pausing build for ten seconds to give enough time to read this notice." />
<exec executable="sleep" failonerror="true">
<arg value="10" />
</exec>
<exec executable="fakeroot" failonerror="true">
<arg value="debian/rules" />
<arg value="patch" />
<arg value="binary" />
<arg value="clean" />
<delete dir=".pc" />
<target name="debian-clean" depends="buildProperties" >
<exec executable="fakeroot" failonerror="true">
<arg value="debian/rules" />
<arg value="clean" />
<delete dir="./.pc" />
<target name="debian-patch" depends="buildProperties" >
<exec executable="quilt" failonerror="true">
<arg value="-a" />
<arg value="push" />
</exec>
<echo message="====================" />
</target>
<target name="debian-unpatch" depends="buildProperties">
<exec executable="quilt" failonerror="false">
<arg value="-a" />
<arg value="pop" />
<exec dir="debian" executable="./makerepo.sh" failonerror="true"/>
<!-- the following are appened to help build barebone portable version,
none of the above is modified for this purpose -->
<target name = "pkg-portable-clean">
<delete dir="build/" />
<delete>
<fileset dir="." includes="portable-**.zip**" />
</delete>
</target>
<!-- build a portable archive -->
<!-- *0* Since we simply pack all files in folder "build/" into our archieve,
we need to make sure its small, with NO redundent jars or wars.
thus cleaning is required before each build-->
<target name="buildSmallOnly" depends="pkg-portable-clean,buildSmall"/>
<!-- *1* preparing the jars by OS dependent de-bloating -->
<target name="preppkg-portable-win32-jbigi" depends="buildSmallOnly, jbigi-windows-only" />
<target name="preppkg-portable-linux-jbigi" depends="buildSmallOnly, jbigi-linux-only" />
<target name="preppkg-portable-basic" >
<!-- non OS dependent configurations only, dont add *nux/win stuff here -->
<fileset dir="installer/resources/portable/configs/" />
</copy>
<copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
<copy file="installer/resources/hosts.txt" todir="pkg-temp/" />
<copy file="installer/resources/readme.license.txt" todir="pkg-temp/" />
<mkdir dir="pkg-temp/addressbook" />
<copy file="apps/addressbook/subscriptions.txt" todir="pkg-temp/addressbook/" />
<copy file="apps/addressbook/myhosts.txt" todir="pkg-temp/addressbook/" />
<!-- config.txt is in installer/resources/portable -->
<copy file="installer/resources/initialNews/initialNews.xml" tofile="pkg-temp/docs/news.xml" overwrite="true" />
<copy file="installer/resources/readme/readme.html" tofile="pkg-temp/docs/readme.html" />
<copy file="installer/resources/startconsole.html" todir="pkg-temp/docs/" />
<copy file="installer/resources/start.ico" todir="pkg-temp/docs/" />
<copy file="installer/resources/console.ico" todir="pkg-temp/docs/" />
<!-- HTTP Header files, english only,
if you need a different lang do it in a seperate target -->
<fileset dir="installer/resources/proxy/" includes="**-header.ht" />
</copy>
<!-- Theme light only -->
<copy todir="pkg-temp/docs/themes/console/light/" overwrite="true" >
<fileset dir="installer/resources/themes/console/light/" includes="**.css" />
</copy>
<copy file="installer/resources/themes/console/light/console_big.css" todir="portable/docs/themes/console/light/" />
<copy todir="pkg-temp/docs/themes/console/images/" >
<fileset dir="installer/resources/themes/console/images/" />
</copy>
<!-- FLAGs for language icon (not for ip)-->
<copy todir="pkg-temp/docs/icons/flags" >
<fileset dir="installer/resources/icons/flags/" includes="cn.png,de.png,fr.png,nl.png,ru.png,se.png,us.png" />
</copy>
<mkdir dir="pkg-temp/webapps" />
<copy todir="pkg-temp/webapps/">
<fileset dir="build/" includes="**.war" />
</copy>
<mkdir dir="pkg-temp/lib" />
<copy todir ="pkg-temp/lib/" >
<fileset dir="build/" includes="**.jar" />
</copy>
<!-- 3rd party jars from apps/ -->
<!-- jrobin - without jobin , you lost graph and get a lot error entry in logs -->
</target>
<!-- *3* os dependent procedure/commands -->
<target name = "preppkg-portable-win32" depends="preppkg-portable-win32-jbigi,preppkg-portable-basic">
<!-- systray4.j - why do we need trayicons for portable version ? dependency hardcoded in console -->
<copy file="apps/systray/java/lib/systray4j.dll" todir="pkg-temp/lib" />
<copy file="apps/systray/java/lib/systray4j.jar" todir="pkg-temp/lib" />
<!--wrapper - dont even think about it. i2p cosumes appreantly more mem without it on win32-->
<copy file="installer/lib/wrapper/win32/wrapper.dll" todir="pkg-temp/lib" />
<copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
<copy file="installer/lib/wrapper/win32/I2Psvc.exe" tofile="pkg-temp/i2psvc.ex_" />
<!-- copy the unpack/start batchfiles -->
<copy todir="pkg-temp">
<fileset dir="installer/resources/portable/win32/" />
</copy>
</target>
<!-- *4* command for windows package -->
<target name = "pkg-portable-win32" depends="preppkg-portable-win32, pack200" >
<!-- i need the portable\ folder in .zip so basedir is set to . -->
<move file="pkg-temp" tofile="portable"/>
<zip destfile="portable-win32.zip" basedir="." level="9" includes="portable\**" />
<checksum file="portable-win32.zip" forceOverwrite="yes"/>
<move file="portable" tofile="pkg-temp"/>
</target>