javacommons/utils/tsrc/localisation/build/build.xml
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 27 Apr 2010 16:30:29 +0300
branchRCL_3
changeset 19 04becd199f91
child 67 63b81d807542
permissions -rw-r--r--
Revision: v2.1.22 Kit: 201017

<!--
#
# Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
# All rights reserved.
# This component and the accompanying materials are made available
# under the terms of "Eclipse Public License v1.0"
# which accompanies this distribution, and is available
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
#
# Initial Contributors:
# Nokia Corporation - initial contribution.
#
# Contributors:
#
# Description: 
#
-->

<project name="LocalisationTest" basedir="." default="deploy">
    <description>
        Localisation Test MIDlet
    </description>

  <import file="../../../../../build/utilities.xml"/>

  <property environment="env"/>
  <property name="java.src.root" location="${env.JAVA_SRC_ROOT}"/>
  <property name="java.bin.root" location="${env.JAVA_BIN_ROOT}"/>

  <property name="src.dir" location="../javasrc"/>
  <property name="build.dir" location="."/>
  <property name="classes.dir" location="${build.dir}/javabuild"/>
  <property name="loc.dir" location="../loc"/>
  <property name="tests.jar.filename" value="${ant.project.name}.jar"/>
  <property name="junit.jar.dir" location="${java.src.root}/tools/junit"/>
  <property name="junit.jar.filename" value="j2meunit1.1.1.jar"/>
  <property name="junit.omj.jar.filename" value="j2meunitomj.jar"/>

  <property name="bootclasspath.cdc" location="${java.src.root}/javaruntime/jvm/ibm/j9_23/ibmdelivery/resource/lib/jclCdc11/classes.zip"/>

  <property name="javac.source" value="1.3"/>
  <property name="javac.target" value="1.3"/>

  <target name="init.my.properties" depends="init.properties">
    <property name="dist" location="${vm.extension.directory}"/>
  </target>
  
  <target name="clean" depends="init.my.properties">
    <delete dir="${classes.dir}"/>
    <delete file="${dist}/${tests.jar.filename}"/>
    <delete file="${dist}/${junit.jar.filename}"/>
    <delete file="${dist}/${junit.omj.jar.filename}"/>
  </target>

  <target name="init" depends="init.my.properties">
    <property name="dist" location="${vm.extension.directory}"/>
  </target>

  <target name="compile" depends="init">
    <delete dir="${classes.dir}"/>
    <mkdir dir="${classes.dir}"/>
    <javac source="${javac.source}" target="${javac.target}"
           destdir="${classes.dir}"
           bootclasspath="${bootclasspath.cdc}">
           <classpath>
               <pathelement location="${policyeditor.jar}"/>
               <pathelement location="${impl.cldc.jar}"/>
               <pathelement location="${impl.cdc.jar}"/>
               <pathelement location="${junit.jar.dir}/${junit.jar.filename}"/>
               <pathelement location="${junit.jar.dir}/${junit.omj.jar.filename}"/>
           </classpath>
      <src path="${src.dir}"/>
    </javac>
  </target>
  
  <target name="deploy" depends="compile">
      <mkdir dir="${dist}"/>
      <jar destfile="${dist}/${tests.jar.filename}">
        <fileset dir="${classes.dir}"/>
        <!-- fileset dir="${loc.dir}"/ -->
      </jar>

      <zip destfile="${dist}/${tests.jar.filename}" update="true" filesonly="true">
        <zipfileset dir="${loc.dir}" prefix="resources/com/nokia/mj/impl"/>
      </zip>


      <copy file="${junit.jar.dir}/${junit.jar.filename}"
            tofile="${dist}/${junit.jar.filename}"/>
      <copy file="${junit.jar.dir}/${junit.omj.jar.filename}"
            tofile="${dist}/${junit.omj.jar.filename}"/>
  </target>
  
  <target name="main" depends="run"/>

  <target name="run" depends="deploy">
      <echo>Running Location Tests</echo>
      <exec executable="${java.bin.root}/bin/javainstaller">
          <arg line="test -mainclass=localisationtest.LocalisationTest"/>
      </exec>
  </target>

</project>