blob: e24a0e13cd763a4e4df9b596d5515e0127952c0c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
<project default="build" name="ZeroTierOneSDK" basedir=".">
<property environment="env"/>
<condition property="isWindows">
<os family="windows"/>
</condition>
<condition property="isMac">
<os family="mac"/>
</condition>
<target name="clean">
<delete dir="bin" failonerror="false"/>
<delete dir="classes" failonerror="false"/>
<delete dir="build_win32" failonerror="false"/>
<delete dir="build_win64" failonerror="false"/>
<delete dir="mac32_64" failonerror="false"/>
<delete dir="libs" failonerror="false"/>
<delete dir="obj" failonerror="false"/>
</target>
<target name="build_java">
<echo message="os.name = ${os.name}"/>
<echo message="os.arch = ${os.arch}"/>
<echo message="ant.java.version = ${ant.java.version}"/>
<echo message="java.version = ${java.version}"/>
<mkdir dir="bin"/>
<mkdir dir="classes"/>
<javac srcdir="src"
destdir="classes"
source="1.7"
target="1.7"
classpath="${env.ANDROID_PLATFORM}/android.jar"
includeantruntime="false"/>
</target>
<target name="build_android">
<exec dir="jni" executable="${env.NDK_BUILD_LOC}" failonerror="true">
<arg value="ZT1=${user.dir}/../"/>
<arg value="V=1"/>
</exec>
<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"/>
</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>
<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">
<jar destfile="bin/ZeroTierOneSDK.jar" basedir="classes"/>
</target>
<target name="docs">
<echo message="Generating Javadocs"/>
<mkdir dir="doc/"/>
<javadoc sourcepath="src/"
destdir="doc/"/>
</target>
<!-- <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>
|