Re: Add tasks to attach generation tasks to?

2012-11-10 Thread Tammo van Lessen
I like the idea!


On Sat, Nov 10, 2012 at 4:32 AM, Peter Donald pe...@realityforge.orgwrote:

 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: ApacheCon / Thoughtworks TechRadar

2012-11-10 Thread Tammo van Lessen
Hi Michel,

I did have a look at lock_jar and I really like the idea. Since I like on
one hand Mavens magic resolution for bootstrapping a projects, on the other
hand I also want to have the control over the dependencies. What I usually
do is running something like

pp transitive(LOGBACK).map {|a| a.to_spec}

and copy the result into my buildfile. lockjar could automate this for me,
right?

However, it was difficult to me to grok how a real-world multi-project
buildr file would look like. If I'm not mistaken, I would need to add all
dependencies separately to the projects using the lock_jar dsl? I'd love if
there would be a more unobtrusive way like saying

compile.with project('api'), lock(AXIS2, AXIOM, OPENJPA)
test.with lock(TESTNG)

and lockjar would use this information to create the lockfile
(automatically if not there, otherwise on demand) and return a resolved set
of dependencies. The lock method could also take an optional group
parameter in order to define independent resolution groups. Still open
would be the question how excludes or pinned versions could be expressed.

Do you think such an integration would useful or feasible?

Thanks,
  Tammo


On Sat, Nov 10, 2012 at 5:13 AM, Michel Guymon michael.guy...@gmail.comwrote:


 Hi,

 I figure I would pile onto the Buildr vs Maven discussion, this will be a
 little non sequitur.

 What I have been doing is using Maven for project info, mostly defining
 dependencies and where to deploy to. This is what Maven is actually good
 at, project markup. The perk is all the existing tools can continue to work
 with the Project's POM. Everything else I do is handled by Buildr. Using
 LockJar[1] to import the deps and deployment info from the POM, I am able
 to build and deploy my artifacts from Buildr.

 I find this is the sweet spot, being able to live in a Maven world but
 still able to build my artifacts the way I need to with Buildr. God help me
 if I ever have to use and XML build tool again. . .

 thanks,
 Michael


 [1] 
 https://github.com/mguymon/**lock_jar#buildr-integrationhttps://github.com/mguymon/lock_jar#buildr-integration
 https://github.com/mguymon/**lock_jarhttps://github.com/mguymon/lock_jar
 


 On 11/09/2012 10:04 PM, Peter Donald wrote:

 Huya,

 On Sat, Nov 10, 2012 at 5:21 AM, Tammo van Lessen tvanles...@gmail.com
 wrote:

 First, I got a Buildr talk accepted at ApacheCon EU in Sinsheim, Germany,
 which I held just yesterday.

 congrats!

  I got a lot of positive feedback, people seem
 to like the buildr idea although it also seems that Maven improved since
 the inception of Buildr and some things are less worse. The most visible
 argument against buildr was, however, that people are used to use Maven
 and
 that, if they want to make their project accessible for a broad audience,
 they think they'd need to stick to Maven.

 That does seem to be a common view.

  I guess Gradle tries to address
 this issue by providing a gradle-wrapper, which is a small jar file
 along
 a shell script that you can include into your project and that will
 bootstrap a gradle installation automatically. I also figured, that still
 many Java developers don't have rubies at hand and don't know how to
 easily
 install a gem.

 And one stage, Antoine was working on the all-in-one distribution
 that essentially bundled a version of jruby with buildr and all it's
 dependencies in one easy installer. I wonder if we could work on this
 to ease adoption of buildr for the casual user.

 Where I work we use Chef (http://www.opscode.com/chef/) extensively
 and they release their tool in omnibus editions that are essentially
 a complete version of ruby for n-different platforms. They preinstall
 the chef gems in the ruby they distribute but they make sure that the
 only things that are added to the path are the che executables. I
 wonder if this would be a good thing for us to consider?

  Second, I stumbled upon ThoughtWorks TechRadar [2]. In particular, I
 liked
 the first paragraph of the Tools section ;)

 It is kinda neat. Possibly the best thing we can do is to increase
 awareness ... I think your approach to giving a talk is a good idea.





-- 
Tammo van Lessen - http://www.taval.de


Re: Moving _(:target, :generated) to top level of project

2012-11-10 Thread Alex Boisvert
On Fri, Nov 9, 2012 at 7:20 PM, Peter Donald pe...@realityforge.org wrote:


 layout = Layout::Default.new
 layout[:target, :generated] = generated

 define myproject, :layout = layout do
   ...
   project.clean { rm_rf _(:target, :generated) }
 end

 The main reason for this seems to be ease of integration into IDEs.

 I only really use IntelliJs IDEA but I know that at least for that IDE
 we exclude the intermediate directory (i.e. _(:target) ) from the
 project and this makes it impossible to view the generated source in
 the IDE. So to enable development in the IDE they move it out of the
 target hierarchy.

 * Do you think we should make this the default?


We use target/generated because it's the Maven standard and the least
surprising for most people. Since it's the default, it's hard(er) to find
evidence that it suits people's needs.

I think it would rather stick with what we have now given the precedent and
the somewhat arbitrary nature of layouts.


 * Alternatively, should we create an addon that makes this the
 default behaviour?


Yep, I think that would be the right way to go.

alex