|
1 | 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
2 | | -<project basedir="." default="build" name="PubnubApi"> |
| 2 | +<project basedir="." default="build-all" name="PubnubApi"> |
3 | 3 | <property environment="env"/> |
4 | 4 | <loadfile property="VERSION" srcFile="../VERSION"><filterchain><striplinebreaks/></filterchain></loadfile> |
5 | 5 | <property name="pubnub_lib_jar" value="Pubnub-Android-${VERSION}.jar"/> |
| 6 | + <property name="pubnub_debug_lib_jar" value="Pubnub-Android-Debug-${VERSION}.jar"/> |
6 | 7 | <property name="java_core_path" value="../java"/> |
7 | 8 | <property name="src_pubnub_api_path" value="${java_core_path}/srcPubnubApi"/> |
8 | 9 | <property name="src_java_path" value="${java_core_path}/src1"/> |
|
17 | 18 | <pathelement location="libs/android-8.jar"/> |
18 | 19 | </path> |
19 | 20 | <target name="test" /> |
| 21 | + <target name="build-all" depends="debug-build, clean, build" /> |
20 | 22 | <target name="setDebugTrue" > |
21 | 23 | <replace dir="${src_pubnub_api_path}" token="boolean LOGGING = false" value="boolean LOGGING = true"> |
22 | 24 | <include name="**/*.java"/> |
|
27 | 29 | <include name="**/*.java"/> |
28 | 30 | </replace> |
29 | 31 | </target> |
30 | | - <target depends="setDebugTrue,build,unsetDebugTrue" name="debug-build"/> |
31 | 32 | <target name="init"> |
32 | 33 | <mkdir dir="bin"/> |
33 | 34 | <copy includeemptydirs="false" todir="bin"> |
|
39 | 40 | </target> |
40 | 41 | <target name="clean"> |
41 | 42 | <delete dir="bin"/> |
42 | | - <delete file="${pubnub_lib_jar}"/> |
43 | 43 | </target> |
44 | 44 | <target depends="clean" name="cleanall"/> |
45 | | - <target depends="copy_jars_to_examples" name="build"/> |
| 45 | + <target depends="copy_jars_to_examples" name="build-jar"/> |
46 | 46 | <target depends="create-jar" name="copy_jars_to_examples"> |
47 | 47 | <copy file="${pubnub_lib_jar}" todir="./examples/PubnubExample/libs/"/> |
48 | 48 | <copy file="${pubnub_lib_jar}" todir="./examples/SubscribeAtBoot/libs/"/> |
49 | 49 | </target> |
50 | 50 |
|
| 51 | + |
| 52 | + <target name="build" depends="clean"> |
| 53 | + <delete file="${pubnub_lib_jar}"/> |
| 54 | + <antcall target="build-jar"> |
| 55 | + <param name="jar_name" value="${pubnub_lib_jar}" /> |
| 56 | + <param name="debug" value="false" /> |
| 57 | + </antcall> |
| 58 | + </target> |
| 59 | + <target name="debug-build" depends="clean"> |
| 60 | + <delete file="${pubnub_debug_lib_jar}"/> |
| 61 | + <antcall target="setDebugTrue" /> |
| 62 | + <antcall target="build-jar"> |
| 63 | + <param name="jar_name" value="${pubnub_debug_lib_jar}" /> |
| 64 | + <param name="debug" value="true" /> |
| 65 | + </antcall> |
| 66 | + <antcall target="unsetDebugTrue" /> |
| 67 | + </target> |
| 68 | + |
51 | 69 | <target depends="build-project" name="create-jar"> |
52 | | - <jar destfile="${pubnub_lib_jar}" |
| 70 | + <jar destfile="${jar_name}" |
53 | 71 | basedir="bin" |
54 | 72 | includes="**/**" |
55 | 73 | /> |
56 | 74 | </target> |
57 | 75 |
|
58 | 76 | <target depends="init" name="build-project"> |
59 | 77 | <echo message="${ant.project.name}: ${ant.file}"/> |
60 | | - <replace dir="${src_pubnub_api_path}" token='protected static String VERSION = ""' value='protected static String VERSION = "${VERSION}"' > |
| 78 | + <replace dir="${src_pubnub_api_path}" token='static String VERSION = ""' value='static String VERSION = "${VERSION}"' > |
61 | 79 | <include name="**/*.java"/> |
62 | 80 | </replace> |
63 | | - <javac destdir="bin" source="${source}" target="${target}"> |
| 81 | + <javac debug="${debug}" destdir="bin" source="${source}" target="${target}"> |
64 | 82 | <src path="${src_pubnub_api_path}"/> |
65 | 83 | <src path="${src_java_path}"/> |
66 | 84 | <src path="${src_logging_path}"/> |
67 | 85 | <src path="${src_android_path}"/> |
68 | 86 | <classpath refid="classpath"/> |
69 | 87 | </javac> |
70 | | - <replace dir="${src_pubnub_api_path}" token='protected static String VERSION = "${VERSION}"' value='protected static String VERSION = ""'> |
| 88 | + <replace dir="${src_pubnub_api_path}" token='static String VERSION = "${VERSION}"' value='static String VERSION = ""'> |
71 | 89 | <include name="**/*.java"/> |
72 | 90 | </replace> |
73 | 91 | </target> |
|
0 commit comments