
When using ant's tar option, the permissions on JavaStubApplication were getting reset, causing the extracted archive to not be executable. By using the system's tar the permissions are not reset.
185 lines
6.4 KiB
XML
185 lines
6.4 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<project basedir="." default="all" name="itoopie">
|
|
|
|
<property name="src" value="src"/>
|
|
<property name="lib" value="lib"/>
|
|
<property name="build" value="build"/>
|
|
<property name="dist" location="dist"/>
|
|
<property name="jar" value="itoopie.jar"/>
|
|
<property name="resources" value="resources"/>
|
|
<property name="temp" value="pkg-temp" />
|
|
<property name="javadoc" value="javadoc"/>
|
|
|
|
<property name="javac.compilerargs" value=""/>
|
|
|
|
|
|
<target name="init">
|
|
<mkdir dir="${build}"/>
|
|
<mkdir dir="${build}/${lib}"/>
|
|
<mkdir dir="${build}/${resources}"/>
|
|
<mkdir dir="${build}/${javadoc}"/>
|
|
<mkdir dir="${dist}"/>
|
|
<copy todir="${dist}/${lib}">
|
|
<fileset dir="${lib}" />
|
|
</copy>
|
|
</target>
|
|
|
|
<target name="clean" description="Clean up files created during build">
|
|
<delete dir="${build}"/>
|
|
<delete dir="${dist}"/>
|
|
<delete dir="{temp}" />
|
|
<delete file="installer.jar" failonerror="false" />
|
|
<delete file="itoopie-install.exe" failonerror="false" />
|
|
<delete file="itoopie.app.tar.bz2" failonerror="false" />
|
|
<delete file="itoopie-install.exe.sha512" failonerror="false" />
|
|
</target>
|
|
|
|
<target name="compile" depends="clean,init">
|
|
<javac
|
|
debug="true"
|
|
deprecation="on"
|
|
source="1.5"
|
|
target="1.5"
|
|
srcdir="${src}"
|
|
destdir="${build}">
|
|
<classpath>
|
|
<pathelement location="${lib}/commons-logging-1.1.1.jar" />
|
|
<pathelement location="${lib}/json-smart-1.0.6.4.jar" />
|
|
<pathelement location="${lib}/jchart2d-3.2.1.jar" />
|
|
<pathelement location="${lib}/xmlgraphics-commons-1.3.1.jar" />
|
|
</classpath>
|
|
</javac>
|
|
<copy todir="${build}/${resources}">
|
|
<fileset dir="${resources}" />
|
|
</copy>
|
|
</target>
|
|
|
|
<target name="jar" depends="compile">
|
|
<exec executable="sh" osfamily="unix" failifexecutionfails="true" >
|
|
<arg value="./bundle-messages.sh" />
|
|
</exec>
|
|
<exec executable="sh" osfamily="mac" failifexecutionfails="true" >
|
|
<arg value="./bundle-messages.sh" />
|
|
</exec>
|
|
|
|
<jar basedir="${build}" destfile="${dist}/${jar}">
|
|
<manifest>
|
|
<attribute name="Main-Class" value="net.i2p.itoopie.Main"/>
|
|
<attribute name="Class-Path" value="${lib}/commons-logging-1.1.1.jar ${lib}/json-smart-1.0.6.4.jar ${lib}/jchart2d-3.2.1.jar ${lib}/xmlgraphics-commons-1.3.1.jar" />
|
|
</manifest>
|
|
</jar>
|
|
</target>
|
|
|
|
<target name="javadoc" description="build javadocs">
|
|
<mkdir dir="${build}" />
|
|
<mkdir dir="${build}/${javadoc}" />
|
|
<javadoc
|
|
sourcepath="${src}" destdir="${build}/${javadoc}"
|
|
packagenames="*"
|
|
use="true"
|
|
splitindex="true"
|
|
windowtitle="itoopie">
|
|
<classpath>
|
|
<path refid="classpath"/>
|
|
<pathelement location="${lib}/commons-logging-1.1.1.jar" />
|
|
<pathelement location="${lib}/json-smart-1.0.6.4.jar" />
|
|
</classpath>
|
|
</javadoc>
|
|
</target>
|
|
|
|
<target name="poupdate" depends="init" description="update po files">
|
|
|
|
<exec executable="sh" osfamily="unix" failifexecutionfails="true" >
|
|
<arg value="./bundle-messages.sh" />
|
|
<arg value="-p" />
|
|
</exec>
|
|
<exec executable="sh" osfamily="mac" failifexecutionfails="true" >
|
|
<arg value="./bundle-messages.sh" />
|
|
<arg value="-p" />
|
|
</exec>
|
|
</target>
|
|
|
|
<target name="installer" depends="jar" description="build multi-arch installer">
|
|
<ant target="doAppEXE" />
|
|
|
|
<taskdef name="izpack" classpath="${basedir}/installer/lib/izpack/standalone-compiler.jar" classname="com.izforge.izpack.ant.IzPackTask" />
|
|
<izpack input="${basedir}/installer/installer.xml"
|
|
output="${basedir}/installer.jar"
|
|
installerType="standard"
|
|
basedir="${basedir}"
|
|
compression="deflate"
|
|
compressionlevel="9" />
|
|
|
|
<ant target="installerexe" />
|
|
</target>
|
|
<target name="installerexe" unless="noExe">
|
|
<!--<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>-->
|
|
<ant target="doInstallerEXE" />
|
|
</target>
|
|
|
|
<target name="doInstallerEXE" unless="noExe">
|
|
|
|
<!-- now the installer exe -->
|
|
<taskdef name="launch4j"
|
|
classname="net.sf.launch4j.ant.Launch4jTask"
|
|
classpath="${basedir}/installer/lib/launch4j/launch4j.jar:${basedir}/installer/lib/launch4j/lib/xstream.jar" />
|
|
<launch4j configFile="installer/itoopieinstaller.xml" />
|
|
<checksum file="itoopie-install.exe" algorithm="SHA-512" fileext=".sha512"/>
|
|
|
|
</target>
|
|
<!-- thazzit -->
|
|
|
|
|
|
<target name="doAppEXE" unless="noExe">
|
|
<taskdef name="launch4j"
|
|
classname="net.sf.launch4j.ant.Launch4jTask"
|
|
classpath="${basedir}/installer/lib/launch4j/launch4j.jar:${basedir}/installer/lib/launch4j/lib/xstream.jar" />
|
|
<launch4j configFile="installer/itoopiestandalone.xml" />
|
|
</target>
|
|
|
|
<target name="dist" depends="jar" description="create jars but don't create an installer"/>
|
|
<target name="all" depends="jar" />
|
|
|
|
<target name="osx" depends="makeOSXBundle" />
|
|
<target name="makeOSXBundle" depends="jar" description="build a OSX bundle">
|
|
<mkdir dir="${temp}/itoopie.app" />
|
|
<copy todir="${temp}/itoopie.app">
|
|
<fileset dir="installer/resources/itoopie.app" />
|
|
</copy>
|
|
<exec executable="chmod" osfamily="unix" failonerror="true">
|
|
<arg value="755" />
|
|
<arg value="${temp}/itoopie.app/Contents/MacOS/JavaApplicationStub" />
|
|
</exec>
|
|
<mkdir dir="${temp}/itoopie.app/Contents/Resources/Java" />
|
|
<copy todir="${temp}/itoopie.app/Contents/Resources/Java">
|
|
<fileset dir="${dist}" />
|
|
</copy>
|
|
<ant target="dotarbundle" />
|
|
</target>
|
|
<target name="dotarbundle" unless="notarbundle">
|
|
<exec executable="tar" osfamily="unix" failonerror="true">
|
|
<arg value="--owner=root" />
|
|
<arg value="--group=root" />
|
|
<arg value="-cjvf" />
|
|
<arg value="itoopie.app.tar.bz2" />
|
|
<arg value="-C" />
|
|
<arg value="${temp}" />
|
|
<arg value="itoopie.app" />
|
|
</exec>
|
|
</target>
|
|
|
|
</project>
|