You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by "Jean-Louis Boudart (JIRA)" <ji...@apache.org> on 2014/11/24 20:25:12 UTC

[jira] [Commented] (EASYANT-65) Error when calling antcall task in module.ant file

    [ https://issues.apache.org/jira/browse/EASYANT-65?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14223354#comment-14223354 ] 

Jean-Louis Boudart commented on EASYANT-65:
-------------------------------------------

Hi,

I think using antcall is a bad idea, this task tries to import back the file specified via "ant.file" property (in our case module.ant) in a new context.  As this context is initiated by ant itself it can't  access to all stuff plugged by easyant.

That's why we introduced "easyant" task (see http://ant.apache.org/easyant/history/trunk/ref/anttasks/easyant.html). This task allow you to invoke a target in easyant context.

By the way, i would recommend you to prefer relying on use target dependencies mechanism instead of trying to invoke them manually.

{code:xml}
<target name="myPreTarget">
  		<echo message="Before AntCall"/>
</target>

<target name="myPostTarget">
		<echo message="After AntCall"/>
</target>

<target name="testAntCall#build" extensionOf="abstract-compile:compile-ready" depends="myPreTarget, testAntCall#target, myPostTarget"/>
{code}

> Error when calling antcall task in module.ant file
> --------------------------------------------------
>
>                 Key: EASYANT-65
>                 URL: https://issues.apache.org/jira/browse/EASYANT-65
>             Project: EasyAnt
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 0.9
>         Environment: Linux
>            Reporter: Jérôme Leroux
>            Priority: Minor
>
> An error is raised when antcall task is called within the module.ant file defined above the module.ivy file.
> A workaround is to execute the target in another ant context:
> * Extract the target that calls antcall in another ant script
> * Call this script from module.ant with ant task
> Example:
> {code:xml}
> 	<target name="testAntCall#build" extensionOf="abstract-compile:compile-ready">
> 		<echo message="Before AntCall"/>
> 		<antcall target="testAntCall#target"/>
> 		<echo message="After AntCall"/>
> 	</target>
> {code}
> Error:
> {noformat}
> testAntCall#build:
>      [echo] Before AntCall
> BUILD FAILED
> Dr Myrmex found an error when building TestJavaSimple
> * Where
> File : /home/jleroux/Documents/projects/easyant/workspace/tests/build-java/module.ant
> Line : 24 column : 41
> * Dr Myrmex diagnostic
> Error : The following error occurred while executing this line:
> Cause : Error : 
> Cause : easyant.ivy.instance is not a valid ivy instance
> {noformat}
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)