ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sameer Singh" <sameer.si...@openwave.com>
Subject uptodate problem
Date Sun, 26 May 2002 01:52:19 GMT
Hi,

I have the following src directory:

c:/work/mms/apps/mmsapi/src/com/openwave/mms/album/CM.java

The unit test cases are one level below in

c:/work/mms/apps/mmsapi/src/com/openwave/mms/album/test/TestCM.java


both CM.java and TestCM.java belong to package com.openwave.mms.album;



The sources are built in -->

c:/work/mms/apps/mmsapi/build  &

Rhe unit tests are built in --->

c:/work/mms/apps/mmsapi/test

To get the dependencies right, I have to compare the timestamp of

c:/work/mms/apps/mmsapi/src/com/openwave/mms/album/test/TestCM.java

to that of

c:/work/mms/apps/mmsapi/test/com/openwave/mms/album/TestCM.class
                        ^^^^                  ^^^^^^

Accordingly I use the following target:

-----------------------------------------------------------

  <target name="test-setup" depends="setup">
    <available classname="junit.framework.TestCase" property="junit.present"
/>
    <mkdir dir="test" />
	<uptodate property="test-recompile-needed">
	<srcfiles dir="src" includes="**/test/Test*.java"/>
	   <mapper type="regexp" from="^(.*)\\test\\(Test.*)\.java$$"
to="\1/\2.class"/>
	</uptodate>
  </target>

-------------------------------------------------------------

which only works partially,

\1 in the above case matches only com/openwave/mms/album and NOT
c:/work/mms/apps/mmsapi/src/com/openwave/mms/album. If it did match
the full path name then I would have been able to achieve what I'm looking
for with the following mapper:

<mapper type="regexp" from="^(.*)\\src\\(.*)\\test\\(Test.*)\.java$$"
	to="\1/test/\2/\3.class"/>


The prefix before that i.e. c:/work/mms/apps/mmsapi/src/ seems to be
"automatically" appended and so the target maps to

c:/work/mms/apps/mmsapi/src/com/openwave/mms/album/TestCM.class
                        ^^^
instead of

c:/work/mms/apps/mmsapi/test/com/openwave/mms/album/TestCM.class

which will never get created at that location and so it recompiles
everytime.

------------------------------------------------------------

I expected the "from" field to contain the entire path name, however,
this does not seem to be the case.

Does anybody have any ideas on how I can get around this (without
ofcourse changing my directory structure, package name or build
directories).

Thanks a lot.

Regards

Sameer









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


Mime
View raw message