lanemu-mirror/build.xml

139 lines
4.6 KiB
XML
Raw Permalink Normal View History

2023-10-12 11:32:38 +02:00
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2008 Wolfgang Ginolas
2023-10-19 13:21:27 +02:00
This file is part of Lanemu.
2023-10-12 11:32:38 +02:00
2023-10-19 13:21:27 +02:00
Lanemu is free software: you can redistribute it and/or modify
2023-10-12 11:32:38 +02:00
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
2023-10-19 13:21:27 +02:00
Lanemu is distributed in the hope that it will be useful,
2023-10-12 11:32:38 +02:00
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
2023-10-19 13:21:27 +02:00
along with Lanemu. If not, see <http://www.gnu.org/licenses/>.
2023-10-12 11:32:38 +02:00
-->
2024-04-02 16:53:06 +02:00
<project name="Lanemu" default="jar" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
2023-10-12 11:32:38 +02:00
<property name="src" value="src"/>
<property name="build" value="build"/>
<property name="build.classes" value="build/classes"/>
<property name="clib" value="clib"/>
2024-05-24 02:03:50 +02:00
<property name="lib" value="lib"/>
2023-10-12 11:32:38 +02:00
<property name="resources" value="resources"/>
2024-06-13 18:25:23 +02:00
<property name="classpath" value="${lib}/commons-jxpath-1.1.jar;${lib}/commons-logging-1.2.jar;${lib}/bcprov-jdk15on-1.70.jar;${lib}/junit-4.5.jar;${lib}/commons-codec-1.3.jar;${lib}/swing-layout-1.0.3.jar;${lib}/WaifUPnP.jar;${lib}/flatlaf-3.1.1.jar;${lib}/LGoodDatePicker-11.2.1.jar"/>
2024-04-02 19:27:53 +02:00
<property name="ivy.install.version" value="2.5.2"/>
<condition property="ivy.home" value="${env.IVY_HOME}">
<isset property="env.IVY_HOME"/>
</condition>
<property name="ivy.home" value="${user.home}/.ant"/>
2024-05-24 02:03:50 +02:00
<property name="ivy.jar.dir" value="${ivy.home}/${lib}"/>
2024-04-02 19:27:53 +02:00
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar"/>
2023-10-12 11:32:38 +02:00
<target name="init">
<mkdir dir="${build}"/>
<mkdir dir="${build.classes}"/>
</target>
2024-05-24 02:03:50 +02:00
<target name="clean" depends="clean-3rdparty">
2023-10-12 11:32:38 +02:00
<delete dir="${build}"/>
2024-05-24 02:03:50 +02:00
<delete dir="${clib}"/>
<delete dir="${lib}"/>
2023-10-12 11:32:38 +02:00
</target>
2024-04-02 18:36:04 +02:00
<target name="compile" depends="init,resolve,compile-3rdparty">
2023-10-12 11:32:38 +02:00
<exec executable="git" outputproperty="git.revision">
<arg value="rev-parse"/>
<arg value="--short"/>
<arg value="HEAD"/>
</exec>
<echo file=".gitrevision" message="${git.revision}" />
<javac
srcdir="${src}"
destdir="${build.classes}"
classpath="${classpath}"
2024-03-03 14:39:49 +01:00
source="1.7"
2023-10-12 11:32:38 +02:00
target="1.7"
debug="true"/>
</target>
2024-04-02 18:36:04 +02:00
<target name="compile-3rdparty">
<ant dir="3rdparty/WaifUPnP"/>
2024-05-24 02:03:50 +02:00
<copy file="3rdparty/WaifUPnP/dist/WaifUPnP.jar" tofile="${lib}/WaifUPnP.jar"/>
</target>
<target name="clean-3rdparty">
<ant dir="3rdparty/WaifUPnP" target="clean"/>
</target>
2024-04-02 18:36:04 +02:00
2024-04-02 19:27:53 +02:00
<target name="resolve" depends="init-ivy">
2024-04-02 16:53:06 +02:00
<ivy:retrieve/>
2024-04-02 19:27:53 +02:00
</target>
<target name="init-ivy" depends="download-ivy">
<path id="ivy.lib.path">
<fileset dir="${ivy.jar.dir}" includes="*.jar"/>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
</target>
<target name="download-ivy" unless="offline">
<mkdir dir="${ivy.jar.dir}"/>
<get src="https://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" dest="${ivy.jar.file}" usetimestamp="true"/>
</target>
2024-04-02 16:53:06 +02:00
2023-10-12 11:32:38 +02:00
<target name="jar" depends="compile">
2024-05-24 02:03:50 +02:00
<mkdir dir="${build}/${lib}"/>
<copy todir="${build}/${lib}">
<fileset dir="${lib}/">
2024-04-02 17:09:55 +02:00
<exclude name="junit-4.5.jar"/>
2023-10-12 11:32:38 +02:00
</fileset>
</copy>
2024-05-24 02:03:50 +02:00
<mkdir dir="${build}/${clib}"/>
<copy todir="${build}/${clib}">
<fileset dir="${clib}/">
2023-10-12 11:32:38 +02:00
</fileset>
</copy>
2023-10-19 13:21:27 +02:00
<jar destfile="${build}/Lanemu.jar">
2023-10-12 11:32:38 +02:00
<fileset dir="${build.classes}">
<exclude name="test/**"/>
</fileset>
<fileset file=".gitrevision"/>
<fileset file="default.dat"/>
<zipfileset dir="${resources}" prefix="resources"/>
<manifest>
<attribute name="Main-Class" value="org.p2pvpn.Main"/>
2024-06-13 18:25:23 +02:00
<attribute name="Class-Path" value="${lib}/commons-jxpath-1.1.jar ${lib}/commons-logging-1.2.jar ${lib}/bcprov-jdk15on-1.70.jar ${lib}/commons-codec-1.3.jar ${lib}/swing-layout-1.0.3.jar ${lib}/WaifUPnP.jar ${lib}/flatlaf-3.1.1.jar ${lib}/LGoodDatePicker-11.2.1.jar"/>
2023-10-12 11:32:38 +02:00
</manifest>
</jar>
</target>
<target name="test" depends="compile">
<junit fork="yes" haltonfailure="yes">
<classpath>
<pathelement path="${classpath}"/>
<pathelement location="${build.classes}"/>
</classpath>
<batchtest fork="yes">
<fileset dir="${src}">
<include name="test/**"/>
</fileset>
</batchtest>
<formatter type="plain" usefile="false" />
</junit>
</target>
<target name="run" depends="jar">
2023-10-19 13:21:27 +02:00
<java fork="true" jar="${build}/Lanemu.jar"/>
2023-10-12 11:32:38 +02:00
</target>
</project>