ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rebhan, Gilbert" <Gilbert.Reb...@huk-coburg.de>
Subject solved / was [antcontrib] foreach problem
Date Wed, 08 Jun 2005 09:22:59 GMT

Hi,

for anyone else running into that gotcha , here's the solution =

The targetdependency in my buildscript was guilty for that strange
behaviour.

I had :

<project name="bla" default="build" basedir=".">

build as defaulttarget had the dependency -> depends="init,checkout"

where 

target init = brings the <foreach> into the script

target checkout = the target called by <foreach>

now i have :

<project name="bla" default="init" basedir=".">

switching the default target to the target containing the <foreach> part
did it.

Now it works like a charm :)

If default target ain't the target that contains <foreach> the target
called
by <foreach> is called one time to often with propertys not set.

Gilbert
 

-----Original Message-----
From: Rebhan, Gilbert [mailto:Gilbert.Rebhan@huk-coburg.de] 
Sent: Wednesday, June 08, 2005 10:14 AM
To: user@ant.apache.org
Subject: [antcontrib] foreach problem


Hi,

i have some strange behaviour with antcontrib's foreach task.

I have a propertyfile like this :

modul.1=Project1:v_1_2_4_25
modul.2=Project with spaces:thi_1_2_4_25

modul.list=${modul.1},${modul.2},


My buildscript :

<target name="init">

<foreach list="${modul.list}"
	delimiter=","
	param="modul"
	target="checkout"
	trim="true"
	inheritall="true" />
	</target>

<target name="checkout">

<!-- Modulname -->
	<propertyregex property="module"
		         	 input="${modul}"
		             regexp="(.*):(.*)"
		             select="\1"
		             casesensitive="false" />

<!-- Versiontag -->
	<propertyregex property="tag"
		               input="${modul}"
		               regexp="(.*):(.*)"
		               select="\2"
		               casesensitive="false" />


	<!--<cvs cvsroot="${cvsroot}"
	     dest="../.."
	     package="'${module}'"
	     tag="${tag}"
	     command="checkout" />-->

	<!-- for testing -->
	<echo>Modul = ${module} in Version = ${tag}</echo>


gives me =


checkout:
     [echo] Modul = Project1 in Version = v_1_2_4_25
checkout:
     [echo] Modul = Project with space in Version = v_1_2_4_25
checkout:
     [echo] Modul = ${module} in Version = ${tag}


Question :

where comes the third line from ?! How to get rid of that ?

Thanks for any advice !!

Gilbert

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


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


Mime
View raw message