On Jan 30, 2009, at 11:37 AM, Adam Murdoch wrote:
Peter Niederwieser wrote:
Adam Murdoch-2 wrote:
Yes. Any method declared in a script is made available as a method
on
the corresponding Project object.
OK, so given a multi-project build with sub-projects A and B, I can
call
from A's build.gradle into B's build.gradle. But what I'd like to
do is to
call from A's build.gradle into B.jar (the artifact generated by B).
According to my understanding, A's build.gradle cannot have a
configuration-time dependency on B.jar because Gradle first
configures all
projects and only then executes them. But how about an execution-time
dependency?
Ah, I misunderstood your question.
There isn't a supported way to have a project's build depend on the
artifacts of another projects. You could, however, do something ugly
like have a task add the jars to the project classloader and use the
classes as dynamic objects.
Alternatively, you could move the classes to the buildSrc project.
It might be interesting if we were to generalise the buildSrc
concept a bit, so that a project can declare an execution time
dependency on another project, where before any task of the
dependent project is executed, the other project is built and its
classes added to the dependent project's classloader.
Allan Lewis also requested something like this (for Gradle 0.1): See
http://markmail.org/thread/6ncjp7dxtbq5et5f
It is an interesting use case and I finally would love to provide a
solution for this. BuildSrc is not flexible enough for this. What I
think would be cool are special kind of projects which provide
artifacts at configuration time to a build. I guess this would also
solve Peter's issue.
- Hans
--
Hans Dockter
Gradle Project lead
http://www.gradle.org
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email