69 messages in org.codehaus.groovy.devRe: [groovy-dev] Building Groovy
FromSent OnAttachments
Russel WinderOct 6, 2008 4:36 am 
MingfaiOct 6, 2008 4:47 am 
Hans DockterOct 6, 2008 4:50 am 
Hans DockterOct 6, 2008 4:55 am 
Jochen TheodorouOct 6, 2008 4:56 am 
Guillaume LaforgeOct 6, 2008 7:17 am 
Hans DockterOct 6, 2008 7:51 am 
Russel WinderOct 6, 2008 7:59 am 
Guillaume LaforgeOct 6, 2008 8:19 am 
Guillaume LaforgeOct 6, 2008 8:25 am 
MingfaiOct 6, 2008 8:28 am 
Guillaume LaforgeOct 6, 2008 8:36 am 
Hans DockterOct 6, 2008 1:46 pm 
Guillaume LaforgeOct 6, 2008 1:54 pm 
Hans DockterOct 6, 2008 1:54 pm 
Jochen TheodorouOct 6, 2008 2:03 pm 
Guillaume LaforgeOct 6, 2008 2:09 pm 
Paul DuffyOct 6, 2008 7:06 pm 
Luke DaleyOct 6, 2008 8:47 pm 
Guillaume LaforgeOct 6, 2008 9:44 pm 
Russel WinderOct 6, 2008 11:25 pm 
Russel WinderOct 6, 2008 11:54 pm 
Russel WinderOct 7, 2008 12:03 am 
Jason DillonOct 7, 2008 12:23 am 
Russel WinderOct 7, 2008 12:24 am 
Guillaume LaforgeOct 7, 2008 12:30 am 
Hans DockterOct 7, 2008 12:35 am 
Jason DillonOct 7, 2008 12:35 am 
Hans DockterOct 7, 2008 12:36 am 
Jason DillonOct 7, 2008 12:41 am 
Guillaume LaforgeOct 7, 2008 12:54 am 
Jason DillonOct 7, 2008 1:40 am 
Guillaume LaforgeOct 7, 2008 1:50 am 
Jason DillonOct 7, 2008 1:55 am 
Guillaume LaforgeOct 7, 2008 2:25 am 
Guillaume LaforgeOct 7, 2008 2:35 am 
Jason DillonOct 7, 2008 3:09 am 
Guillaume LaforgeOct 7, 2008 3:12 am 
Russel WinderOct 7, 2008 3:17 am 
Jason DillonOct 7, 2008 3:24 am 
Paul KingOct 7, 2008 4:04 am 
ma...@dockter.bizOct 7, 2008 4:19 am 
ma...@dockter.bizOct 7, 2008 4:25 am 
Jason DillonOct 7, 2008 4:36 am 
Jason DillonOct 7, 2008 4:39 am 
Jochen TheodorouOct 7, 2008 5:20 am 
Jason DillonOct 7, 2008 8:19 am 
Jochen TheodorouOct 7, 2008 9:51 am 
Jason DillonOct 7, 2008 10:49 am 
Jochen TheodorouOct 7, 2008 12:03 pm 
Hans DockterOct 7, 2008 2:34 pm 
Luke DaleyOct 7, 2008 3:52 pm 
Jason DillonOct 8, 2008 1:28 am 
Jason DillonOct 8, 2008 1:35 am 
Hans DockterOct 8, 2008 3:11 am 
Hans DockterOct 8, 2008 3:49 am 
Hans DockterOct 8, 2008 4:30 am 
Hans DockterOct 8, 2008 4:40 am 
Jason DillonOct 8, 2008 4:52 am 
Jason DillonOct 8, 2008 5:21 am 
Jochen TheodorouOct 8, 2008 6:23 am 
Jochen TheodorouOct 8, 2008 6:47 am 
Jochen TheodorouOct 8, 2008 6:59 am 
Hans DockterOct 8, 2008 8:33 am 
Hans DockterOct 8, 2008 8:43 am 
Paul DuffyOct 9, 2008 8:58 am 
Paul KingOct 9, 2008 1:15 pm 
Danno FerrinOct 9, 2008 1:27 pm 
Paul KingOct 10, 2008 2:31 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [groovy-dev] Building GroovyActions...
From:Jochen Theodorou (blac@gmx.org)
Date:Oct 7, 2008 5:20:54 am
List:org.codehaus.groovy.dev

