2015-05-02 17:16:10 +00:00
|
|
|
<project default="build" name="ZeroTierOneSDK" basedir=".">
|
2015-04-24 03:17:29 +00:00
|
|
|
<property environment="env"/>
|
|
|
|
|
2015-05-01 04:50:28 +00:00
|
|
|
<condition property="isWindows">
|
|
|
|
<os family="windows"/>
|
|
|
|
</condition>
|
|
|
|
|
2015-05-05 03:04:44 +00:00
|
|
|
<condition property="isMac">
|
|
|
|
<os family="mac"/>
|
|
|
|
</condition>
|
|
|
|
|
2015-04-24 03:17:29 +00:00
|
|
|
<target name="clean">
|
2015-04-24 03:29:23 +00:00
|
|
|
<delete dir="bin" failonerror="false"/>
|
2015-04-24 03:34:59 +00:00
|
|
|
<delete dir="classes" failonerror="false"/>
|
2015-05-02 17:16:10 +00:00
|
|
|
<delete dir="build_win32" failonerror="false"/>
|
|
|
|
<delete dir="build_win64" failonerror="false"/>
|
2015-05-05 03:04:44 +00:00
|
|
|
<delete dir="mac32_64" failonerror="false"/>
|
2015-04-26 02:19:58 +00:00
|
|
|
<delete dir="libs" failonerror="false"/>
|
2015-04-24 03:29:23 +00:00
|
|
|
<delete dir="obj" failonerror="false"/>
|
2015-04-24 03:17:29 +00:00
|
|
|
</target>
|
|
|
|
|
2015-05-01 04:50:28 +00:00
|
|
|
<target name="build_java">
|
|
|
|
<echo message="os.name = ${os.name}"/>
|
2015-04-24 03:17:29 +00:00
|
|
|
<echo message="os.arch = ${os.arch}"/>
|
|
|
|
<echo message="ant.java.version = ${ant.java.version}"/>
|
|
|
|
<echo message="java.version = ${java.version}"/>
|
2015-04-24 03:29:23 +00:00
|
|
|
<mkdir dir="bin"/>
|
2015-04-24 03:34:59 +00:00
|
|
|
<mkdir dir="classes"/>
|
2015-04-24 03:17:29 +00:00
|
|
|
<javac srcdir="src"
|
2015-04-24 03:34:59 +00:00
|
|
|
destdir="classes"
|
2015-05-02 19:06:07 +00:00
|
|
|
source="1.7"
|
|
|
|
target="1.7"
|
2015-04-24 03:17:29 +00:00
|
|
|
classpath="${env.ANDROID_PLATFORM}/android.jar"
|
|
|
|
includeantruntime="false"/>
|
2015-05-01 04:50:28 +00:00
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="build_android">
|
2015-04-24 03:17:29 +00:00
|
|
|
<exec dir="jni" executable="${env.NDK_BUILD_LOC}" failonerror="true">
|
|
|
|
<arg value="ZT1=${user.dir}/../"/>
|
2015-06-02 03:01:37 +00:00
|
|
|
<arg value="V=1"/>
|
2015-04-24 03:17:29 +00:00
|
|
|
</exec>
|
2015-04-26 01:59:00 +00:00
|
|
|
<copy file="libs/armeabi/libZeroTierOneJNI.so"
|
|
|
|
tofile="${user.dir}/classes/lib/armeabi/libZeroTierOneJNI.so"
|
|
|
|
overwrite="true"/>
|
|
|
|
<copy file="libs/arm64-v8a/libZeroTierOneJNI.so"
|
|
|
|
tofile="${user.dir}/classes/lib/arm64-v8a/libZeroTierOneJNI.so"
|
|
|
|
overwrite="true"/>
|
|
|
|
<copy file="libs/armeabi-v7a/libZeroTierOneJNI.so"
|
|
|
|
tofile="${user.dir}/classes/lib/armeabi-v7a/libZeroTierOneJNI.so"
|
|
|
|
overwrite="true"/>
|
|
|
|
<copy file="libs/x86/libZeroTierOneJNI.so"
|
|
|
|
tofile="${user.dir}/classes/lib/x86/libZeroTierOneJNI.so"
|
|
|
|
overwrite="true"/>
|
2015-05-01 04:50:28 +00:00
|
|
|
</target>
|
|
|
|
|
|
|
|
|
|
|
|
<target name="windows" if="isWindows">
|
|
|
|
<mkdir dir="build_win32"/>
|
|
|
|
<exec dir="build_win32/" executable="cmake" failonerror="true">
|
|
|
|
<arg line=".. -G"Visual Studio 11 2012" -DCMAKE_BUILD_TYPE=Release"/>
|
|
|
|
</exec>
|
|
|
|
<exec dir="build_win32/" executable="cmake" failonerror="true">
|
|
|
|
<arg line="--build . --config Release"/>
|
|
|
|
</exec>
|
|
|
|
<copy file="build_win32/Release/ZeroTierOneJNI.dll"
|
|
|
|
tofile="classes/lib/ZeroTierOneJNI_win32.dll"
|
|
|
|
overwrite="true"/>
|
|
|
|
|
|
|
|
<mkdir dir="build_win64"/>
|
|
|
|
<exec dir="build_win64/" executable="cmake" failonerror="true">
|
|
|
|
<arg line=".. -G"Visual Studio 11 2012 Win64" -DCMAKE_BUILD_TYPE=Release"/>
|
|
|
|
</exec>
|
|
|
|
<exec dir="build_win64/" executable="cmake" failonerror="true">
|
|
|
|
<arg line="--build . --config Release"/>
|
|
|
|
</exec>
|
|
|
|
<copy file="build_win64/Release/ZeroTierOneJNI.dll"
|
|
|
|
tofile="classes/lib/ZeroTierOneJNI_win64.dll"
|
|
|
|
overwrite="true"/>
|
|
|
|
</target>
|
|
|
|
|
2015-05-05 03:04:44 +00:00
|
|
|
<target name="mac" if="isMac">
|
|
|
|
<mkdir dir="mac32_64"/>
|
|
|
|
<exec dir="mac32_64/" executable="cmake" failonerror="true">
|
|
|
|
<arg line=".. -DCMAKE_BUILD_TYPE=Release"/>
|
|
|
|
</exec>
|
|
|
|
<exec dir="mac32_64/" executable="cmake" failonerror="true">
|
|
|
|
<arg line="--build . --config Release"/>
|
|
|
|
</exec>
|
|
|
|
<copy file="mac32_64/libZeroTierOneJNI.jnilib"
|
|
|
|
tofile="classes/lib/libZeroTierOneJNI.jnilib"
|
|
|
|
overwrite="true"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="build" depends="build_java,build_android,windows,mac">
|
2015-04-24 03:34:59 +00:00
|
|
|
<jar destfile="bin/ZeroTierOneSDK.jar" basedir="classes"/>
|
2015-04-24 03:17:29 +00:00
|
|
|
</target>
|
|
|
|
|
2015-04-26 00:29:07 +00:00
|
|
|
<target name="docs">
|
|
|
|
<echo message="Generating Javadocs"/>
|
|
|
|
<mkdir dir="doc/"/>
|
|
|
|
<javadoc sourcepath="src/"
|
|
|
|
destdir="doc/"/>
|
|
|
|
</target>
|
|
|
|
|
2015-04-24 03:17:29 +00:00
|
|
|
<!-- <target name="android" depends="build">
|
|
|
|
<echo message="OS is Android, installing..."/>
|
|
|
|
<copy file="libs/armeabi/libZeroTierOneJNI.so"
|
|
|
|
tofile="${aproj_loc}/libs/armeabi/libZeroTierOneJNI.so"
|
|
|
|
overwrite="true"/>
|
|
|
|
<copy file="libs/arm64-v8a/libZeroTierOneJNI.so"
|
|
|
|
tofile="${aproj_loc}/libs/arm64-v8a/libZeroTierOneJNI.so"
|
|
|
|
overwrite="true"/>
|
|
|
|
<copy file="libs/armeabi-v7a/libZeroTierOneJNI.so"
|
|
|
|
tofile="${aproj_loc}/libs/armeabi-v7a/libZeroTierOneJNI.so"
|
|
|
|
overwrite="true"/>
|
|
|
|
<copy file="libs/x86/libZeroTierOneJNI.so"
|
|
|
|
tofile="${aproj_loc}/libs/x86/libZeroTierOneJNI.so"
|
|
|
|
overwrite="true"/>
|
|
|
|
<copy file="bin/ZeroTierOneSDK.jar"
|
|
|
|
tofile="${aproj_loc}/libs/ZeroTierOneSDK.jar"
|
|
|
|
overwrite="true"/>
|
|
|
|
</target> -->
|
|
|
|
</project>
|