|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!--build_version=1.4--> |
| 3 | + |
| 4 | + |
| 5 | +<project name="Connectivity" default="default" basedir="."> |
| 6 | + <description>Builds, tests, and runs the project Connectivity.</description> |
| 7 | + <import file="nbproject/build-impl.xml"/> |
| 8 | + <property file="codenameone_settings.properties"/> |
| 9 | + |
| 10 | + <target depends="init,compile,jar" name="compile-test"> |
| 11 | + </target> |
| 12 | + |
| 13 | + <target depends="compile-test" name="-do-test-run"> |
| 14 | + </target> |
| 15 | + |
| 16 | + <target depends="-do-test-run" description="Run unit tests." name="test"> |
| 17 | + <echo>Currently testing a library project isn't supported</echo> |
| 18 | + </target> |
| 19 | + |
| 20 | + <target name="-pre-compile"> |
| 21 | + <echo>Compile is forcing compliance to the supported API's/features for maximum device compatibility. This allows smaller |
| 22 | + code size and wider device support</echo> |
| 23 | + <mkdir dir="build/tmp"/> |
| 24 | + <javac destdir="build/tmp" |
| 25 | + source="1.5" |
| 26 | + target="1.5" |
| 27 | + bootclasspath="lib/CLDC11.jar" |
| 28 | + classpath="${javac.classpath}:${build.classes.dir}"> |
| 29 | + <src path="${src.dir}"/> |
| 30 | + </javac> |
| 31 | + </target> |
| 32 | + |
| 33 | + |
| 34 | + <target name="-pre-init"> |
| 35 | + <property name="javac.source" value="1.5" /> |
| 36 | + <property name="javac.target" value="1.5" /> |
| 37 | + </target> |
| 38 | + |
| 39 | + <target name="run"> |
| 40 | + <echo>You can't run a library project</echo> |
| 41 | + </target> |
| 42 | + |
| 43 | + <target name="debug"> |
| 44 | + <echo>You can't run a library project</echo> |
| 45 | + </target> |
| 46 | + |
| 47 | + <target name="Stubs"> |
| 48 | + <delete dir="build/stubs"/> |
| 49 | + <javadoc sourcepath="src" |
| 50 | + classpath="lib/CodenameOne.jar:lib/CLDC11.jar" |
| 51 | + docletpath="Stubber.jar" |
| 52 | + doclet="com.codename1.build.client.StubGenerator"> |
| 53 | + <fileset dir="${src.dir}" excludes="*.java,${excludes}" includes="${includes}"> |
| 54 | + <filename name="**/*.java"/> |
| 55 | + </fileset> |
| 56 | + </javadoc> |
| 57 | + </target> |
| 58 | + |
| 59 | + <target name="jar" depends="compile,Stubs"> |
| 60 | + <mkdir dir="build/lib" /> |
| 61 | + <zip basedir="${build.classes.dir}" compress="false" destfile="build/lib/main.zip" /> |
| 62 | + <zip basedir="build/stubs" compress="false" destfile="build/lib/stubs.zip" /> |
| 63 | + <copy file="manifest.properties" todir="build/lib" /> |
| 64 | + <copy file="codenameone_library_appended.properties" todir="build/lib" /> |
| 65 | + <copy file="codenameone_library_required.properties" todir="build/lib" /> |
| 66 | + <antcall target="buildNativeIOS" /> |
| 67 | + <antcall target="buildNativeRIM" /> |
| 68 | + <antcall target="buildNativeAND" /> |
| 69 | + <antcall target="buildNativeSE" /> |
| 70 | + <antcall target="buildNativeWIN" /> |
| 71 | + <antcall target="buildNativeME" /> |
| 72 | + <antcall target="buildNativeJS" /> |
| 73 | + <mkdir dir="dist" /> |
| 74 | + <zip basedir="build/lib" compress="true" destfile="dist/${application.title}.cn1lib" /> |
| 75 | + </target> |
| 76 | + |
| 77 | + <target name="buildNativeRIM"> |
| 78 | + <path id="rimNativeDir"> |
| 79 | + <fileset dir="native/rim"/> |
| 80 | + </path> |
| 81 | + <property name="test.rimDir.property" refid="rimNativeDir"/> |
| 82 | + <condition property="doesntHaveRimFiles"> |
| 83 | + <equals arg1="" arg2="${test.rimDir.property}"/> |
| 84 | + </condition> |
| 85 | + |
| 86 | + <antcall target="createRimZip" /> |
| 87 | + </target> |
| 88 | + |
| 89 | + <target name="createRimZip" |
| 90 | + unless="doesntHaveRimFiles"> |
| 91 | + <echo>Zipping rim native code</echo> |
| 92 | + <zip basedir="native/rim" compress="false" destfile="build/lib/nativerim.zip" /> |
| 93 | + </target> |
| 94 | + |
| 95 | + <target name="buildNativeAND"> |
| 96 | + <path id="andNativeDir"> |
| 97 | + <fileset dir="native/android"/> |
| 98 | + </path> |
| 99 | + <property name="test.andDir.property" refid="andNativeDir"/> |
| 100 | + <condition property="doesntHaveAndFiles"> |
| 101 | + <equals arg1="" arg2="${test.andDir.property}"/> |
| 102 | + </condition> |
| 103 | + |
| 104 | + <antcall target="createAndZip" /> |
| 105 | + </target> |
| 106 | + |
| 107 | + <target name="buildNativeSE"> |
| 108 | + <mkdir dir="native/javase" /> |
| 109 | + <path id="seNativeDir"> |
| 110 | + <fileset dir="native/javase"/> |
| 111 | + </path> |
| 112 | + <property name="test.seDir.property" refid="seNativeDir"/> |
| 113 | + <condition property="doesntHaveSeFiles"> |
| 114 | + <equals arg1="" arg2="${test.seDir.property}"/> |
| 115 | + </condition> |
| 116 | + |
| 117 | + <antcall target="createSeZip" /> |
| 118 | + </target> |
| 119 | + |
| 120 | + <target name="createSeZip" |
| 121 | + unless="doesntHaveSeFiles"> |
| 122 | + <echo>Zipping JavaSE native code</echo> |
| 123 | + <zip basedir="native/javase" compress="false" destfile="build/lib/nativese.zip" /> |
| 124 | + |
| 125 | + </target> |
| 126 | + |
| 127 | + <target name="createAndZip" |
| 128 | + unless="doesntHaveAndFiles"> |
| 129 | + <echo>Zipping Android native code</echo> |
| 130 | + <zip basedir="native/android" compress="false" destfile="build/lib/nativeand.zip" /> |
| 131 | + </target> |
| 132 | + |
| 133 | + <target name="buildNativeWIN"> |
| 134 | + <path id="winNativeDir"> |
| 135 | + <fileset dir="native/win"/> |
| 136 | + </path> |
| 137 | + <property name="test.winDir.property" refid="winNativeDir"/> |
| 138 | + <condition property="doesntHaveWinFiles"> |
| 139 | + <equals arg1="" arg2="${test.winDir.property}"/> |
| 140 | + </condition> |
| 141 | + |
| 142 | + <antcall target="createWinZip" /> |
| 143 | + </target> |
| 144 | + |
| 145 | + <target name="createWinZip" |
| 146 | + unless="doesntHaveWinFiles"> |
| 147 | + <echo>Zipping win native code</echo> |
| 148 | + <zip basedir="native/win" compress="false" destfile="build/lib/nativewin.zip" /> |
| 149 | + </target> |
| 150 | + |
| 151 | + <target name="buildNativeIOS"> |
| 152 | + <path id="iosNativeDir"> |
| 153 | + <fileset dir="native/ios"/> |
| 154 | + </path> |
| 155 | + <property name="test.iosDir.property" refid="iosNativeDir"/> |
| 156 | + <condition property="doesntHaveIosFiles"> |
| 157 | + <equals arg1="" arg2="${test.iosDir.property}"/> |
| 158 | + </condition> |
| 159 | + |
| 160 | + <antcall target="createIosZip" /> |
| 161 | + </target> |
| 162 | + |
| 163 | + <target name="createIosZip" |
| 164 | + unless="doesntHaveIosFiles"> |
| 165 | + <echo>Zipping ios native code</echo> |
| 166 | + <zip basedir="native/ios" compress="false" destfile="build/lib/nativeios.zip" /> |
| 167 | + </target> |
| 168 | + |
| 169 | + <target name="buildNativeME"> |
| 170 | + <path id="meNativeDir"> |
| 171 | + <fileset dir="native/j2me"/> |
| 172 | + </path> |
| 173 | + <property name="test.meDir.property" refid="meNativeDir"/> |
| 174 | + <condition property="doesntHaveMeFiles"> |
| 175 | + <equals arg1="" arg2="${test.meDir.property}"/> |
| 176 | + </condition> |
| 177 | + |
| 178 | + <antcall target="createMeZip" /> |
| 179 | + </target> |
| 180 | + |
| 181 | + <target name="createMeZip" |
| 182 | + unless="doesntHaveMeFiles"> |
| 183 | + <echo>Zipping me native code</echo> |
| 184 | + <zip basedir="native/j2me" compress="false" destfile="build/lib/nativeme.zip" /> |
| 185 | + </target> |
| 186 | + |
| 187 | + |
| 188 | + <target name="buildNativeJS"> |
| 189 | + <path id="jsNativeDir"> |
| 190 | + <fileset dir="native/javascript"/> |
| 191 | + </path> |
| 192 | + <property name="test.jsDir.property" refid="jsNativeDir"/> |
| 193 | + <condition property="doesntHaveJsFiles"> |
| 194 | + <equals arg1="" arg2="${test.jsDir.property}"/> |
| 195 | + </condition> |
| 196 | + |
| 197 | + <antcall target="createJsZip" /> |
| 198 | + </target> |
| 199 | + |
| 200 | + <target name="createJsZip" |
| 201 | + unless="doesntHaveJsFiles"> |
| 202 | + <echo>Zipping javascript native code</echo> |
| 203 | + <zip basedir="native/javascript" compress="false" destfile="build/lib/nativejavascript.zip" /> |
| 204 | + </target> |
| 205 | + |
| 206 | +</project> |
0 commit comments