So I was using Eclipse and migrated over to Android Studio before sometime. I was introduced to Gradle for the first time. I have read that it is build automation for building, testing and publishing. But I have done these tasks one at a time while developing apps. I will code then test if it is working and then when I am happy with the result and think it is good enough to be used by everyone, I will publish it. Where does gradle come in between all these? Sorry if it is a very noob question but I have been reading and I am still unable to get my head around all this.
Gradle's performance advantagesIncremental build works for compilation, test execution, or any other task that happens in your build. A Gradle task is the equivalent of a Maven goal. Just a unit of work to get executed in the build. Gradle keeps track of each task's inputs and outputs.
Gradle allows custom dependency scopes, which provides better-modeled and faster builds. Maven dependency conflict resolution works with a shortest path, which is impacted by declaration ordering. Gradle does full conflict resolution, selecting the highest version of a dependency found in the graph.
Gradle is a general-purpose build toolGradle makes it easy to build common types of project — say Java libraries — by adding a layer of conventions and prebuilt functionality through plugins. You can even create and publish custom plugins to encapsulate your own conventions and build functionality.
Summary of performance resultsGradle is between 7 and 85 times faster than Maven when building incremental changes; benefits increase with number of subprojects. Gradle builds are 3 to 30 times faster than Maven builds when task outputs can be resolved Gradle's build cache.
The main advantage of the new Gradle-based build system is, you can easily define multiple
And define the whole build process for each one of those (and combinations) individually, such as:
This allows for very neat things like having a different application id (package name) for debug releases, so that both release and debug can be installed at the same time.
At first there are some ideological reasons. Some developers just love command line tools. And you can dramatically increase your speed by chosing command line over GUI.
At the moment you are fine with your build process. But the grade of Automation is just limited, when using a gui tool. It will be made just for some special cases. With something like gradle, which just uses an entire scripting language for builds, there are no limits at all. And this is the second reason.
How you would achive automatically build the project, push apk on 50 different mobile devices, run the testsuite and then deploy the app to play and amazon after successfull test run every time when code is merged from develop to master branch with eclipse only?
You will need a dependency management tool like maven or gradle for a good size project. Also, it will help you automate the release process which could be very complex
For a small personal app, it maybe overkill.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With