ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: passing a classpath back to the parent?
Date Fri, 21 Jun 2002 14:52:35 GMT
Oops, didn't realize that

--- a.xml ---
<target name="a">
  ...
  <path id="classpath-out">
    <pathelement path="${classpath-out.propertyname}" />
  </path>
</target>

should be:

--- a.xml ---
<target name="a">
  ...
  <path id="classpath-out">
    <pathelement path="${${classpath-out.propertyname}}" />
  </path>
</target>

Which is impossible ;-)

Two solutions:

1) Hard-code the property name to use.
2) Use ant-contrib's <propertycopy> task.

--DD

-----Original Message-----
From: Dominique Devienne [mailto:DDevienne@lgc.com] 
Sent: Friday, June 21, 2002 9:48 AM
To: 'Ant Users List'
Subject: RE: passing a classpath back to the parent?

No, not directly. The only known way to achieve this (that I know off at
least) is to write out the classpath from b.xml into a properties file,
which is read back in a.xml after it executed b.xml's target. It's not
pretty, but it works.

--- a.xml ---
<target name="a">
  <property name="classpath-out.propertyname" value="..." />
  <property name="classpath-out.propertiesfile" location="..." />

  <ant antfile="b.xml" target="b" inheritAll="true" />

  <property file="${classpath-out.propertiesfile} />
  <path id="classpath-out">
    <pathelement path="${classpath-out.propertyname}" />
  </path>
</target>

--- b.xml ---
<target name="b">
  <path id="classpath-out">
    ...
  </path>
  <property name="classpath-out" refid="classpath-out" />

  <propertyfile file="${classpath-out.propertiesfile}">
    <entry key="${classpath-out.propertyname}" value="${classpath-out}" />
  </propertyfile>
</target>

Not tested, but it should work. --DD

-----Original Message-----
From: lxjfswxuyw001@sneakemail.com [mailto:lxjfswxuyw001@sneakemail.com] 
Sent: Thursday, June 20, 2002 10:23 PM
To: ant-user@jakarta.apache.org
Subject: passing a classpath back to the parent?

Hi all,

I hope this doesn't seem too dumb a question:

I'm having a project a.xml with a target "compile" that calls another
compile target in b.xml. I would need a way to pass the classpath set in
b.xml back to a.xml. 

Is there a way to do that?

Thanks,

Thanh Long

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

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

--
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