On 11/05/10 12:09 PM, ck1125 wrote:
Hi Adam,
I am now able to create a root project, thanks.
I am unable to create a task or get the project to create tasks as all
attempts to use project.tasks.add or project.defaultTasks.add has been
rebuffed?
How does it fail? With an exception?
Are there any basic samples where I can of doing this as no
example I have seen in git seems to help.
I've just added ProjectBuilder to head. This allows you to create
project instances for testing purposes. The javadoc is at:
http://gradle.org/latest/docs/javadoc/org/gradle/testfixtures/ProjectBuilder.html.
It's intentionally very simple at the moment.
To use it, you don't need to set gradle.home, or include $gradleHome/lib
in your classpath, or any of that. Just add a dependency on Gradle API
and you're ready to write tests:
dependencies {
compile gradleApi()
}
There's a sample included in the distribution, in
$gradleHome/samples/customPlugin. And there's some user guide coverage
in the custom tasks chapter. It works the same way for custom tasks and
custom plugins. See
http://gradle.org/latest/docs/userguide/custom_tasks.html#N14035
Note that this stuff will only work with the latest head, so if you're
using 0.8, you're stuck with using GradleLauncher.
Thanks
E
ck1125 wrote:
I'll give it a go. I had already started doing that but thought I was
missing something, seeing as it seemed to need all gradle dependencies and
needed gradle.home.
Will let you know how I get on.
Jim, thanks for you response as well.
E
--
Adam Murdoch
Gradle Developer
http://www.gradle.org
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email