Perhaps another way to look at this is the notion of higher level
lifecycle tasks (maybe somewhat akin to what Maven calls phases). We
had talked about this many times before for stuff like docs. The
notion of building docs is a higher level concept where tasks like
jdocbook would fit in.
Applied here, compilation would be such a higher level concept as would
source-generation. In this way it would be nice if the Antlr task
could say it "is of source-generation type" or it "is part of the
source-generation phase". In the latter case, if source-generation is
implemented as a "grouping task", then all the Antlr plugin needs to do
is to add its task to the source-generation task deps.
Just a thought.
On Tue 19 Jul 2011 09:49:09 AM CDT, Hans Dockter wrote:
You are right. I haven't thought about it properly.
Thanks
Hans
--
Hans Dockter
Founder, Gradle
http://www.gradle.org, http://twitter.com/gradleware
CEO, Gradleware - Gradle Training, Support, Consulting
http://www.gradleware.com
On Mon, Jul 18, 2011 at 5:23 PM, Luke Daley <[email protected]
<mailto:[email protected]>> wrote:
On 19/07/2011, at 4:52 AM, Hans Dockter wrote:
> At the moment if you need to generate sources, you typically
create a dependencies between the compile task of the java source
set and the task that generates the sources. Our antlr plugin does
the same. It is a very common use case in the enterprise. I think a
SourceSet functionality like we have for generate resources would be
a much nicer solution.
>
> Thoughts?
I think source generation is slightly different in that it's likely
to be more complex. I am also not sure what benefit it would have over…
sourceSets {
main {
srcDir someGenerationTask.outputs.files
}
}
I have to admit that I don't know how this plays with directories vs
files. That is, how the output of a task needs to be structured to
spit out a root “srcDir”.
--
Luke Daley
Principal Engineer, Gradleware
http://gradleware.com
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
--
[email protected]
http://hibernate.org
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email