Adam is right.
I had not encountered the ant apply task before, so out of curiosity I wrote
an ant build script with the exact same test. The result was exactly the
same as running the ant task via gradle:
build.xml:
<project name="Testing" basedir=".">
<target name="ls">
<apply executable='/bin/ls'>
<arg value='-l'/>
</apply>
</target>
</project>
Execution of this script:
$ ant ls
Buildfile: C:\Source\build.xml
ls:
BUILD FAILED
C:\Source\build.xml:4: no resources specified
Total time: 0 seconds
Regards,
Steinar
On Thu, Jan 20, 2011 at 9:57 PM, Adam Murdoch <[email protected]> wrote:
>
> On 20/01/2011, at 8:44 PM, Matthias wrote:
>
> Adam Murdoch <adam@...> writes:
>
> ...
>
> Why not use the Gradle Exec task?
>
>
> hey thanks, that worked fine. But now I'm curious: what's the difference?
>
>
> One is a Gradle task, and the other is an Ant task. Generally, the Gradle
> tasks are better integrated with Gradle.
>
> For both tasks the documentation
> says "Executes a system command." Also, why did I get this error message
> when according to the docs I
> provided all required arguments?
>
>
> Again, I don't know. You'll have to ask the Ant developers why the Ant task
> behaves the way that it does.
>
> I think (but I'm not sure) that the Ant 'apply' task is intended to be used
> with one or more input files. If you want to run an arbitrary system
> command, the Ant 'exec' task might be a better option. Of course, if you're
> writing a Gradle build script, then a Gradle task is almost always a better
> option than an Ant task.
>
>
> --
> Adam Murdoch
> Gradle Developer
> http://www.gradle.org
> CTO, Gradle Inc. - Gradle Training, Support, Consulting
> http://www.gradle.biz
>
>