Gradle Declarative Build System
Gradle Overview
Gradle is an open-source build automation system that builds upon the concepts of Apache Ant and Apache Maven and introduces a Groovy-based domain-specific language (DSL) instead of the XML form used by Apache Maven for declaring the project configuration.
Features
Here is a list of some of the Cradle's features
Declarative builds and build-by-convention
At the heart of Gradle lies a rich extensible Domain Specific Language (DSL) based on Groovy. Gradle pushes declarative builds to the next level by providing declarative language elements that you can assemble as you like. Those elements also provide build-by-convention support for Java, Groovy, OSGi, Web and Scala projects. Even more, this declarative language is extensible. Add your own language elements or enhance the existing ones, thus providing concise maintainable and comprehensible builds.
Language for dependency based programming
The declarative language lies on top of a general purpose task graph, which you can fully leverage in your builds. It provides utmost flexibility to adapt Gradle to your unique needs.
Structure your build
The suppleness and richness of Gradle finally allow you to apply common design principles to your build. For example, it is very easy to compose your build from reusable pieces of build logic. Inline stuff where necessary indirections would be inappropriate.
Don’t be forced to tear apart what belongs together. ( e.g. in your project hierarchy ).
Avoid smells such as shotgun changes and divergent change that turn your build into a maintenance nightmare. At last, you can create a well structured, easily maintained, comprehensible build.
Deep API
From being a pleasure to be used embedded to its many hooks over the whole lifecycle of build execution. Gradle allows you to monitor and customize its configuration and execution behaviour to its very core.
Gradle Scales
Gradle scales very well. It significantly increases your productivity, from simple single project builds up to huge enterprise multi-project builds. This is true for structuring the build. With the state of the art incremental build function, this is also true for tackling the performance pain many large enterprises build suffer from.
Multi-project builds
Project dependencies are first class citizens. Gradle allows you to model the project relationships in a multi-project build as they really are for your problem domain. Gradle follows your layout, not vice versa.
Gradle provides partial builds. If you build a single subproject Gradle takes care of building all the subprojects that sub-projects depend on. You can also choose to rebuild the subproject that depends on a particular subproject. Together with incremental builds, this is a big time saver for larger builds.
Many ways to manage your dependencies
Different teams prefer different ways to manage their external dependencies. Gradle provides convenient support for any strategy. From transitive dependency management with remote Maven and Ivy repositories to jars or directories on the local file system.
Gradle is the first build integration tool.
Any tasks are first class citizens. Even more interesting, Ant projects are first class citizens as well. Gradle provides a deep import for any Ant project, turning Ant targets into native Gradle tasks at runtime. You can depend on them from Gradle, you can enhance them from Gradle, you can even declare dependencies on Gradle tasks in your build.xml. The same integration is provided for properties, paths, etc…
Gradle fully supports your existing Maven or Ivy repositories infrastructure for publishing and retrieving dependencies. Gradle also provides a converter for turning a Maven pom.xml into a Gradle script. Runtime imports of Maven projects will come soon
Ease of Migration
Gradle can adapt to any structure you have. Therefore you can always develop your gradle build in the same branch where your production build lives and both can evolve in parallel. We usually recommend writing tests that make sure that the production artefacts are similar. That way migration is as less disruptive and as reliable as possible. This is following the best practices for refactoring by applying baby steps.
Groovy
Gradle’s build scripts are written in Groovy or Kotlin, not in XML. But unlike other approaches, this is not for simply exposing the raw scripting power of a dynamic language. That would just lead to a very difficult to maintain build. The whole design of Gradle is oriented towards being used as a language, not as a rigid framework. And Groovy is the glue that allows you to tell your individual story with the abstraction Gradle (or you) provide.
Gradle provides some standard stories but they are not privileged in any form. Groovy support is not just sugar coating. The whole Gradle API is fully Groovy-ized. Adding Groovy results in an enjoyable and productive experience.
The Gradle Wrapper
The gradle wrapper allows you to execute Gradle builds on machines where gradle is not installed. This is useful, for example, form some continuous integration server. It is also useful for an open source project to keep the barrier low for building it. The wrapper is also very interesting for the enterprise. It is a zero administration approach for the client machines. It also enforces the usage of a particular Gradle version thus minimizing support issues.
Free and Open source
Gradle is an open source project and is licensed under the Apache License 2.0.
Gradle is an open-source build automation system that builds upon the concepts of Apache Ant and Apache Maven and introduces a Groovy-based domain-specific language (DSL) instead of the XML form used by Apache Maven for declaring the project configuration.
Features
Here is a list of some of the Cradle's features
Declarative builds and build-by-convention
At the heart of Gradle lies a rich extensible Domain Specific Language (DSL) based on Groovy. Gradle pushes declarative builds to the next level by providing declarative language elements that you can assemble as you like. Those elements also provide build-by-convention support for Java, Groovy, OSGi, Web and Scala projects. Even more, this declarative language is extensible. Add your own language elements or enhance the existing ones, thus providing concise maintainable and comprehensible builds.
Language for dependency based programming
The declarative language lies on top of a general purpose task graph, which you can fully leverage in your builds. It provides utmost flexibility to adapt Gradle to your unique needs.
Structure your build
The suppleness and richness of Gradle finally allow you to apply common design principles to your build. For example, it is very easy to compose your build from reusable pieces of build logic. Inline stuff where necessary indirections would be inappropriate.
Don’t be forced to tear apart what belongs together. ( e.g. in your project hierarchy ).
Avoid smells such as shotgun changes and divergent change that turn your build into a maintenance nightmare. At last, you can create a well structured, easily maintained, comprehensible build.
Deep API
From being a pleasure to be used embedded to its many hooks over the whole lifecycle of build execution. Gradle allows you to monitor and customize its configuration and execution behaviour to its very core.
Gradle Scales
Multi-project builds
Project dependencies are first class citizens. Gradle allows you to model the project relationships in a multi-project build as they really are for your problem domain. Gradle follows your layout, not vice versa.
Gradle provides partial builds. If you build a single subproject Gradle takes care of building all the subprojects that sub-projects depend on. You can also choose to rebuild the subproject that depends on a particular subproject. Together with incremental builds, this is a big time saver for larger builds.
Many ways to manage your dependencies
Different teams prefer different ways to manage their external dependencies. Gradle provides convenient support for any strategy. From transitive dependency management with remote Maven and Ivy repositories to jars or directories on the local file system.
Gradle is the first build integration tool.
Any tasks are first class citizens. Even more interesting, Ant projects are first class citizens as well. Gradle provides a deep import for any Ant project, turning Ant targets into native Gradle tasks at runtime. You can depend on them from Gradle, you can enhance them from Gradle, you can even declare dependencies on Gradle tasks in your build.xml. The same integration is provided for properties, paths, etc…
Gradle fully supports your existing Maven or Ivy repositories infrastructure for publishing and retrieving dependencies. Gradle also provides a converter for turning a Maven pom.xml into a Gradle script. Runtime imports of Maven projects will come soon
Ease of Migration
Gradle can adapt to any structure you have. Therefore you can always develop your gradle build in the same branch where your production build lives and both can evolve in parallel. We usually recommend writing tests that make sure that the production artefacts are similar. That way migration is as less disruptive and as reliable as possible. This is following the best practices for refactoring by applying baby steps.
Groovy
Gradle’s build scripts are written in Groovy or Kotlin, not in XML. But unlike other approaches, this is not for simply exposing the raw scripting power of a dynamic language. That would just lead to a very difficult to maintain build. The whole design of Gradle is oriented towards being used as a language, not as a rigid framework. And Groovy is the glue that allows you to tell your individual story with the abstraction Gradle (or you) provide.
Gradle provides some standard stories but they are not privileged in any form. Groovy support is not just sugar coating. The whole Gradle API is fully Groovy-ized. Adding Groovy results in an enjoyable and productive experience.
The Gradle Wrapper
The gradle wrapper allows you to execute Gradle builds on machines where gradle is not installed. This is useful, for example, form some continuous integration server. It is also useful for an open source project to keep the barrier low for building it. The wrapper is also very interesting for the enterprise. It is a zero administration approach for the client machines. It also enforces the usage of a particular Gradle version thus minimizing support issues.
Free and Open source

Comments
Post a Comment