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