forked from ringcentral/pubnub-jtools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
92 lines (88 loc) · 3.89 KB
/
build.xml
File metadata and controls
92 lines (88 loc) · 3.89 KB
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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="build-all" name="PubnubApi">
<property environment="env"/>
<loadfile property="VERSION" srcFile="../VERSION"><filterchain><striplinebreaks/></filterchain></loadfile>
<property name="pubnub_lib_jar" value="Pubnub-Android-${VERSION}.jar"/>
<property name="pubnub_debug_lib_jar" value="Pubnub-Android-Debug-${VERSION}.jar"/>
<property name="java_core_path" value="../java"/>
<property name="src_pubnub_api_path" value="${java_core_path}/srcPubnubApi"/>
<property name="src_java_path" value="${java_core_path}/src1"/>
<property name="src_logging_path" value="./srcLogging"/>
<property name="src_android_path" value="./src"/>
<property name="android_jar_path" value="jars"/>
<property name="target" value="1.5"/>
<property name="source" value="1.5"/>
<path id="classpath">
<pathelement location="bin"/>
<pathelement location="${java_core_path}/libs/bcprov-jdk15on-1.47.jar"/>
<pathelement location="libs/android-8.jar"/>
</path>
<target name="test" />
<target name="build-all" depends="debug-build, clean, build" />
<target name="setDebugTrue" >
<replace dir="${src_pubnub_api_path}" token="boolean LOGGING = false" value="boolean LOGGING = true">
<include name="**/*.java"/>
</replace>
</target>
<target name="unsetDebugTrue" >
<replace dir="${src_pubnub_api_path}" token="boolean LOGGING = true" value="boolean LOGGING = false">
<include name="**/*.java"/>
</replace>
</target>
<target name="init">
<mkdir dir="bin"/>
<copy includeemptydirs="false" todir="bin">
<fileset dir="${src_pubnub_api_path}">
<exclude name="**/*.launch"/>
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="bin"/>
</target>
<target depends="clean" name="cleanall"/>
<target depends="copy_jars_to_examples" name="build-jar"/>
<target depends="create-jar" name="copy_jars_to_examples">
<copy file="${pubnub_lib_jar}" todir="./examples/PubnubExample/libs/"/>
<copy file="${pubnub_lib_jar}" todir="./examples/SubscribeAtBoot/libs/"/>
</target>
<target name="build" depends="clean">
<delete file="${pubnub_lib_jar}"/>
<antcall target="build-jar">
<param name="jar_name" value="${pubnub_lib_jar}" />
<param name="debug" value="false" />
</antcall>
</target>
<target name="debug-build" depends="clean">
<delete file="${pubnub_debug_lib_jar}"/>
<antcall target="setDebugTrue" />
<antcall target="build-jar">
<param name="jar_name" value="${pubnub_debug_lib_jar}" />
<param name="debug" value="true" />
</antcall>
<antcall target="unsetDebugTrue" />
</target>
<target depends="build-project" name="create-jar">
<jar destfile="${jar_name}"
basedir="bin"
includes="**/**"
/>
</target>
<target depends="init" name="build-project">
<echo message="${ant.project.name}: ${ant.file}"/>
<replace dir="${src_pubnub_api_path}" token='static String VERSION = ""' value='static String VERSION = "${VERSION}"' >
<include name="**/*.java"/>
</replace>
<javac debug="${debug}" destdir="bin" source="${source}" target="${target}">
<src path="${src_pubnub_api_path}"/>
<src path="${src_java_path}"/>
<src path="${src_logging_path}"/>
<src path="${src_android_path}"/>
<classpath refid="classpath"/>
</javac>
<replace dir="${src_pubnub_api_path}" token='static String VERSION = "${VERSION}"' value='static String VERSION = ""'>
<include name="**/*.java"/>
</replace>
</target>
</project>