Gradle in simple words...

Gradle in simple words...

What is Gradle?

Its a dominant multi platform build system that

  1. Manages dependencies.
  2. Lets you specify custom tasks to run at different stages of the build process.
  3. Automates Deployment.

What does Gradle do?

Android java sources are compiled into custom byte code in Android Runtime, so building Android apps cannot be done manually. Gradle solves problems, by doing following tasks

  1. Packaging types of resources differently.
  2. Byte code resources from multiple sources.
  3. Identifiers of those resources must be known before hand before anything gets compiled.
  4. Needs to be crypto-graphical signed.
  5. Test Runs
  6. Different flavors of apps by a click. i.e. free/paid/debug/release.
  7. Ability to write custom task functions for custom automation.
  8. Generate Documentation
  9. Manage Dependencies.
  10. Publish app.
All this stuff can't be done by hand or shell script. So we use Gradle!

Gradle was designed for multi-project builds which can grow to be quite large, and supports incremental builds by intelligently determining which parts of the build tree are up-to-date, so that any task dependent upon those parts will not need to be re-executed.

Why need Gradle?

  1. Portability - Builds your project on any system.
  2. Automation - Model, Integrate & Systemize your software.
  3. Repeat-ability - Advance Caching, Fast Builds. Single command always happens the same way.
  4. Rapid Productivity - Build suites of apps that are very large.
  5. Rich Domain Model.
  6. Powerful "build language" to write build scripts i.e. Groovy.

How does Gradle work?

  1. Gradle daemon runs in the background keeping the JBM (Java Business Model) instance alive, so that subsequent Gradle runs can use the same instance. It gives huge performance benefits.
  2. Gradle uses a directed acyclic graph ("DAG") to determine the order in which tasks can be run.
  3. Gradle knows how to install itself. 

History of Build Tools:

  1. ANT - 2000 Procedural Programming
  2. Maven - 2004 New Structure but same XML to write build specifications.
  3. Gradle - 2012 No xml & previous structure but domain specific language i.e. Groovy.

Gradle combines good parts of both tools and builds on top of them with DSL and other improvements. It has Ant’s power and flexibility with Maven’s life-cycle and ease of use. I would like to thanks Kazim Ali for his contribution in making this image.

Paste this image near by so that you can look it daily to prepare your self!


要查看或添加评论,请登录

Ahmad Shahwaiz的更多文章

社区洞察

其他会员也浏览了