Reputation: 14409
There are some other related questions in this same website, but I just cannot get my head around this.
In their website they're extremelly abstract.
Gradle is build automation evolved. Gradle can automate the building, testing, publishing, deployment and more of software packages or other types of projects such as generated static websites, generated documentation or indeed anything else.
What does that really mean? Thanks
Upvotes: 9
Views: 3172
Reputation: 139
Also you can review the answers to this post . It contains detailed explanations (By the way, I am also very new to this topic).
When we build/rebuild our project, or press run, or press debug in Android Studio, Gradle collects everything in our project (codes, resources, drawables, third party packages, etc) and compiles them into a installable file, aka APK (in the "app\build\outputs\apk\debug" folder). And then we can install it on a mobile device or run in Android Studio virtual device emulators.
If our project is not very complex, most probably we don't need to worry about Gradle. When we add new project or import external JARs, Android Studio automatically updates necessary gradle files. These files contains configuration scripts for build system, written in a language named DSL.
Upvotes: 0
Reputation: 1006704
Gradle is software for building software.
Let's assume for the moment, given android in your question, that you are working on an Android app.
You may be using Eclipse to develop your app. Eclipse, as part of that, will use its own build automation engine to compile your Java, cross-compile the bytecode into Dalvik bytecode, compile the resources and manifest, package all that up into an APK, sign it with a signing key, and zipalign
the results (among other steps).
Instead (or in addition to) Eclipse, you might have used android update project
to generate a build.xml
file, one that allows your app to be built via Apache Ant. Ant, like Gradle, is a build automation engine -- software for building software. Gradle happens to be newer and more powerful than Ant, but they have the same basic role in our lives: taking all stuff we type in (like, say, Java source) and get an APK out as a result.
If you have used Maven for project builds, or have used other IDEs (e.g., IntelliJ IDEA, NetBeans), you have used their build automation engines as part and parcel of that work.
Gradle is not only available for command-line builds as a replacement for Ant, but it is also the build automation engine used (by default) in Android Studio. Quoting the Android developer documentation:
The Android Studio build system consists of an Android plugin for Gradle. Gradle is an advanced build toolkit that manages dependencies and allows you to define custom build logic. Many software projects use Gradle to manage their builds. The Android plugin for Gradle does not depend on Android Studio, although Android Studio is fully integrated with it. This means that:
- You can build your Android apps from the command line on your machine or on machines where Android Studio is not installed (such as continuous integration servers).
- You can build your Android apps from Android Studio with the same custom build configuration and logic as when you build from the command line.
The output of the build is the same whether you are building a project from the command line, on a remote machine, or using Android Studio.
Upvotes: 7
Reputation: 1984
It's a file with a set of instructions on how to compile your project. What dependencies it needs, where they are etc. You can also use it to make different versions of the project by compiling in different ways, for debugging, testing etc.
Upvotes: 0