Hans Dockter schrieb: [...]

What is the problem with Maven2?

- It has the same problem as Ant regarding the anemic interaction with Java/Groovy (Maven considers this as a feature). The GMaven plugin does not make a difference here. You can't use Groovy to choreograph the build. - Maven enforces an often bizarre level of indirection (has anybody ever used the Maven constraint plugin to express the most simple custom constraint). Maven's verbosity is extreme. - Maven's dependency management is far inferior to Ivy. - Maven also introduces its own general purpose elements which are not necessarily implemented well (e.g. pom inheritance). (Have you ever tried to use a single property as a version value for all subprojects in a slightly complex multi-project build) - Maven is not based on dependency based programming. What it offers instead to hook in actions is significantly more inflexible. - Its multi-project build features are inferior to what Gradle offers. For example: -- You can't do partial builds. In Gradle you can build a subproject in a way that all the project it depends on are rebuild as well. In Maven you always have to trigger the complete build (and if this takes some time you have to watch the console to push Ctrl-C when the stuff you want to have rebuild is done). -- Maven has not a distinct configuration and runtime dependencies between projects. For example if you want to configure the common stuff of a set of subprojects in a parent pom, this parent pom needs always to be build before the subprojects. Therefore you can't use this parent pom for example for creating an ueberarchive from the subprojects. You have to refactor the commons stuff in an artifical subproject with a pom the other subprojects inherit from. Such things makes Maven builds so hard to maintain and comprehend.

The biggest problem Maven has, is a conceptual one though. Erich Gamme has coined the phrase Frameworkitis for this kind of problems.

I don't think that these points will make it without giving examples and then many may not understand the examples or why they are bad for one and good for the other. When I suggested a Groovy based build system back then before gant was created I had one major thought I did nether tell anyone, because I did not enter the phase where it can be expressed with speech.. still searching for how to express that properly.

First a disclaimer... this is all my personal view! And a warning... this is a long text.

What I dislike at current build systems is that you often have no separation of concerns. You write helper in your project that then will be used by the build system, because the build system is not powerful enough to express it on its own. In ant you do this by writing ant tasks. For make in a C project you wrote helper in C. In m1 it was ant tasks too, or something with Jelly. In m2 it can be a plugin written in Java. I think the m2 idea is kind of the natural evolution here. In all these cases you either mix parts of your build logic into the normal project because of helper files not used by your project... or you go further and make a plugin like in m2, which needs to be compiled and deployed. This adds a level of indirection which is praised as the wonder weapon against problems, but I personally think of this as a perversions of an easy build. It is easy when the plugins do come from the outside, but the problem that I have to make leaps and somersaults just because my build system can't properly express what I need remains. In fact I reached the goal to separate my build logic from the build so much, that using this becomes a problem in itself.

Another problem of most build systems is that you have to breach media very often. In ant you program in XML... that in itself is something I think should be considered as a media breach... but most people then go and XSLT or write custom ant tasks. You use these, because the XML becomes unreasonably big if you do not do so, or things can be expressed more easy that way. Again the build system and the way of usage is to be considered as not powerful enough here. In make you often use autoconf... a joy in itself, but probably still better than many ant builds... only that autoconf doesn't help you much with java builds. In m1, well I mentioned the usage of jelly and ant tasks already. With the ant task you have not only a media breach, but also a breach in the build system usage... m1 was thought to be independent of ant, or not? And jelly... well let us better forget that chapter. Now in m2 you have your plugins and your XML, which is again a media breach. The only way for m2 to avoid this is to minimize the XML part and hope no custom plugin is required. But the standard answer from the m2 guys to all sorts of problems seems to be to write a plugin...

The third part of my thought is "don't look only at the easy things". Of course all build systems have certain use cases where they are very easy to use. You can use make without autoconf in some cases, you can have small and nice m1,m2 and ant builds files... but what if you have to leave the road they gave you? make isn't good at checking library version information or even if there is such a library... it simply isn't in its scope. So a layer on top was made, the configure script. make has other problems as well, but I don't want to write a book here ;) m1.. well I am not really sure what was right or wrong with it... saying it was simply broken looks so unfair... but I am sure many will see it the same. I think ant is not really bad, it just grows too much and becomes unmaintainable then. Sure you have the media breach, but at last the so generated tasks are very easy to use. In m2 they tried to make it all better by conventions and restrictions. In fact so many of them, that they loose the easy usage part like ant has it and like they still had it in m1.

