javauis/eswt_qt/org.eclipse.swt.qt.s60.winscw/build.xml
changeset 35 85266cc22c7f
parent 26 dc7c549001d5
child 40 c6043ea9b06a
child 44 0105bdca6f9c
child 47 f40128debb5d
child 49 35baca0e7a2e
equal deleted inserted replaced
26:dc7c549001d5 35:85266cc22c7f
     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             <class name="org.eclipse.swt.internal.extension.OS"/>
       
   259         </javah>
       
   260  
       
   261         <!-- check  if symexports needs to be called  by checking if the either os.h and gfxos.h is never than jni_lookup-cpp  -->
       
   262         <uptodate property="symexports.notRequired" targetfile="${lib.path}/${generated.native.dir}/jni_lookup.cpp" 
       
   263 			srcfile="${lib.path}/${generated.native.dir}/org_eclipse_swt_internal_qt_OS.h" />
       
   264         <antcall target="symexports" />
       
   265                 
       
   266         <antcall target="qmake">
       
   267             <param name="qmake.dir" value="${lib.path}"/>
       
   268             <param name="qmake.target" value="${build.lib.common.config}"/>
       
   269             <param name="qmake.spec" value="${lib.spec}"/>
       
   270             <param name="qmake.file" value="${lib.makefile}"/>
       
   271         </antcall>
       
   272         <exec executable="cmd" dir="${lib.path}" failonerror="true">
       
   273             <arg value="/c"/>
       
   274             <arg value="bldmake bldfiles"/>
       
   275         </exec>
       
   276         <antcall target="abld">
       
   277             <param name="abld.dir" value="${lib.path}"/>
       
   278             <param name="abld.command" value="build"/>
       
   279             <param name="abld.platform" value="winscw"/>
       
   280             <param name="abld.config" value="${build.lib.common.config}"/>
       
   281         </antcall>
       
   282         <mkdir dir="${build.result.dir}/${build.lib.common.config}/"/>
       
   283         <!-- On S60 the libs are generated directly into the export path -->
       
   284         <condition property="build.lib.common.export.path" value="${export.lib.debug.path}" else="${export.lib.release.path}">
       
   285             <equals arg1="${build.lib.common.config}" arg2="debug"/>
       
   286         </condition>
       
   287         <copy file="${build.lib.common.export.path}/${lib.filename}" 
       
   288             tofile="${build.result.dir}/${build.lib.common.config}/${lib.filename}" overwrite="true" verbose="true"/>
       
   289     </target>
       
   290         
       
   291     <target name="symexports" unless="symexports.notRequired">
       
   292         <echo message="Calling symexports to generate jni_lookup.cpp"></echo>
       
   293         <exec executable="/epoc32/tools/symexports" dir="${lib.path}/${generated.native.dir}" failonerror="true">
       
   294                 <arg line="-h:./org_eclipse_swt_internal_qt_OS.h" />
       
   295                 <arg line="-h:./org_eclipse_swt_internal_qt_graphics_OS.h" />
       
   296                 <arg line="-h:./org_eclipse_swt_internal_qt_s60_OS.h" />
       
   297             <arg value="-out:./jni_lookup.cpp"/>
       
   298         </exec>
       
   299     </target>
       
   300         
       
   301     <target name="clean">
       
   302         <antcall target="clean.jar"/>
       
   303         <antcall target="clean.lib"/>
       
   304     </target>
       
   305         
       
   306     <target name="clean.jar" depends="init" description="">
       
   307         <delete dir="${plugin.dir}/bin"/>
       
   308         <delete file="${build.result.dir}/${jar.filename}" verbose="true"/>
       
   309         <delete file="${export.jar.debug.path}/${jar.filename}" verbose="true"/>
       
   310         <delete file="${export.jar.release.path}/${jar.filename}" verbose="true"/>
       
   311     </target>
       
   312 
       
   313     <target name="clean.lib">
       
   314         <antcall target="clean.lib.debug"/>
       
   315         <antcall target="clean.lib.release"/>
       
   316     </target>
       
   317 
       
   318     <target name="clean.lib.debug" depends="init">
       
   319         <antcall target="clean.lib.common">
       
   320             <param name="clean.lib.common.config" value="debug"/>
       
   321         </antcall>
       
   322     </target>
       
   323 
       
   324     <target name="clean.lib.release" depends="init">
       
   325         <antcall target="clean.lib.common">
       
   326             <param name="clean.lib.common.config" value="release"/>
       
   327         </antcall>
       
   328     </target>
       
   329 
       
   330     <target name="clean.lib.common" depends="init" description="params: config">
       
   331         <antcall target="qmake">
       
   332             <param name="qmake.dir" value="${lib.path}"/>
       
   333             <param name="qmake.target" value="${clean.lib.common.config}"/>
       
   334             <param name="qmake.spec" value="${lib.spec}"/>
       
   335             <param name="qmake.file" value="${lib.makefile}"/>
       
   336         </antcall>
       
   337         <exec executable="cmd" dir="${lib.path}" failonerror="true">
       
   338             <arg value="/c"/>
       
   339             <arg value="bldmake bldfiles"/>
       
   340         </exec>
       
   341         <antcall target="abld">
       
   342             <param name="abld.dir" value="${lib.path}"/>
       
   343             <param name="abld.command" value="reallyclean"/>
       
   344             <param name="abld.platform" value="winscw"/>
       
   345             <param name="abld.config" value="${clean.lib.common.config}"/>
       
   346         </antcall>
       
   347         <delete dir="${lib.path}/${generated.native.dir}" verbose="true"/>
       
   348         <delete file="${build.result.dir}/${clean.lib.common.config}/${lib.filename}" verbose="true"/>
       
   349         <condition property="clean.lib.common.export.path" value="${export.lib.debug.path}" else="${export.lib.release.path}">
       
   350             <equals arg1="${clean.lib.common.config}" arg2="debug"/>
       
   351         </condition>
       
   352         <delete file="${clean.lib.common.export.path}/${lib.filename}" verbose="true"/>
       
   353         <delete dir="${lib.path}/${clean.lib.common.config}" verbose="true"/>
       
   354     </target>
       
   355 
       
   356     <target name="export">
       
   357         <antcall target="export.jar"/>
       
   358         <antcall target="export.lib"/>
       
   359     </target>
       
   360 
       
   361     <target name="export.debug">
       
   362         <antcall target="export.jar.debug"/>
       
   363         <antcall target="export.lib.debug"/>
       
   364     </target>
       
   365 
       
   366     <target name="export.release">
       
   367         <antcall target="export.jar.release"/>
       
   368         <antcall target="export.lib.release"/>
       
   369     </target>
       
   370 
       
   371     <target name="export.jar">
       
   372         <antcall target="export.jar.debug"/>
       
   373         <antcall target="export.jar.release"/>
       
   374     </target>
       
   375 
       
   376     <target name="export.jar.debug" depends="build.jar" if="export.jar.debug.path">
       
   377         <mkdir dir="${export.jar.debug.path}"/>
       
   378         <copy file="${build.result.dir}/${jar.filename}" 
       
   379             tofile="${export.jar.debug.path}/${jar.filename}" overwrite="true" verbose="true"/>
       
   380         <copy file="${odc.location}/eswt.odc" 
       
   381             tofile="${export.jar.debug.path}/eswt.odc" overwrite="true" verbose="true"/>
       
   382     </target>
       
   383 
       
   384     <target name="export.jar.release" depends="build.jar" if="export.jar.release.path">
       
   385         <mkdir dir="${export.jar.release.path}"/>
       
   386         <copy file="${build.result.dir}/${jar.filename}"
       
   387             tofile="${export.jar.release.path}/${jar.filename}" overwrite="true" verbose="true"/>
       
   388         <copy file="${odc.location}/eswt.odc" 
       
   389             tofile="${export.jar.release.path}/eswt.odc" overwrite="true" verbose="true"/>        
       
   390     </target>
       
   391 
       
   392     <target name="export.lib">
       
   393         <antcall target="export.lib.debug"/>
       
   394         <antcall target="export.lib.release"/>
       
   395     </target>
       
   396 
       
   397     <target name="export.lib.debug" depends="build.lib.debug" if="export.lib.debug.path">
       
   398         <!-- Nothing to do. On S60 libs are exported automatically -->
       
   399     </target>
       
   400 
       
   401     <target name="export.lib.release" depends="build.lib.release" if="export.lib.release.path">
       
   402         <!-- Nothing to do. On S60 libs are exported automatically -->
       
   403     </target>
       
   404 
       
   405     <target name="make" description="params: dir, file, target">
       
   406         <exec executable="make" dir="${make.dir}" failonerror="true">
       
   407             <arg line="-f ${make.file} ${make.target}"/>
       
   408         </exec>
       
   409     </target>
       
   410 
       
   411     <target name="qmake" description="params: dir, spec, target">
       
   412         <exec executable="qmake" dir="${qmake.dir}" failonerror="true">
       
   413             <arg line="-spec ${qmake.spec} -o ${qmake.file}"/>
       
   414             <arg value="CONFIG+=${qmake.target}"/>
       
   415             <arg value="DESTDIR=${qmake.target}"/>
       
   416             <arg value="OBJECTS_DIR=${qmake.target}/${qmake.spec}/build"/>
       
   417         </exec>
       
   418     </target>
       
   419 
       
   420     <target name="abld" description="params: dir, command, platform, config">
       
   421         <condition property="abld.actual.config" value="udeb" else="urel">
       
   422             <equals arg1="${abld.config}" arg2="debug"/>
       
   423         </condition>
       
   424         <exec executable="cmd" dir="${abld.dir}" failonerror="true">
       
   425             <arg line="/c abld ${abld.command} ${abld.platform} ${abld.actual.config}"/>
       
   426         </exec>
       
   427 
       
   428     </target>
       
   429 
       
   430     <target name="build.tests" depends="init"> 
       
   431         <mkdir dir="${tests.utils.dir}/java/bin"/>
       
   432         <mkdir dir="${tests.junit.dir}/bin"/>
       
   433         <mkdir dir="${tests.mt.dir}/bin"/>
       
   434         
       
   435         <!-- build s60uitestutils -->
       
   436         <javac destdir="${tests.utils.dir}/java/bin" source="${javac.source}" target="${javac.target}" 
       
   437                 debug="${javac.debug}" debuglevel="lines,vars,source" verbose="true" failonerror="true">
       
   438                 <src path="${tests.utils.dir}/java/src/"/>
       
   439             <classpath>
       
   440                 <pathelement location="${epoc.debug.dir}/java_impl_cldc.jar"/>
       
   441             </classpath>
       
   442         </javac>
       
   443         <jar jarfile="${build.result.dir}/s60uitestutils.jar">
       
   444             <fileset dir="${tests.utils.dir}/java/bin"/>
       
   445         </jar>
       
   446         <copy file="${build.result.dir}/s60uitestutils.jar" todir="${test.jar.dir}"/>
       
   447         
       
   448        
       
   449        <javah outputfile="../s60utils/native/s60utils.h" classpath="${tests.utils.dir}/java/bin" verbose="yes">
       
   450           	<class name="com.nokia.mj.impl.uitestutils.S60Utils"/>
       
   451         </javah>
       
   452         
       
   453         <exec executable="python" failonerror="true">
       
   454       		<arg value="${env.JAVA_SRC_ROOT}/build/buildutils/generates60lookup.py"/>
       
   455       		<arg value="--nojxe"/>
       
   456       		<arg value="${tests.utils.dir}/native/s60utils.h"/>
       
   457       		<arg value="${tests.utils.dir}/native/jni_lookup.cpp"/>
       
   458     	</exec>
       
   459 			
       
   460         <exec executable="${qmake.dir}/qmake" dir="${tests.utils.dir}/native" failonerror="true" >
       
   461             <arg line="-spec symbian-sbsv2"/>
       
   462         </exec>
       
   463  
       
   464         <exec executable="${make.dir}/make" dir="${tests.utils.dir}/native" failonerror="true"/>
       
   465         
       
   466         <!-- build JUnit tests -->
       
   467         <javac destdir="${tests.junit.dir}/bin" source="${javac.source}" target="${javac.target}" 
       
   468                 debug="${javac.debug}" debuglevel="lines,vars,source" verbose="true" failonerror="true">
       
   469             <src path="${tests.junit.dir}/org.eclipse.ercp.swt.core.tests/src/"/>
       
   470             <src path="${tests.junit.dir}/org.eclipse.ercp.swt.expanded.tests/src/"/>
       
   471             <src path="${tests.junit.dir}/org.eclipse.ercp.swt.mobile.tests.tck/src/"/>
       
   472             <src path="${tests.junit.dir}/org.eclipse.ercp.swt.core.tests.qt/src/"/>
       
   473             <src path="${tests.junit.dir}/org.eclipse.ercp.swt.mobile.tests.qt/src/"/>
       
   474             <src path="${tests.junit.dir}/org.eclipse.ercp.swt.expanded.tests.qt/src/"/>
       
   475             <exclude name="**/Test_com_ibm_ugl_UGLCompatibility.java"/>
       
   476             <classpath>
       
   477                 <pathelement location="${tests.mt.dir}/junit-3.8.1.1.jar"/>
       
   478                 <pathelement location="${epoc.debug.dir}/java_impl_cldc.jar"/>
       
   479             </classpath>
       
   480         </javac>
       
   481         
       
   482         <!-- build MT tests -->
       
   483         <javac destdir="${tests.mt.dir}/bin" source="${javac.source}" target="${javac.target}" 
       
   484                 debug="${javac.debug}" debuglevel="lines,vars,source" verbose="true" failonerror="true">
       
   485                 <src path="${tests.mt.dir}/src/"/>
       
   486                 <src path="${tests.mt.dir}/src_j2me/"/>
       
   487                 <src path="${tests.mt.dir}/../CgfxTestRunner/src/"/>
       
   488             <classpath>
       
   489                 <pathelement location="${tests.mt.dir}/junit-3.8.1.1.jar"/>
       
   490                 <pathelement location="${epoc.debug.dir}/java_impl_cldc.jar"/>
       
   491                 <pathelement path="${tests.junit.dir}/bin/"/>
       
   492                 <pathelement path="${tests.utils.dir}/java/bin/"/>
       
   493                 <pathelement location="${epoc.debug.dir}/java_impl_cldc.jar"/>
       
   494                 <pathelement location="${env.JAVA_SRC_ROOT}/inc/classes.cldc.zip"/>
       
   495             </classpath>
       
   496         </javac>
       
   497         
       
   498         <jar jarfile="${build.result.dir}/eswt-qt-tests.jar">
       
   499                 <fileset dir="${tests.junit.dir}/bin"/>
       
   500                 
       
   501                 <!-- JUnit test resources are in the source folders -->
       
   502                 <fileset dir="${tests.junit.dir}/org.eclipse.ercp.swt.core.tests/src" excludes="**/*.java"/> 
       
   503                 <fileset dir="${tests.junit.dir}/org.eclipse.ercp.swt.core.tests.qt/src" excludes="**/*.java"/> 
       
   504                 <fileset dir="${tests.junit.dir}/org.eclipse.ercp.swt.expanded.tests/src" excludes="**/*.java"/> 
       
   505                 <fileset dir="${tests.junit.dir}/org.eclipse.ercp.swt.mobile.tests.qt/src" excludes="**/*.java"/> 
       
   506                 <fileset dir="${tests.junit.dir}/org.eclipse.ercp.swt.mobile.tests.tck/src" excludes="**/*.java"/> 
       
   507                 
       
   508                 <fileset dir="${tests.mt.dir}/bin"/>
       
   509                 <fileset dir="${tests.mt.dir}/res"/>
       
   510         </jar>
       
   511         <copy file="${tests.mt.dir}/junit-3.8.1.1.jar" todir="${test.jar.dir}"/>
       
   512         <copy file="${build.result.dir}/eswt-qt-tests.jar" todir="${test.jar.dir}"/>
       
   513         <antcall target="rename"/>
       
   514     </target>
       
   515         
       
   516     <target name="clean.tests" depends="init">
       
   517         <exec executable="make" dir="${tests.utils.dir}/native" failonerror="true">
       
   518             <arg line="clean"/>
       
   519         </exec>
       
   520         <delete dir="${tests.utils.dir}/java/bin"/>
       
   521         <delete dir="${tests.utils.dir}/native/release"/>
       
   522         <delete dir="${tests.utils.dir}/native/debug"/>
       
   523         <delete dir="${tests.junit.dir}/bin"/>
       
   524         <delete dir="${tests.mt.dir}/bin"/>
       
   525         <delete file="${build.result.dir}/eswt-qt-tests.jar" verbose="true"/>
       
   526         <delete file="${build.result.dir}/s60uitestutils.jar" verbose="true"/>
       
   527         <delete file="${build.result.dir}/release/libxlibevents.so" verbose="true"/>
       
   528         <delete file="${build.result.dir}/debug/libxlibevents.so" verbose="true"/>
       
   529         <delete file="${epoc.release.dir}/s60uitestutils.dll" verbose="true"/>
       
   530         <delete file="${epoc.release.dir}/s60uitestutils.lib" verbose="true"/>
       
   531         <delete file="${epoc.debug.dir}/s60uitestutils.dll" verbose="true"/>
       
   532         <delete file="${epoc.debug.dir}/s60uitestutils.lib" verbose="true"/>
       
   533     </target>
       
   534     
       
   535     <target name="run.tests" depends="init,build.tests">
       
   536         <mkdir dir="${build.result.dir}/testresults"/>
       
   537         <junit printsummary="yes" fork="yes">
       
   538                 <test name="com.nokia.eswt.mt.AllTests"/>
       
   539                 <formatter type="xml" usefile="yes"/>
       
   540             <classpath>
       
   541                 <pathelement location="${tests.mt.dir}/junit-3.8.1.1.jar"/>
       
   542                 <pathelement location="${build.result.dir}/eswt-qt.jar"/>
       
   543                 <pathelement location="${build.result.dir}/eswt-qt-tests.jar"/>
       
   544                 <pathelement path="${java.class.path}"/>
       
   545             </classpath>
       
   546             <sysproperty key="java.library.path" value="${build.result.dir}/release"/>
       
   547         </junit>
       
   548         <junitreport todir="${build.result.dir}/testresults">
       
   549                 <fileset dir="${build.result.dir}">
       
   550                         <include name="TEST-*.xml" />
       
   551                 </fileset>
       
   552                 <report todir="${build.result.dir}/testresults"/>
       
   553         </junitreport>
       
   554     </target>
       
   555 
       
   556     <target name="make.sis" depends="init">
       
   557         <exec executable="make" dir="${java.src.root}/build/sis" failonerror="false">
       
   558             <arg line="UI=QT"/>
       
   559         </exec>
       
   560     </target>
       
   561 
       
   562 	<!-- Localization process -->
       
   563 	<target name="localization" depends="init">
       
   564  			<zip destfile="${omj.loc.dir}/${loc.qt.jar}" update="true" filesonly="true">
       
   565       		<zipfileset dir="../loc" prefix="resources/com/nokia/mj/impl"
       
   566                  includes="eswtcore.loc,eswtmobile.loc" />
       
   567     	</zip>
       
   568 			<copy file="${omj.loc.dir}/${loc.qt.jar}"  tofile="${jar.dir}/${loc.jar}" />
       
   569 	</target>    			
       
   570 	
       
   571 	<!-- Dll rename for tests run -->
       
   572 	<target name="rename" >
       
   573 		<!-- Renames only when tests are compiling very first time or 
       
   574 		tests compiling very first time after omj recompiled -->
       
   575 		<condition property="isjavajvmargsmodifierfile">
       
   576 			<available file="${env.EPOCROOT}epoc32/release/winscw/udeb/javajvmargsmodifierfile.dll"/>
       
   577    		</condition>
       
   578   		<antcall target="rename_dll"/>
       
   579 	</target>  
       
   580 	
       
   581 	<target name="rename_dll" if="isjavajvmargsmodifierfile">
       
   582    		<condition property="isjavajvmargsmodifierdefault">
       
   583     			<available file="${env.EPOCROOT}epoc32/release/winscw/udeb/javajvmargsmodifierdefault.dll"/>
       
   584    		</condition>
       
   585    		<antcall target="rename_omjrecompiled"/>
       
   586    		<antcall target="rename_firsttime"/>
       
   587   	</target>  
       
   588   
       
   589  	 <target name="rename_omjrecompiled" if="isjavajvmargsmodifierdefault">
       
   590   		<delete file="${env.EPOCROOT}epoc32/release/winscw/udeb/javajvmargsmodifierdefault.dll" />
       
   591 		<move file="${env.EPOCROOT}epoc32/release/winscw/udeb/javajvmargsmodifier.dll"  tofile="${env.EPOCROOT}epoc32/release/winscw/udeb/javajvmargsmodifierdefault.dll" failonerror="false"/>
       
   592 		<move file="${env.EPOCROOT}epoc32/release/winscw/udeb/javajvmargsmodifierfile.dll"  tofile="${env.EPOCROOT}epoc32/release/winscw/udeb/javajvmargsmodifier.dll" failonerror="false"/>
       
   593   	</target>  
       
   594   	
       
   595  	<target name="rename_firsttime" unless="isjavajvmargsmodifierdefault">
       
   596  		<copy file="${env.EPOCROOT}epoc32/release/winscw/udeb/javajvmargsmodifier.dll" tofile="${env.EPOCROOT}epoc32/release/winscw/udeb/javajvmargsmodifier_org.dll"/>  
       
   597  		<copy file="${env.EPOCROOT}epoc32/release/winscw/udeb/javajvmargsmodifierfile.dll" tofile="${env.EPOCROOT}epoc32/release/winscw/udeb/javajvmargsmodifierfile_org.dll"/>
       
   598  		<move file="${env.EPOCROOT}epoc32/release/winscw/udeb/javajvmargsmodifier.dll"  tofile="${env.EPOCROOT}epoc32/release/winscw/udeb/javajvmargsmodifierdefault.dll" failonerror="false"/>
       
   599 		<move file="${env.EPOCROOT}epoc32/release/winscw/udeb/javajvmargsmodifierfile.dll"  tofile="${env.EPOCROOT}epoc32/release/winscw/udeb/javajvmargsmodifier.dll" failonerror="false"/>
       
   600  	</target>  
       
   601  	
       
   602 </project>