You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@buildr.apache.org by Peter Donald <pe...@realityforge.org> on 2012/11/10 04:32:10 UTC
Add tasks to attach generation tasks to?
Hi,
Another thing I noticed across a whole bunch of projects is that they
usually create a per project task off which they can hang all the code
generation tasks off. i.e. They add a task like "myproject:generate"
that does all the source generation required for the project. Mostly
this is so they can generate code and then do most of their
development out of an IDE. However I notice that when I look at mavens
lifecycle at [1] they actually include phases by the names
* generate-sources: (Generate the main source code)
* generate-resources: (Generate the main resources)
* generate-test-sources: (Generate the test source code)
* generate-test-resources: (Generate the test resources)
I was thinking about trying to incorporate something similar into
buildr. What do you think would be the best approach?
* Add one "generate" task
* Add the maven generate tasks
* Add both tasks and have the generate task have all the maven
generate taks as dependencies
There would then be a process of updating all the addons to use this
new approach.
Thoughts?
[1] http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
--
Cheers,
Peter Donald
Re: Add tasks to attach generation tasks to?
Posted by Tammo van Lessen <tv...@gmail.com>.
I like the idea!
On Sat, Nov 10, 2012 at 4:32 AM, Peter Donald <pe...@realityforge.org>wrote:
> Hi,
>
> Another thing I noticed across a whole bunch of projects is that they
> usually create a per project task off which they can hang all the code
> generation tasks off. i.e. They add a task like "myproject:generate"
> that does all the source generation required for the project. Mostly
> this is so they can generate code and then do most of their
> development out of an IDE. However I notice that when I look at mavens
> lifecycle at [1] they actually include phases by the names
>
> * generate-sources: (Generate the main source code)
> * generate-resources: (Generate the main resources)
> * generate-test-sources: (Generate the test source code)
> * generate-test-resources: (Generate the test resources)
>
> I was thinking about trying to incorporate something similar into
> buildr. What do you think would be the best approach?
> * Add one "generate" task
> * Add the maven generate tasks
> * Add both tasks and have the generate task have all the maven
> generate taks as dependencies
>
> There would then be a process of updating all the addons to use this
> new approach.
>
> Thoughts?
>
> [1]
> http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
>
> --
> Cheers,
>
> Peter Donald
>
--
Tammo van Lessen - http://www.taval.de
Re: Add tasks to attach generation tasks to?
Posted by Alex Boisvert <al...@gmail.com>.
On Fri, Nov 9, 2012 at 7:32 PM, Peter Donald <pe...@realityforge.org> wrote:
> Hi,
>
> Another thing I noticed across a whole bunch of projects is that they
> usually create a per project task off which they can hang all the code
> generation tasks off. i.e. They add a task like "myproject:generate"
> that does all the source generation required for the project. Mostly
> this is so they can generate code and then do most of their
> development out of an IDE. However I notice that when I look at mavens
> lifecycle at [1] they actually include phases by the names
>
> * generate-sources: (Generate the main source code)
> * generate-resources: (Generate the main resources)
> * generate-test-sources: (Generate the test source code)
> * generate-test-resources: (Generate the test resources)
>
> I was thinking about trying to incorporate something similar into
> buildr. What do you think would be the best approach?
> * Add one "generate" task
> * Add the maven generate tasks
> * Add both tasks and have the generate task have all the maven
> generate taks as dependencies
>
> There would then be a process of updating all the addons to use this
> new approach.
>
> Thoughts?
>
I think it's a good idea to standardize on the task(s) names. I would go
with defining separate task names and associating them with their most
relevant tasks e.g. "resources" depends on "generate-resources", "compile"
depends on "generate-sources", etc. I'm not sure about the utility of the
overall "generate" task but I guess we could add it as a dependency of
"build".
Whatever we opt for, we should update our basic dependency graph at
https://cwiki.apache.org/confluence/display/BUILDR/12+Things+to+Know+About+Buildr
.
alex