Files
i2p.i2p-bote.android/botejars/build.xml

138 lines
5.4 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<project name="botejars-imported">
<property file="local.properties" />
<property name="jar.libs.dir" value="libs" />
<!-- override with i2pbase=path/to/install in local.properties -->
<property environment="env"/>
<condition property="i2pbase" value="${env.I2P}">
<isset property="env.I2P"/>
</condition>
<condition property="i2plib" value="${i2pbase}/lib">
<isset property="i2pbase"/>
</condition>
<!-- or set i2psrc=path/to/source in local.properties -->
<condition property="i2plib" value="${i2psrc}/build">
<isset property="i2psrc"/>
</condition>
<condition property="i2pbase" value="${i2psrc}">
<isset property="i2psrc"/>
</condition>
<available file="${i2pbase}" property="i2p.present" />
<fail message="The I2P environment variable is not set.${line.separator}It must point to an I2P installation. It is usually a path of the form ${line.separator}/xxx/yyy/i2p." >
<condition>
<not>
<isset property="i2p.present" />
</not>
</condition>
</fail>
<!-- override with botesrc=path/to/source in local.properties -->
<property name="botesrc" value="../i2p.i2p-bote" />
<property name="botebase" location="${botesrc}" />
<property name="botelib" location="${botebase}/WebContent/WEB-INF/lib" />
<available file="${botebase}" property="bote.present" />
<fail message="I2P-Bote source directory ${botebase} was not found. Install it there or set botesrc=/path/to/source in local.properties" >
<condition>
<not>
<isset property="bote.present" />
</not>
</condition>
</fail>
<echo message="Using I2P-Bote source at ${botebase}" />
<target name="preparebotelibs" depends="copyrouterlibs,copybotelibs" />
<condition property="dontclean" value="true">
<not>
<isset property="i2psrc"/>
</not>
</condition>
<target name="cleanI2P" unless="dontclean">
<ant dir="${i2pbase}" inheritall="false" useNativeBasedir="true" target="clean" />
</target>
<target name="clean" depends="cleanI2P">
<ant dir="${botebase}" inheritall="false" useNativeBasedir="true" >
<target name="clean" />
</ant>
</target>
<!-- test for one of them, assume it means we have all of them -->
<available property="have.streaming" file="${i2plib}/streaming.jar" />
<target name="buildJarsForBote" unless="have.streaming">
<ant dir="${i2pbase}" inheritall="false" useNativeBasedir="true" target="jarBote" />
</target>
<target name="copyrouterlibs" depends="buildJarsForBote" >
<!-- core -->
<!-- remove classes that are overridden -->
<!-- lots of unneeded stuff could be deleted here -->
<jar destfile="${jar.libs.dir}/i2p.jar" >
<zipfileset src="${i2plib}/i2p.jar" >
<exclude name="net/i2p/util/LogWriter.class" />
</zipfileset>
</jar>
<!-- router -->
<copy file="${i2plib}/router.jar" todir="${jar.libs.dir}" />
<!-- streaming -->
<copy file="${i2plib}/mstreaming.jar" todir="${jar.libs.dir}" />
<copy file="${i2plib}/streaming.jar" todir="${jar.libs.dir}" />
</target>
<available property="have.bote" file="${botelib}/i2pbote.jar" />
<target name="buildbote" unless="have.bote">
<ant dir="${botebase}" inheritall="false" useNativeBasedir="true" >
<property name="i2pbase" value="${i2pbase}" />
<property name="i2plib" value="${i2plib}" />
<target name="jar" />
</ant>
</target>
<target name="copybotelibs" depends="buildbote">
<!-- bote -->
<jar destfile="${jar.libs.dir}/i2pbote.jar" >
<!-- remove classes that are overridden or stubbed out -->
<zipfileset src="${botelib}/i2pbote.jar" >
<exclude name="i2p/bote/imap/" />
<exclude name="i2p/bote/service/UpdateChecker.class" />
<exclude name="i2p/bote/service/seedless/" />
<exclude name="i2p/bote/smtp/" />
</zipfileset>
<!-- Include necessary deps for stubbed-out classes -->
<zipfileset src="${botelib}/commons-lang-2.6.jar" >
<include name="org/apache/commons/lang/exception/Nestable.class" />
<include name="org/apache/commons/lang/exception/NestableException.class" />
</zipfileset>
<zipfileset src="${botelib}/commons-configuration-1.6.jar" >
<include name="org/apache/commons/configuration/ConfigurationException.class" />
</zipfileset>
</jar>
<!-- bote deps -->
<copy todir="${jar.libs.dir}">
<fileset dir="${botelib}">
<include name="bcprov-ecc-jdk16-146.jar" />
<!-- Regular JavaMail currently doesn't work on Android
<include name="mailapi.jar" />-->
<include name="lzma-9.20.jar" />
<include name="ntruenc-1.2.jar" />
<include name="flexi-gmss-1.7p1.jar" />
</fileset>
</copy>
<jar destfile="${jar.libs.dir}/scrypt-1.4.0.jar" >
<zipfileset src="${botelib}/scrypt-1.4.0.jar" >
<!-- Exclude x86_64 native binaries -->
<exclude name="lib/" />
</zipfileset>
</jar>
</target>
</project>