Probably part 2 and three can be condensed in "ease of use". Once you leave the road, there is no longer the question for a comfortable way, but how many walls you have to climb. Of course many m2 people will argue, that if you organize your source according to their pattern and that if you use the plugins the m2 world gave you, you have no really big problems - besides bugs in the plugins. But what if there are reasons to not to follow the m2 conventions? I think it is just too easy to say that if you don't follow the conventions you have to live with the difficulties. A good build system should instead still try to support them as good as possible and not add new walls he has to climb.

So in my eyes the "ultimative" build system would be one that works without media breach and is comfortable to use.

Now I personally dislike XML. For me XML stands for "cross machine language" meaning it is not intended to be used by the human reader. Also If you need a GUI or even IDE to just get things rolling then some things are wrong. I mention those because often it is said you can have a special editor with auto-completion and which validates the XML and whatever... as I said... if I need those, then something is wrong. Also once you have to program in XML something is really wrong.

I think a build system can be most powerful if it is based on a programming language, allowing you to write tasks/plugins without media breach. Where you can hook into the build logic itself to bend it to do your non standard things... maybe even making a more or less new build system out of it, if you need that. So instead of avoiding logic in the build file, the build file should consist of build logic. That is completely against the ideas in maven. But most people using build files are more or less good programmers and why should this potential power not be used?

For example the question should not be how good the build system does multi project builds, instead the question should be about what I have to do to et my build system to support multi project builds in the way I want to have them! The question shouldn't be if the dependency management of ivy or maven is better, instead the question should be what I have to do to use either of them. A build system should not work against your personal taste of what tools you have to use and what layout should be used. Instead a build system should give support to make the non standard things easy too. And so on.

And I think a programming language to program/configure the build is what is needed to get this working.

I am not sure if gradle can already achieve all these goals already or if it even intends to do so, but I think gradle is more near to this ideal than ant or maven.

So what technical reasons to switch or not to switch can I extract from these for a build of Groovy? In fact I failed in my explanation at a very important point. That point is why? Why want I have such a flexible system? Nad my simple answer would be maintainability. If you don't need to change your build anymore, then any build system is fine, because as long as you don't have to touch the build files any build system will do. Never change a running system... But once you have to extend your build you already reached the point where your current build doesn't do the job anymore. And again it does not matter what build system it is, the build wil be more complex in the end. So the cost factor is the thing that has to be reduced. How much can I change the build without increasing the complexity of the build too much? Often people tend to not to extend the build any further, because it is already too big and nobody actually understands it anymore. It starts with a decreasing number of people who actually know what the build does and ends with people just trying and guessing. Several refactorings may help to ease the pain, but the comlexity will grow without mercy.

I think that ant has a bad cost factor here. It does not take much for the build to be too complex. And I think for Groovy we already reached the point where just one or two actually know what the build does. At times of m1 I understood the build more or less, but from my point of view the current build is at last as complex as the m1 build now... and I fail to understand it anymore.. to many strange fork calls are in there for me. so each change will brings us to the point where noone actually understand the build anymore... and I don't think that the current build will be sufficient for whatever we do in Groovy in the future. For example I would like to automate the upload of the files. I would like it to handle connection problems and other stuff. But I don't dare to write something for ant. So from my point of view we already reached the point where we do certain things not anymore, because it is too complicated.

And I doubt m2 will help me with all the non standard things I would like to do. So a switch to gradle seems to be the right thing for me.

[...]

This is one driving vision of Gradle. Offer build by convention but avoid frameworkitis. Offer little frameworks which cover the major use cases for this area. Offer toolsets (and after all a general purpose language) for all the stuff a build system will never be able to anticipate in the very complex problem space of project automation. And all this should be straight forward to use without unnecessary directions.

yes!

Only with an internal DSL you have the tool to use toolsets. And internal DSL's are a major selling point for Groovy, and this with good reason. Therefore for me it would be kind of ironic if Groovy would use Maven as its build system.

true

bye blackdrag