ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chad Armstrong <chad.armstr...@gmail.com>
Subject Re: antcall with antcontrib's RemoteAnt?
Date Tue, 12 Jul 2005 20:02:27 GMT
Ok, I think I figured this out myself. I can replace all antcall's
with macrodef's like the following (assumes antcontrib installed):
----------------------------------------
..
<antcall target="doTask" />
..
<target name="doTask" if="WINDOWS">
..
</target>
..
----- would translate to --------
..
<doTask platform="WINDOWS" />
..
<macrodef name="doTask">
  <attribute name="platform" />
  <sequential>
  <if>
    <isset property="@{platform}" />
  <then>
..
  </then>
  </if>
  </sequential>
</macrodef> 

--------------------------------------
similarly, UNLESS would be accomplished the following way:
--------------------------------------
..
<target name="doTask" if="WINDOWS" unless="fileExistsAlready">
..

--changes to--
..
<doTask platform="WINDOWS" fileExistsAlready="fileExistsBoolean" />
..
<macrodef name="doTask">
    <attribute name="platform" />
    <attribute name="fileExistsAlready" />
    <sequential>
    <if>
	<and>
          <isset property="@{platform}" />
	<not>
          <isset property="@{fileExistsAlready}" />
	</not>
	</and>
    <then>
..
    </then>
    </if>
    </sequential>
</macrodef>

Chad

On 7/12/05, Chad Armstrong <chad.armstrong@gmail.com> wrote:
> Hello,
>   I've gotten some help from this list in setting up antcontrib's
> RemoteAnt task, and have it mostly working (for which I am greatly
> indebted.) Now, however, I'm up against another issue.
> 
>   I have a build script on an XP box that kicks off (using RemoteAnt)
> a build file on a Linux box. But the Linux build file script (the
> 'subprocess' of the Windows build script) fails whenever it hits an
> [antcall] tag.
> 
>   Is there some limitation there that I don't know about? I was
> thinking of replacing the [antcall] tags with [macrodef], but the
> current [antcall] targets are conditional on other variables defined
> in my script, and [macrodefs] don't take the [if] attribute.
> 
> thanks for any help
> Chad
>

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


Mime
View raw message