javauis/eswt_qt/org.eclipse.swt.qt.s60.armv5/build.xml
branchGCC_SURGE
changeset 40 c6043ea9b06a
parent 38 854be117f6a5
parent 35 85266cc22c7f
child 41 6918cb13caa7
equal deleted inserted replaced
38:854be117f6a5 40:c6043ea9b06a
     1 <?xml version="1.0" encoding="UTF-8"?>
       
     2 <project name="org.eclipse.swt.qt.s60.armv5" default="build" basedir=".">
       
     3 
       
     4     <target name="help">
       
     5         <echo level="info">
       
     6 Usage: ant [one of the following:]
       
     7 build              : Build debug + release
       
     8 build.jar          : Build all jars
       
     9 build.debug        : Build all debug binaries
       
    10 build.release      : Build all release binaries
       
    11 build.lib          : Build all native libraries
       
    12 build.lib.debug    : Build debug native libraries
       
    13 build.lib.release  : Build release native libraries
       
    14 build.tests        : Build JUnit and MT tests
       
    15 clean              : Clean everything
       
    16 clean.jar          : Clean all jars
       
    17 clean.lib          : Clean native libraries and object files
       
    18 clean.lib.debug    : Clean debug native libraries and object files
       
    19 clean.lib.release  : Clean release native libraries and object files
       
    20 export             : Export everything
       
    21 export.jar         : Export Java classes packed as jar
       
    22 export.debug       : Export all debug binaries
       
    23 export.release     : Export all release binaries
       
    24 export.lib         : Export native libraries
       
    25 export.lib.debug   : Export debug native libraries
       
    26 export.lib.release : Export release native libraries
       
    27 run.tests          : Run JUnit and MT tests
       
    28 make.sis           : Create OMJ SIS package
       
    29         </echo>
       
    30     </target>
       
    31 
       
    32     <target name="init" depends="init.env, init.export.path">
       
    33         <property file="./build.properties"></property>
       
    34         <property name="full.name" value="${fragment}_${version.suffix}"/>
       
    35         <property name="temp.dir" value="${basedir}/temp"/>
       
    36         <property name="plugin.destination" value="${basedir}"/>
       
    37         <property name="build.result.dir" value="${basedir}"/>
       
    38         <property name="download.destination" value="${basedir}"/>
       
    39         <property name="lib.path" value = "${plugin.dir}/Eclipse_SWT_PI/qt/library"/>
       
    40         <property name="lib.gfx.path" value = "${plugin.dir}/Eclipse_SWT_PI/qt/library/graphics"/>
       
    41         <property name="odc.location" value = "${plugin.dir}/Eclipse_SWT_PI/s60"/>
       
    42         <mkdir dir="${lib.path}/${generated.native.dir}"/>
       
    43         <!-- Platform Specific properties -->
       
    44         <property name="test.jar.dir" value = "${epoc.root}epoc32/release/armv5/urel/z/resource/java/jvm/lib/common"/>
       
    45         <property name="jar.dir" value = "${epoc.root}epoc32/release/armv5/urel/z/resource/java/jvm/lib/jrt"/>
       
    46         <property name="epoc.debug.dir" value = "${epoc.root}epoc32/release/armv5/udeb"/>
       
    47         <property name="epoc.release.dir" value = "${epoc.root}epoc32/release/armv5/urel"/>
       
    48         <property name="omj.loc.dir" value = "${epoc.root}${java.src.root}/build/loc"/>
       
    49         <path id="javac.bootclasspath">
       
    50             <pathelement path="${epoc.root}epoc32/BUILD/java/javabuild/javautils/winscw/debug/classes/collection"/>
       
    51             <pathelement location="${epoc.root}epoc32/release/armv5/urel/java_signature_test.jar"/>
       
    52         </path>
       
    53     </target>
       
    54     
       
    55     <target name="init.env">
       
    56         <property environment = "env"/>
       
    57 
       
    58         <!-- If environment variables JAVA_SRC_ROOT, JAVA_BIN_ROOT and/or EPOC_ROOT are
       
    59              set, use those values. Otherwise default to values that work in OMJ build
       
    60              environment -->
       
    61         <condition property="java.src.root" value="${env.JAVA_SRC_ROOT}" else="/omj_build/">
       
    62             <isset property="env.JAVA_SRC_ROOT"/>
       
    63         </condition>
       
    64         <condition property="java.bin.root" value="${env.JAVA_BIN_ROOT}" else="/epoc32/armv5/c/java/">
       
    65             <isset property="env.JAVA_BIN_ROOT"/>
       
    66         </condition>        
       
    67         <!--<condition property="epoc.root" value="${env.EPOCROOT}" else="/">
       
    68             <isset property="env.EPOCROOT"/>
       
    69         </condition>-->
       
    70         <property name="epoc.root" value="z:\"/>
       
    71               
       
    72     </target>
       
    73 
       
    74     <target name="init.export.path">
       
    75         <property name="export.jar.debug.path" value = "${epoc.root}epoc32/release/armv5/udeb/Z/resource/java/jvm/lib/jrt"/>
       
    76         <property name="export.jar.release.path" value = "${epoc.root}epoc32/release/armv5/urel/Z/resource/java/jvm/lib/jrt"/>
       
    77         <property name="export.lib.debug.path" value = "${epoc.root}epoc32/release/armv5/udeb"/>
       
    78         <property name="export.lib.release.path" value = "${epoc.root}epoc32/release/armv5/urel"/>
       
    79     </target>
       
    80         
       
    81     <target name="download" depends="init">
       
    82         <delete dir="${temp.dir}"/>
       
    83         <mkdir dir="${temp.dir}/swtdownload/"/>
       
    84         <antcall target="build.jar"/>
       
    85         <jar jarfile="${build.result.dir}/${jar.filename}" basedir="${basedir}/release/" 
       
    86                 update="true" includes="eswt*.dll,libeswt*.so"/>
       
    87         <copy file="${build.result.dir}/${jar.filename}" todir="${temp.dir}/swtdownload"/>
       
    88         <antcall target="src.zip"/>
       
    89         <copy file="${build.result.dir}/src.zip" todir="${temp.dir}/swtdownload"/>
       
    90         <copy file="${plugin.dir}/build/.project" todir="${temp.dir}/swtdownload"/>
       
    91         <copy file="${plugin.dir}/build/.classpath" todir="${temp.dir}/swtdownload"/>
       
    92         <copy todir="${temp.dir}/swtdownload">
       
    93             <fileset dir="${basedir}" includes="about.html,about_files/"/>
       
    94         </copy>
       
    95         <zip zipfile="${download.destination}/eswt-${ws}-${os}-${arch}-${jsdk}.zip">
       
    96             <zipfileset dir="${temp.dir}/swtdownload/"/>
       
    97         </zip>
       
    98         <delete dir="${temp.dir}"/>
       
    99     </target>
       
   100 
       
   101     <target name="src.zip" depends="init">
       
   102         <mkdir dir="${build.result.dir}/"/>
       
   103         <zip zipfile="${build.result.dir}/src.zip">
       
   104             <fileset dir="${plugin.dir}/Eclipse SWT/common/" includes="**/*.java" excludes=""/>
       
   105             <fileset dir="${plugin.dir}/Eclipse SWT/common_j2${java.edition}/" includes="**/*.java" excludes=""/>
       
   106             <fileset dir="${plugin.dir}/Eclipse SWT/qt/" includes="**/*.java" excludes=""/>
       
   107             <fileset dir="${plugin.dir}/Eclipse SWT Browser/common/" includes="**/*.java" excludes=""/>
       
   108             <fileset dir="${plugin.dir}/Eclipse SWT Browser/qt/" includes="**/*.java" excludes=""/>
       
   109             <fileset dir="${plugin.dir}/Eclipse SWT Drag and Drop/qt/" includes="**/*.java" excludes=""/>
       
   110             <fileset dir="${plugin.dir}/Eclipse_SWT_PI/common_j2${java.edition}/" includes="**/*.java" excludes=""/>
       
   111             <fileset dir="${plugin.dir}/Eclipse_SWT_PI/qt/library/"/>
       
   112             <fileset dir="${plugin.dir}/Eclipse_SWT_PI/qt/graphics_library/"/>
       
   113             <fileset dir="${plugin.dir}/Eclipse_SWT_PI/qt/" includes="**/*.java" excludes=""/>
       
   114                 <fileset dir="${plugin.dir}/Eclipse_SWT_PI/s60/" includes="**/*.java" excludes=""/>
       
   115             <fileset dir="${plugin.dir}/../com.nokia.swt.extensions/extensions/" includes="**/*.java" excludes=""/>
       
   116             <fileset dir="${plugin.dir}/../com.nokia.swt.extensions/midp/" includes="**/*.java" excludes=""/>
       
   117             <fileset dir="${plugin.dir}/Eclipse SWT/common_j2${java.edition}/" includes="**/*.properties" excludes=""/>
       
   118             <fileset dir="${plugin.dir}/Eclipse SWT/common/" includes="**/version.txt" excludes=""/>
       
   119             <fileset dir="${basedir}" includes="about.html,about_files/" excludes=""/>
       
   120         </zip>
       
   121     </target>
       
   122         
       
   123     <target name="gather.sources" depends="init" if="destination.temp.folder">
       
   124         <mkdir dir="${destination.temp.folder}/${full.name}"/>
       
   125         <copy file="${build.result.dir}/src.zip" todir="${destination.temp.folder}/${full.name}/"/>
       
   126         <copy todir="${destination.temp.folder}/${full.name}">
       
   127             <fileset dir="${basedir}" includes="about.html,about_files/"/>
       
   128         </copy>
       
   129     </target>
       
   130 
       
   131     <target name="gather.individual.sources" depends="init">
       
   132         <copy todir="${destination.temp.folder}/" failonerror="true" overwrite="true">
       
   133             <fileset dir="${plugin.dir}/Eclipse SWT/common/" includes="**/*.java" excludes=""/>
       
   134             <fileset dir="${plugin.dir}/Eclipse SWT/common_j2${java.edition}/" includes="**/*.java" excludes=""/>
       
   135             <fileset dir="${plugin.dir}/Eclipse SWT/qt/" includes="**/*.java" excludes=""/>
       
   136             <fileset dir="${plugin.dir}/Eclipse SWT Browser/common/" includes="**/*.java" excludes=""/>
       
   137             <fileset dir="${plugin.dir}/Eclipse SWT Browser/qt/" includes="**/*.java" excludes=""/>
       
   138             <fileset dir="${plugin.dir}/Eclipse SWT Drag and Drop/qt/" includes="**/*.java" excludes=""/>
       
   139             <fileset dir="${plugin.dir}/Eclipse_SWT_PI/common_j2${java.edition}/" includes="**/*.java" excludes=""/>
       
   140             <fileset dir="${plugin.dir}/Eclipse_SWT_PI/qt/" includes="**/*.java" excludes=""/>
       
   141             <fileset dir="${plugin.dir}/Eclipse_SWT_PI/s60/" includes="**/*.java" excludes=""/>
       
   142             <fileset dir="${plugin.dir}/Eclipse_SWT_PI/qt/library/"/>
       
   143             <fileset dir="${plugin.dir}/Eclipse_SWT_PI/qt/graphics_library/"/>
       
   144             <fileset dir="${plugin.dir}/../com.nokia.swt.extensions/extensions/" includes="**/*.java" excludes=""/>
       
   145             <fileset dir="${plugin.dir}/../com.nokia.swt.extensions/midp/" includes="**/*.java" excludes=""/>
       
   146             <fileset dir="${plugin.dir}/Eclipse SWT/common_j2${java.edition}/" includes="**/*.properties" excludes=""/>
       
   147             <fileset dir="${plugin.dir}/Eclipse SWT/common/" includes="**/version.txt" excludes=""/>
       
   148         </copy>
       
   149     </target>
       
   150 
       
   151     <target name="gather.bin.parts" depends="init" if="destination.temp.folder">
       
   152         <mkdir dir="${destination.temp.folder}/${full.name}"/>
       
   153         <copy todir="${destination.temp.folder}/${full.name}" failonerror="true">
       
   154             <fileset dir="${plugin.dir}/bin" includes="*"/>
       
   155         </copy>
       
   156         <copy todir="${destination.temp.folder}/${full.name}">
       
   157             <fileset dir="${basedir}" includes="eswt*.dll,libeswt*.so,META-INF/"/>
       
   158         </copy>
       
   159         <chmod perm="755" dir="${destination.temp.folder}/${full.name}" includes="eswt*.dll,libeswt*.so" />
       
   160         <eclipse.versionReplacer path="${destination.temp.folder}/${full.name}" version="${version.suffix}"/>
       
   161     </target>
       
   162         
       
   163     <target name="jar.plugin" depends="init">
       
   164         <delete dir="${temp.dir}"/>
       
   165         <mkdir dir="${temp.dir}"/>
       
   166         <antcall target="build.jar"/>
       
   167         <antcall target="gather.bin.parts">
       
   168             <param name="destination.temp.folder" value="${temp.dir}/"/>
       
   169         </antcall>
       
   170         <jar jarfile="${plugin.destination}/${full.name}.jar" 
       
   171                 basedir="${temp.dir}/${full.name}" filesonly="true"/>
       
   172         <delete dir="${temp.dir}"/>
       
   173     </target>
       
   174         
       
   175     <target name="zip.plugin" depends="init">
       
   176         <delete dir="${temp.dir}"/>
       
   177         <mkdir dir="${temp.dir}"/>
       
   178         <antcall target="build.jar"/>
       
   179         <antcall target="src.zip"/>
       
   180         <antcall target="gather.bin.parts">
       
   181             <param name="destination.temp.folder" value="${temp.dir}/"/>
       
   182         </antcall>
       
   183         <antcall target="gather.sources">
       
   184             <param name="destination.temp.folder" value="${temp.dir}/"/>
       
   185         </antcall>
       
   186         <zip zipfile="${plugin.destination}/${full.name}.zip" 
       
   187                 basedir="${temp.dir}" filesonly="true"/>
       
   188         <delete dir="${temp.dir}"/>
       
   189     </target>
       
   190 
       
   191     <target name="build">        
       
   192         <antcall target="export.jar"/>
       
   193         <antcall target="export.lib"/>
       
   194     </target>
       
   195         
       
   196     <target name="build.jar" depends="init,localization" description="Produces eswt-qt.jar">
       
   197         <mkdir dir="${plugin.dir}/bin"/>
       
   198         <javac destdir="${plugin.dir}/bin" source="${javac.source}" target="${javac.target}"
       
   199             debug="${javac.debug}" debuglevel="lines,vars,source" verbose="true" failonerror="true"
       
   200             fork="true" includeAntRuntime="false" includeJavaRuntime="false">
       
   201             <src path="${plugin.dir}/Eclipse SWT/common/"/>
       
   202             <src path="${plugin.dir}/Eclipse SWT/common_j2${java.edition}/"/>
       
   203             <src path="${plugin.dir}/Eclipse SWT/qt/"/>
       
   204             <src path="${plugin.dir}/Eclipse SWT Browser/common/"/>
       
   205             <src path="${plugin.dir}/Eclipse SWT Browser/qt/"/>
       
   206             <src path="${plugin.dir}/Eclipse SWT Drag and Drop/qt/"/>
       
   207             <src path="${plugin.dir}/Eclipse_SWT_PI/common_j2${java.edition}/"/>
       
   208             <src path="${plugin.dir}/Eclipse_SWT_PI/qt/"/>
       
   209             <src path="${plugin.dir}/Eclipse_SWT_PI/s60/"/>
       
   210             <src path="${plugin.dir}/../com.nokia.swt.extensions/extensions/"/>
       
   211             <src path="${plugin.dir}/../com.nokia.swt.extensions/midp_symbian/" />
       
   212             <bootclasspath refid="javac.bootclasspath"/>
       
   213             <classpath>
       
   214                 <pathelement path="${epoc.root}epoc32\BUILD\java\javabuild\javautils\winscw\debug\classes\collection"/>
       
   215                 <pathelement location="${epoc.root}epoc32\release\armv5\urel\java_signature_test.jar"/>
       
   216                 <pathelement location="${plugin.dir}/../com.nokia.swt.extensions/extra_jars/cdc-compilation-support.jar"/>
       
   217             </classpath>
       
   218         </javac>
       
   219         <jar jarfile="${build.result.dir}/${jar.filename}" basedir="${plugin.dir}/bin" includes="**/*.class"/>
       
   220     </target>
       
   221 
       
   222     <target name="build.debug">
       
   223         <antcall target="export.jar.debug"/>
       
   224         <antcall target="export.lib.debug"/>
       
   225     </target>
       
   226 
       
   227     <target name="build.release">
       
   228         <antcall target="export.jar.release"/>
       
   229         <antcall target="export.lib.release"/>
       
   230     </target>
       
   231 
       
   232     <target name="build.lib">
       
   233         <antcall target="build.lib.debug"/>
       
   234         <antcall target="build.lib.release"/>
       
   235     </target>
       
   236 
       
   237     <target name="build.lib.debug" depends="init">
       
   238         <antcall target="build.lib.common">
       
   239             <param name="build.lib.common.config" value="debug"/>
       
   240         </antcall>
       
   241     </target>
       
   242 
       
   243     <target name="build.lib.release" depends="init">
       
   244         <antcall target="build.lib.common">
       
   245             <param name="build.lib.common.config" value="release"/>
       
   246         </antcall>
       
   247     </target>
       
   248 
       
   249     <target name="build.lib.common" depends="init" description="params: config">
       
   250         <javah destdir="${lib.path}/${generated.native.dir}/" classpath="${plugin.dir}/bin" verbose="yes">
       
   251             <class name="org.eclipse.swt.internal.qt.OS"/>
       
   252             <class name="org.eclipse.swt.internal.qt.graphics.OS"/>
       
   253             <class name="org.eclipse.swt.internal.qt.s60.OS"/>
       
   254             <class name="org.eclipse.swt.internal.extension.OS"/>
       
   255         </javah>
       
   256  
       
   257         <!-- check  if symexports needs to be called  by checking if the either os.h and gfxos.h is never than jni_lookup-cpp  -->
       
   258         <uptodate property="symexports.notRequired" targetfile="${lib.path}/${generated.native.dir}/jni_lookup.cpp" 
       
   259 			srcfile="${lib.path}/${generated.native.dir}/org_eclipse_swt_internal_qt_OS.h" />
       
   260         <antcall target="symexports" />
       
   261                 
       
   262         <antcall target="qmake">
       
   263             <param name="qmake.dir" value="${lib.path}"/>
       
   264             <param name="qmake.target" value="${build.lib.common.config}"/>
       
   265             <param name="qmake.spec" value="${lib.spec}"/>
       
   266             <param name="qmake.file" value="${lib.makefile}"/>
       
   267         </antcall>
       
   268         <exec executable="cmd" dir="${lib.path}" failonerror="true">
       
   269             <arg value="/c"/>
       
   270             <arg value="bldmake bldfiles"/>
       
   271         </exec>
       
   272         <antcall target="abld">
       
   273             <param name="abld.dir" value="${lib.path}"/>
       
   274             <param name="abld.command" value="build"/>
       
   275             <param name="abld.platform" value="armv5"/>
       
   276             <param name="abld.config" value="${build.lib.common.config}"/>
       
   277         </antcall>
       
   278         <mkdir dir="${build.result.dir}/${build.lib.common.config}/"/>
       
   279         <!-- On S60 the libs are generated directly into the export path -->
       
   280         <condition property="build.lib.common.export.path" value="${export.lib.debug.path}" else="${export.lib.release.path}">
       
   281             <equals arg1="${build.lib.common.config}" arg2="debug"/>
       
   282         </condition>
       
   283         <copy file="${build.lib.common.export.path}/${lib.filename}" 
       
   284             tofile="${build.result.dir}/${build.lib.common.config}/${lib.filename}" overwrite="true" verbose="true"/>
       
   285     </target>
       
   286         
       
   287         <target name="symexports" unless="symexports.notRequired">
       
   288             <echo message="Calling symexports to generate jni_lookup.cpp"></echo>
       
   289             <exec executable="${epoc.root}epoc32\tools\symexports" dir="${lib.path}/${generated.native.dir}" failonerror="true">
       
   290                 <arg line="-h:./org_eclipse_swt_internal_qt_OS.h" />
       
   291                 <arg line="-h:./org_eclipse_swt_internal_qt_graphics_OS.h" />
       
   292                 <arg line="-h:./org_eclipse_swt_internal_qt_s60_OS.h" />
       
   293                 <arg value="-out:./jni_lookup.cpp"/>
       
   294             </exec>
       
   295         </target>
       
   296         
       
   297     <target name="clean">
       
   298         <antcall target="clean.jar"/>
       
   299         <antcall target="clean.lib"/>
       
   300     </target>
       
   301         
       
   302     <target name="clean.jar" depends="init" description="">
       
   303         <delete dir="${plugin.dir}/bin"/>
       
   304         <delete file="${build.result.dir}/${jar.filename}" verbose="true"/>
       
   305         <delete file="${export.jar.debug.path}/${jar.filename}" verbose="true"/>
       
   306         <delete file="${export.jar.release.path}/${jar.filename}" verbose="true"/>
       
   307     </target>
       
   308 
       
   309     <target name="clean.lib">
       
   310         <antcall target="clean.lib.debug"/>
       
   311         <antcall target="clean.lib.release"/>
       
   312     </target>
       
   313 
       
   314     <target name="clean.lib.debug" depends="init">
       
   315         <antcall target="clean.lib.common">
       
   316             <param name="clean.lib.common.config" value="debug"/>
       
   317         </antcall>
       
   318     </target>
       
   319 
       
   320     <target name="clean.lib.release" depends="init">
       
   321         <antcall target="clean.lib.common">
       
   322             <param name="clean.lib.common.config" value="release"/>
       
   323         </antcall>
       
   324     </target>
       
   325 
       
   326     <target name="clean.lib.common" depends="init" description="params: config">
       
   327         <antcall target="qmake">
       
   328             <param name="qmake.dir" value="${lib.path}"/>
       
   329             <param name="qmake.target" value="${clean.lib.common.config}"/>
       
   330             <param name="qmake.spec" value="${lib.spec}"/>
       
   331             <param name="qmake.file" value="${lib.makefile}"/>
       
   332         </antcall>
       
   333         <exec executable="cmd" dir="${lib.path}" failonerror="true">
       
   334             <arg value="/c"/>
       
   335             <arg value="bldmake bldfiles"/>
       
   336         </exec>
       
   337         <antcall target="abld">
       
   338             <param name="abld.dir" value="${lib.path}"/>
       
   339             <param name="abld.command" value="reallyclean"/>
       
   340             <param name="abld.platform" value="armv5"/>
       
   341             <param name="abld.config" value="${clean.lib.common.config}"/>
       
   342         </antcall>
       
   343 	<delete dir="${lib.path}/${generated.native.dir}" verbose="true"/>
       
   344         <delete file="${build.result.dir}/${clean.lib.common.config}/${lib.filename}" verbose="true"/>
       
   345         <condition property="clean.lib.common.export.path" value="${export.lib.debug.path}" else="${export.lib.release.path}">
       
   346             <equals arg1="${clean.lib.common.config}" arg2="debug"/>
       
   347         </condition>
       
   348         <delete file="${clean.lib.common.export.path}/${lib.filename}" verbose="true"/>
       
   349         <delete dir="${lib.path}/${clean.lib.common.config}" verbose="true"/>
       
   350     </target>
       
   351 
       
   352     <target name="export">
       
   353         <antcall target="export.jar"/>
       
   354         <antcall target="export.lib"/>
       
   355     </target>
       
   356 
       
   357     <target name="export.debug">
       
   358         <antcall target="export.jar.debug"/>
       
   359         <antcall target="export.lib.debug"/>
       
   360     </target>
       
   361 
       
   362     <target name="export.release">
       
   363         <antcall target="export.jar.release"/>
       
   364         <antcall target="export.lib.release"/>
       
   365     </target>
       
   366 
       
   367         <target name="export.jar">
       
   368                 <antcall target="export.jar.debug"/>
       
   369                 <antcall target="export.jar.release"/>
       
   370         </target>
       
   371 
       
   372         <target name="export.jar.debug" depends="build.jar" if="export.jar.debug.path">
       
   373                 <mkdir dir="${export.jar.debug.path}"/>
       
   374                 <copy file="${build.result.dir}/${jar.filename}" 
       
   375             tofile="${export.jar.debug.path}/${jar.filename}" overwrite="true" verbose="true"/>
       
   376                 <copy file="${odc.location}/eswt.odc" 
       
   377             tofile="${export.jar.debug.path}/eswt.odc" overwrite="true" verbose="true"/>
       
   378         </target>
       
   379 
       
   380         <target name="export.jar.release" depends="build.jar" if="export.jar.release.path">
       
   381                 <mkdir dir="${export.jar.release.path}"/>
       
   382                 <copy file="${build.result.dir}/${jar.filename}"
       
   383             tofile="${export.jar.release.path}/${jar.filename}" overwrite="true" verbose="true"/>
       
   384                 <copy file="${odc.location}/eswt.odc" 
       
   385             tofile="${export.jar.release.path}/eswt.odc" overwrite="true" verbose="true"/>
       
   386         </target>
       
   387 
       
   388     <target name="export.lib">
       
   389         <antcall target="export.lib.debug"/>
       
   390         <antcall target="export.lib.release"/>
       
   391     </target>
       
   392 
       
   393     <target name="export.lib.debug" depends="build.lib.debug" if="export.lib.debug.path">
       
   394         <!-- Nothing to do. On S60 libs are exported automatically -->
       
   395     </target>
       
   396 
       
   397     <target name="export.lib.release" depends="build.lib.release" if="export.lib.release.path">
       
   398         <!-- Nothing to do. On S60 libs are exported automatically -->
       
   399     </target>
       
   400 
       
   401     <target name="make" description="params: dir, file, target">
       
   402         <exec executable="make" dir="${make.dir}" failonerror="true">
       
   403             <arg line="-f ${make.file} ${make.target}"/>
       
   404         </exec>
       
   405     </target>
       
   406 
       
   407     <target name="qmake" description="params: dir, spec, target">
       
   408         <exec executable="qmake" dir="${qmake.dir}" failonerror="true">
       
   409             <arg line="-spec ${qmake.spec} -o ${qmake.file}"/>
       
   410             <arg value="CONFIG+=${qmake.target}"/>
       
   411             <arg value="DESTDIR=${qmake.target}"/>
       
   412             <arg value="OBJECTS_DIR=${qmake.target}/${qmake.spec}/build"/>
       
   413         </exec>
       
   414     </target>
       
   415 
       
   416     <target name="abld" description="params: dir, command, platform, config">
       
   417         <condition property="abld.actual.config" value="udeb" else="urel">
       
   418             <equals arg1="${abld.config}" arg2="debug"/>
       
   419         </condition>
       
   420         <exec executable="cmd" dir="${abld.dir}" failonerror="true">
       
   421             <arg line="/c abld ${abld.command} ${abld.platform} ${abld.actual.config}"/>
       
   422         </exec>
       
   423 
       
   424     </target>
       
   425 
       
   426     <target name="build.tests" depends="init,build.release">
       
   427         <mkdir dir="${tests.utils.dir}/java/bin"/>
       
   428         <mkdir dir="${tests.junit.dir}/bin"/>
       
   429         <mkdir dir="${tests.mt.dir}/bin"/>
       
   430         
       
   431         <!-- build s60uitestutils -->
       
   432         <javac destdir="${tests.utils.dir}/java/bin" source="${javac.source}" target="${javac.target}" 
       
   433                 debug="${javac.debug}" debuglevel="lines,vars,source" verbose="true" failonerror="true">
       
   434                 <src path="${tests.utils.dir}/java/src/"/>
       
   435             <classpath>
       
   436                 <pathelement path="${plugin.dir}/bin/"/>
       
   437             </classpath>
       
   438         </javac>
       
   439         <jar jarfile="${build.result.dir}/s60uitestutils.jar">
       
   440                 <fileset dir="${tests.utils.dir}/java/bin"/>
       
   441         </jar>
       
   442         <copy file="${build.result.dir}/s60uitestutils.jar" todir="${test.jar.dir}"/>
       
   443         
       
   444         <javah outputfile="../s60utils/inc/s60utils.h" classpath="${tests.utils.dir}/java/bin" verbose="yes">
       
   445             <class name="com.nokia.mj.impl.uitestutils.S60Utils"/>
       
   446         </javah>
       
   447         <exec executable="${epoc.root}epoc32\tools\symexports" dir="${tests.utils.dir}/group" failonerror="true">
       
   448             <arg line="-h:../inc/s60utils.h" />
       
   449             <arg value="-out:../src/jni_lookup.cpp"/>
       
   450         </exec>
       
   451         <exec executable="cmd" dir="${tests.utils.dir}/group" failonerror="true">
       
   452             <arg value="/c"/>
       
   453             <arg value="bldmake bldfiles"/>
       
   454         </exec>
       
   455         <antcall target="abld">
       
   456             <param name="abld.dir" value="${tests.utils.dir}/group"/>
       
   457             <param name="abld.command" value="build"/>
       
   458             <param name="abld.platform" value="armv5"/>
       
   459         </antcall>
       
   460 
       
   461         <!-- build JUnit tests -->
       
   462         <javac destdir="${tests.junit.dir}/bin" source="${javac.source}" target="${javac.target}" 
       
   463                 debug="${javac.debug}" debuglevel="lines,vars,source" verbose="true" failonerror="true">
       
   464             <src path="${tests.junit.dir}/org.eclipse.ercp.swt.core.tests/src/"/>
       
   465             <src path="${tests.junit.dir}/org.eclipse.ercp.swt.expanded.tests/src/"/>
       
   466             <src path="${tests.junit.dir}/org.eclipse.ercp.swt.mobile.tests.tck/src/"/>
       
   467             <src path="${tests.junit.dir}/org.eclipse.ercp.swt.core.tests.qt/src/"/>
       
   468             <src path="${tests.junit.dir}/org.eclipse.ercp.swt.mobile.tests.qt/src/"/>
       
   469             <src path="${tests.junit.dir}/org.eclipse.ercp.swt.expanded.tests.qt/src/"/>
       
   470             <exclude name="**/Test_com_ibm_ugl_UGLCompatibility.java"/>
       
   471             <classpath>
       
   472                 <pathelement location="${tests.mt.dir}/junit-3.8.1.1.jar"/>
       
   473                 <pathelement path="${plugin.dir}/bin/"/>
       
   474             </classpath>
       
   475         </javac>        
       
   476         
       
   477         <!-- build MT tests -->
       
   478         <javac destdir="${tests.mt.dir}/bin" source="${javac.source}" target="${javac.target}" 
       
   479                 debug="${javac.debug}" debuglevel="lines,vars,source" verbose="true" failonerror="true">
       
   480                 <src path="${tests.mt.dir}/src/"/>
       
   481                 <src path="${tests.mt.dir}/src_j2me/"/>
       
   482             <classpath>
       
   483                 <pathelement location="${tests.mt.dir}/junit-3.8.1.1.jar"/>
       
   484                 <pathelement path="${plugin.dir}/bin/"/>
       
   485                 <pathelement path="${tests.junit.dir}/bin/"/>
       
   486                 <pathelement path="${tests.utils.dir}/java/bin/"/>
       
   487                 <pathelement location="${epoc.debug.dir}/java_impl_cldc.jar"/>
       
   488             </classpath>
       
   489         </javac>
       
   490         <jar jarfile="${build.result.dir}/eswt-qt-tests.jar" excludes="**/*.java">
       
   491                 <fileset dir="${tests.junit.dir}/bin"/>
       
   492                 
       
   493                 <!-- JUnit test resources are in the source folders -->
       
   494                 <fileset dir="${tests.junit.dir}/org.eclipse.ercp.swt.core.tests/src"/> 
       
   495                 <fileset dir="${tests.junit.dir}/org.eclipse.ercp.swt.core.tests.qt/src"/> 
       
   496                 <fileset dir="${tests.junit.dir}/org.eclipse.ercp.swt.expanded.tests/src"/> 
       
   497                 <fileset dir="${tests.junit.dir}/org.eclipse.ercp.swt.mobile.tests.qt/src"/> 
       
   498                 <fileset dir="${tests.junit.dir}/org.eclipse.ercp.swt.mobile.tests.tck/src"/> 
       
   499                 
       
   500                 <fileset dir="${tests.mt.dir}/bin"/>
       
   501                 <fileset dir="${tests.mt.dir}/res"/>
       
   502         </jar>
       
   503         <copy file="${tests.mt.dir}/junit-3.8.1.1.jar" todir="${test.jar.dir}"/>
       
   504         <copy file="${build.result.dir}/eswt-qt-tests.jar" todir="${test.jar.dir}"/>
       
   505     </target>
       
   506         
       
   507     <target name="clean.tests" depends="init">
       
   508         <delete dir="${tests.utils.dir}/java/bin"/>
       
   509         <delete dir="${tests.utils.dir}/native/release"/>
       
   510         <delete dir="${tests.utils.dir}/native/debug"/>
       
   511         <delete dir="${tests.junit.dir}/bin"/>
       
   512         <delete dir="${tests.mt.dir}/bin"/>
       
   513         <delete file="${build.result.dir}/eswt-qt-tests.jar" verbose="true"/>
       
   514         <delete file="${build.result.dir}/s60uitestutils.jar" verbose="true"/>
       
   515         <delete file="${build.result.dir}/release/libxlibevents.so" verbose="true"/>
       
   516         <delete file="${build.result.dir}/debug/libxlibevents.so" verbose="true"/>
       
   517         <delete file="${epoc.release.dir}/s60uitestutils.dll" verbose="true"/>
       
   518         <delete file="${epoc.release.dir}/s60uitestutils.lib" verbose="true"/>
       
   519         <delete file="${epoc.debug.dir}/s60uitestutils.dll" verbose="true"/>
       
   520         <delete file="${epoc.debug.dir}/s60uitestutils.lib" verbose="true"/>
       
   521     </target>
       
   522     
       
   523     <target name="run.tests" depends="init,build.tests">
       
   524         <mkdir dir="${build.result.dir}/testresults"/>
       
   525         <junit printsummary="yes" fork="yes">
       
   526                 <test name="com.nokia.eswt.mt.AllTests"/>
       
   527                 <formatter type="xml" usefile="yes"/>
       
   528             <classpath>
       
   529                 <pathelement location="${tests.mt.dir}/junit-3.8.1.1.jar"/>
       
   530                 <pathelement location="${build.result.dir}/eswt-qt.jar"/>
       
   531                 <pathelement location="${build.result.dir}/eswt-qt-tests.jar"/>
       
   532                 <pathelement path="${java.class.path}"/>
       
   533             </classpath>
       
   534                 <sysproperty key="java.library.path" value="${build.result.dir}/release"/>
       
   535         </junit>
       
   536         <junitreport todir="${build.result.dir}/testresults">
       
   537                 <fileset dir="${build.result.dir}">
       
   538                         <include name="TEST-*.xml" />
       
   539                 </fileset>
       
   540                 <report todir="${build.result.dir}/testresults"/>
       
   541         </junitreport>
       
   542     </target>
       
   543 
       
   544     <target name="make.sis" depends="init">
       
   545         <exec executable="make" dir="${java.src.root}/build/sis" failonerror="false">
       
   546             <arg line="UI=QT"/>
       
   547         </exec>
       
   548     </target>
       
   549 
       
   550 		<!-- Localization process -->
       
   551 	<target name="localization" depends="init">
       
   552  			<zip destfile="${omj.loc.dir}/${loc.qt.jar}" update="true" filesonly="true">
       
   553       		<zipfileset dir="../loc" prefix="resources/com/nokia/mj/impl"
       
   554                  includes="eswtcore.loc,eswtmobile.loc" />
       
   555     	</zip>
       
   556 			<copy file="${omj.loc.dir}/${loc.qt.jar}"  tofile="${jar.dir}/${loc.jar}" />
       
   557 	</target>    			
       
   558 	
       
   559 </project>
       
   560