4 ms·
Generally speaking gradle plugins take a very declarative syntax. Yes, it's easy to write non-declarative builds in Gradle, but that's what is awesome about it.
by blktiger 10y ago
Generally speaking gradle plugins take a very declarative syntax. Yes, it's easy to write non-declarative builds in Gradle, but that's what is awesome about it. Start with fully declarative builds, then add in non-declarative tasks if/when you need them.
- perrylaj 10y agoMy experience generally mirrors what you state. I transitioned a fairly significant code base & complex deployment process from a mix of maven and ant to gradle. I found Gradle's 'opinionated but flexible' approach to strike a good balance. It's definitely more complex, at least in our build, simply because of the size and scope of our project which has a wide variety of inter-dependencies which makes for a very complex task graph to build. But, the parallelism results in a far faster build/deploy cycle which is a worthy tradeoff. We initially planned on going full maven, but its strict lifecycle and plugin system was simply too rigid. Beyond that, XML makes for some verbose configuration for even simple things. We ended up developing our own Gradle plugins in static groovy and java, but it's very easy to do small bits/tests based on scripts and migrate functionality into specific-purpose plugins. Using Gradle was especially fortuitous when it came time to implement new areas of the product that relied on npm/node and webpack for front-end resource assembly. Gradle hasn't been without its own minor growing pains (early lack of tooling support, rapid version changes), and it's certainly possible to create a big complex mess if you script everything ala ant -- but it's also possible to create very nicely defined DSLs and build systems that are expressive in use. Our onboarding got significantly easier in switching to gradle from maven+ant, and teams can now easily make minor tweaks for their build needs without having to learn maven's plugin architecture. Builds, just like anything else, benefit from some best practices. I have no issue with Maven, but I won't start a new project with it.
- vroombaprime 10y agoEverything you said matches my experiences - the complexity has to be watched closely, but otherwise it's a huge boon.