z80-tools/build.xml

204 wiersze
8.6 KiB
XML

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project default="build">
<tstamp>
<format property="timestamp" pattern="yyyyMMdd-HHmm"/>
</tstamp>
<property name="app" value="swtapp"/>
<property name="version" value="1.3.0"/>
<property name="folder" value="z80-tools"/>
<property name="mac-folder" value="Z80 Tools"/>
<property name="package" value="com.maccasoft.tools_${version}.v${timestamp}"/>
<property name="work" value="build/work"/>
<property name="launch4j.dir" location="/opt/launch4j" />
<taskdef name="launch4j"
classname="net.sf.launch4j.ant.Launch4jTask"
classpath="${launch4j.dir}/launch4j.jar:${launch4j.dir}/lib/xstream.jar" />
<property name="bundleapp.dir" location="build/macosx" />
<taskdef name="bundleapp"
classname="com.oracle.appbundler.AppBundlerTask"
classpath="${bundleapp.dir}/appbundler-1.0.jar" />
<target name="build">
<antcall target="build-linux64" />
<antcall target="build-windows64" />
<antcall target="build-macosx" />
</target>
<!-- Linux x86/64 -->
<target name="build-linux64">
<delete dir="${work}" includeemptydirs="true"/>
<mkdir dir="${work}/${folder}" />
<mkdir dir="${work}/bin" />
<javac target="1.8" source="1.8" destdir="${work}/bin" srcdir="src" debug="true" includeantruntime="false">
<classpath refid="lib.path.ref"/>
<classpath>
<pathelement location="lib/org.eclipse.swt.gtk.linux.x86_64_3.114.100.v20200604-0951.jar"/>
</classpath>
</javac>
<antcall target="copy-common-files" />
<copy todir="${work}/${folder}/lib">
<fileset file="lib/org.eclipse.swt.gtk.linux.x86_64_3.114.100.v20200604-0951.jar"/>
<fileset file="build/linux/desktop.template" />
</copy>
<copy todir="${work}/${folder}/lib/icons">
<fileset dir="build/linux/icons" />
</copy>
<copy todir="${work}/${folder}">
<fileset file="build/linux/launcher" />
<fileset file="build/linux/launcher.png" />
<fileset file="build/linux/install.sh" />
<fileset file="build/linux/uninstall.sh" />
</copy>
<chmod file="${work}/${folder}/launcher" perm="755"/>
<chmod file="${work}/${folder}/install.sh" perm="755"/>
<chmod file="${work}/${folder}/uninstall.sh" perm="755"/>
<exec executable="tar" dir="${work}" failonerror="true">
<arg value="czf"/>
<arg value="../${folder}-linux64-${version}.tar.gz"/>
<arg value="${folder}"/>
</exec>
</target>
<!-- Windows x86/64 -->
<target name="build-windows64">
<delete dir="${work}" includeemptydirs="true"/>
<mkdir dir="${work}/${folder}" />
<mkdir dir="${work}/bin" />
<javac target="1.8" source="1.8" destdir="${work}/bin" srcdir="src" debug="true" includeantruntime="false">
<classpath refid="lib.path.ref"/>
<classpath>
<pathelement location="lib/org.eclipse.swt.win32.win32.x86_64_3.114.100.v20200604-0951.jar"/>
</classpath>
</javac>
<antcall target="copy-common-files" />
<copy todir="${work}/${folder}/lib">
<fileset file="lib/org.eclipse.swt.win32.win32.x86_64_3.114.100.v20200604-0951.jar"/>
</copy>
<copy todir="${work}/${folder}">
<fileset file="build/windows/launcher.l4j.ini" />
</copy>
<launch4j configFile="build/windows/config64.xml"
outfile="${work}/${folder}/launcher.exe"
fileVersion="${version}.0"
txtFileVersion="${version}.0"
productVersion="${version}.0"
txtProductVersion="${version}.0" />
<exec executable="zip" dir="${work}" failonerror="true">
<arg value="-q"/>
<arg value="-r"/>
<arg value="../${folder}-windows64-${version}.zip"/>
<arg value="${folder}"/>
</exec>
</target>
<!-- MacOS/X -->
<target name="build-macosx">
<delete dir="${work}" includeemptydirs="true"/>
<mkdir dir="${work}/${folder}" />
<mkdir dir="${work}/bin" />
<javac target="1.8" source="1.8" destdir="${work}/bin" srcdir="src" debug="true" includeantruntime="false">
<classpath refid="lib.path.ref"/>
<classpath>
<pathelement location="lib/org.eclipse.swt.cocoa.macosx.x86_64_3.114.100.v20200604-0951.jar"/>
</classpath>
</javac>
<antcall target="copy-common-files" />
<copy todir="${work}/${folder}/lib" file="lib/org.eclipse.swt.cocoa.macosx.x86_64_3.114.100.v20200604-0951.jar"/>
<bundleapp
outputdirectory="${work}"
name="${mac-folder}"
displayname="${mac-folder}"
identifier="com.maccasoft.tools"
icon="build/macosx/app.icns"
shortversion="${version}"
signature="????"
copyright="Marco Maccaferri"
applicationCategory="public.app-category.development"
mainclassname="com.maccasoft.tools.Application">
<classpath file="${work}/${folder}/lib/*.jar"/>
<option value="-Dcom.apple.macos.useScreenMenuBar=true"/>
<option value="-Xms128M"/>
<option value="-Xmx512M"/>
<option value="-XstartOnFirstThread"/>
</bundleapp>
<copy todir="${work}/${mac-folder}.app/Contents/Java" includeemptydirs="false">
<fileset dir="${work}/${folder}" excludes="**/*.jar" />
</copy>
<exec executable="tar" dir="${work}" failonerror="true">
<arg value="czf"/>
<arg value="../${folder}-macosx-${version}.tar.gz"/>
<arg value="${mac-folder}.app"/>
</exec>
</target>
<path id="lib.path.ref">
<pathelement location="lib/org.eclipse.core.commands_3.9.700.v20191217-1850.jar" />
<pathelement location="lib/org.eclipse.core.databinding_1.9.0.v20200519-1409.jar" />
<pathelement location="lib/org.eclipse.core.databinding.beans_1.6.100.v20191217-1850.jar" />
<pathelement location="lib/org.eclipse.core.databinding.observable_1.9.0.v20200205-2119.jar" />
<pathelement location="lib/org.eclipse.core.databinding.property_1.8.0.v20200124-0715.jar" />
<pathelement location="lib/org.eclipse.equinox.common_3.12.0.v20200504-1602.jar" />
<pathelement location="lib/org.eclipse.jface_3.20.0.v20200505-1952.jar" />
<pathelement location="lib/org.eclipse.jface.databinding_1.11.100.v20200522-1835.jar" />
<pathelement location="lib/jackson-annotations-2.7.0.jar"/>
<pathelement location="lib/jackson-core-2.7.0.jar"/>
<pathelement location="lib/jackson-databind-2.7.0.jar"/>
<pathelement location="lib/jssc-2.9.2.jar"/>
</path>
<target name="copy-common-files">
<jar destfile="${work}/${folder}/lib/${package}.jar">
<fileset dir="${work}/bin"/>
<fileset dir="src">
<exclude name="**/*.java"/>
</fileset>
</jar>
<copy todir="${work}/${folder}/lib">
<fileset dir="lib" includes="org.eclipse.core.commands_3.9.700.v20191217-1850.jar" />
<fileset dir="lib" includes="org.eclipse.core.databinding_1.9.0.v20200519-1409.jar" />
<fileset dir="lib" includes="org.eclipse.core.databinding.beans_1.6.100.v20191217-1850.jar" />
<fileset dir="lib" includes="org.eclipse.core.databinding.observable_1.9.0.v20200205-2119.jar" />
<fileset dir="lib" includes="org.eclipse.core.databinding.property_1.8.0.v20200124-0715.jar" />
<fileset dir="lib" includes="org.eclipse.equinox.common_3.12.0.v20200504-1602.jar" />
<fileset dir="lib" includes="org.eclipse.jface_3.20.0.v20200505-1952.jar" />
<fileset dir="lib" includes="org.eclipse.jface.databinding_1.11.100.v20200522-1835.jar" />
<fileset dir="lib" includes="jackson-annotations-2.7.0.jar"/>
<fileset dir="lib" includes="jackson-core-2.7.0.jar"/>
<fileset dir="lib" includes="jackson-databind-2.7.0.jar"/>
<fileset dir="lib" includes="jssc-2.9.2.jar"/>
</copy>
<copy todir="${work}/${folder}/examples">
<fileset dir="examples">
<include name="**/*.ASM"/>
</fileset>
</copy>
<copy todir="${work}/${folder}">
<fileset file="LICENSE"/>
<fileset file="LICENSE.glass"/>
<fileset file="LICENSE.z80core"/>
<fileset file="NOTICE.glass"/>
</copy>
</target>
</project>