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
102 lines (101 loc) · 4.44 KB
/
build.xml
File metadata and controls
102 lines (101 loc) · 4.44 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
93
94
95
96
97
98
99
100
101
102
<?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-BlackBerry-${VERSION}.jar"/>
<property name="pubnub_debug_lib_jar" value="Pubnub-BlackBerry-Debug-${VERSION}.jar"/>
<property name="srcPubnubApi.link" value="../java/srcPubnubApi"/>
<property name="j2me.link" value="../j2me"/>
<property name="target" value="1.1"/>
<property name="source" value="1.3"/>
<path id="PubnubApi.classpath">
<pathelement location="bin"/>
<pathelement location="${j2me.link}/libs/cldc_1.1.jar"/>
<pathelement location="${j2me.link}/libs/jsr177_1.0.jar"/>
<pathelement location="${j2me.link}/libs/midp_2.0.jar"/>
<pathelement location="${j2me.link}/libs/bouncycastle.jar"/>
<pathelement location="${j2me.link}/libs/jsonme.jar"/>
<pathelement location="${j2me.link}/libs/tinylinegzip.jar"/>
</path>
<target name="test" />
<target name="build-all" depends="clean, debug-build, clean, build" />
<target name="deploy-all" />
<target name="setJsonMeJar" >
<replace dir="${srcPubnubApi.link}" token="org.json" value="org.json.me">
<include name="**/*.java"/>
</replace>
</target>
<target name="unsetJsonMeJar" >
<replace dir="${srcPubnubApi.link}" token="org.json.me" value="org.json">
<include name="**/*.java"/>
</replace>
</target>
<target depends="setJsonMeJar" name="init">
<mkdir dir="bin"/>
<copy includeemptydirs="false" todir="bin">
<fileset dir="${srcPubnubApi.link}">
<exclude name="**/*.launch"/>
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target depends="unsetJsonMeJar" name="clean">
<delete dir="bin"/>
</target>
<target depends="clean" name="cleanall"/>
<target name="setDebugTrue" >
<replace dir="${srcPubnubApi.link}" token="boolean LOGGING = false" value="boolean LOGGING = true">
<include name="**/*.java"/>
</replace>
</target>
<target name="unsetDebugTrue" >
<replace dir="${srcPubnubApi.link}" token="boolean LOGGING = true" value="boolean LOGGING = false">
<include name="**/*.java"/>
</replace>
</target>
<target name="build" depends="clean" >
<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" >
<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="create-jar, clean" name="build-jar"/>
<target depends="build-project" name="create-jar">
<jar destfile="${jar_name}"
basedir="bin"
includes="**/**"
/>
<exec failonerror="true" executable="tools/preverify">
<arg line="-classpath libs/net_rim_api.jar:libs/bouncycastle.jar:../j2me/libs/tinylinegzip.jar"/>
<arg line="-d output"/>
<arg line="${jar_name}"/>
</exec>
<move verbose="true" file="output/${jar_name}" tofile="${jar_name}"/>
<delete dir="output"/>
</target>
<target depends="init" name="build-project">
<echo message="${ant.project.name}: ${ant.file}"/>
<replace dir="${srcPubnubApi.link}" token='static String VERSION = ""' value='static String VERSION = "${VERSION}"' >
<include name="**/*.java"/>
</replace>
<javac debug="${debug}" destdir="bin" source="${source}" target="${target}">
<src path="${srcPubnubApi.link}"/>
<src path="src"/>
<src path="${j2me.link}/src1"/>
<src path="${j2me.link}/srcLogging"/>
<src path="../java/srcCrypto"/>
<classpath refid="PubnubApi.classpath"/>
</javac>
<replace dir="${srcPubnubApi.link}" token='static String VERSION = "${VERSION}"' value='static String VERSION = ""'>
<include name="**/*.java"/>
</replace>
</target>
</project>