You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Mikael Petterson (KI/EAB)" <mi...@ericsson.com> on 2004/11/30 14:41:59 UTC

Advice on major build system

Hi,

I am using ant to build our products. I am using ant 1.6.2

I have a common.xml containing the following targets:

* init
* compile
* jar 
* clean
* test:compile
* test:test

also a test-target that depends on test:setup, test:compile and test:test.


I also have  a build.properties with with common properties.

This can be used in all our products. I do the following in each specific build file:

<property file="/vobs/rbs/sw/rbssw1/boam_subsys/boam_swb/boam_bldu/ant_build/build.properties"/>

<import file="/vobs/rbs/sw/rbssw1/boam_subsys/boam_swb/boam_bldu/ant_build/common.xml"/>

Then in each specific '<product>.xml' I have two different targets:

setup and test:setup

<target name="setup">
   <echo message="using target classpath"/>
   <path id="common.classpath">
    <pathelement location="${CELLO.DIR}/${CMA.JAR}"/>
    <pathelement location="${CELLO.DIR}/${FOUNDATION.JAR}"/>
    <pathelement location="${CELLO.DIR}/${OMS.JAR}"/>
    <pathelement location="${CELLO.DIR}/${VBJORB.JAR}"/>
    <pathelement location="${CELLO.DIR}/${ASMS.JAR}"/>
   </path>
  </target>

  <target name="test:setup">
   <echo message="checking if boam.jar exists!"/>
    <ant antfile="/vobs/rbs/sw/rbssw1/boam_subsys/boam_swb/boam_bldu/ant_build/boam.xml" dir="/vobs/rbs/sw/rbssw1/boam_subsys/boam_swb/boam_bldu/ant_build" target="jar"/>
   <echo message="checking if bros.jar exists!"/>
 <ant antfile="/vobs/rbs/sw/rbssw1/boam_subsys/test_boamss/brosfro_swb/brosfro_bldu/ant_build/brosfro.xml" dir="/vobs/rbs/sw/rbssw1/boam_subsys/test_boamss/brosfro_swb/brosfro_bldu/ant_build" target="jar"/>	
   <echo message="using test classpath"/>
   <path id="test.classpath">
    <pathelement location="${BDE.DIST.DIR}/${BDE.JAR}"/>
    <pathelement location="${BOAM.DIST.DIR}/${BOAM.JAR}"/>
    <pathelement location="${JUNIT.LIB.DIR}/${JUNIT.JAR}"/>
    <pathelement location="${XALAN.LIB.DIR}/${XALAN.JAR}"/>
    <pathelement path="${java.class.path}"/>
   </path>
  </target>

Q1: When I run boam.xml with target test ( includes test:setup) I need to check that the jars for boam and brosfro is built and uptodate and exists.
      Is ant-task best to use. Or is there a smarter way?

Q2: When run <ant antfile="/vobs/rbs/sw/rbssw1/boam_subsys/test_boamss/brosfro_swb/brosfro_bldu/ant_build/brosfro.xml" dir="/vobs/rbs/sw/rbssw1/boam_subsys/test_boamss/brosfro_swb/brosfro_bldu/ant_build" target="jar"/>
      I get a complaint that test:setup does not exist in brosfro.xml! Then I add an empty test:setup-target in brosfro.xml and 
      I get no complaint. But I did call brosfro.xml with jar target. Why do I get a complaint?


Regards,

Mikael
 



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org