I could use a little help understanding the concepts behind Gradle(plugin v 0.7) in the context of Android Studio 0.4.0. I have not used Gradle before and it's causing me nothing but problems. I'm not seeing its purpose/benefit because I don't know enough about it.
Some specific questions I have
What are these dependencies? I'm making a simple app with a navigation drawer, targeted to API 11+ where it should be natively supported. What dependencies could I be using?
What is a Gradle wrapper? What changes, if any, does it make to the completed application?
Why does Gradle need to be online constantly? I don't have internet access on my personal laptop when I'm at work. It's gotten to the point that I can't run or test my app because Gradle can't resolve some resource without internet access.
Why is it important that Gradle uses Groovy? I have searched around the internet and that tends to be something people like about Gradle but they don't usually explain why Groovy is important or what it does for an Android app.
Sometimes it's tough as an intermediate programmer as information tends to be overly simple or overly complex. Aside from my specific questions, any additional information you can provide would be useful. I'm not looking to debate the pros and cons of Gradle vs other tools that may do the same thing, I'd just like to know more about Gradle and its use so I can make informed decisions.
Thanks
gradle file, located in the root project directory, defines dependencies that apply to all modules in your project. By default, the top-level build file uses the plugins block to define the Gradle dependencies that are common to all modules in the project.
You don't need to have gradle installed. The gradle wrapper will download and cache all its dependencies on the first run. So all the developers on your team can build the project really quickly.
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.
With Maven, goals are attached to project phases, and goals serve a similar function to Gradle's tasks, being the “things that do the work.” Performance-wise, both allow for multi-module builds to run in parallel. However, Gradle allows for incremental builds because it checks which tasks are updated or not.
Some of your questions are general in that they speak to why build tools are a good thing as a general matter. Others get to Gradle specifically. I will try to address both categories as succinctly as possible while trying to avoid others' nitpicking terminology.
Build tools like Maven, Gradle, SBT, Leiningen, etc. help to automate tasks that we would otherwise have to manually perform or "manually automate." I use the latter to describe what I used to do with Ant--writing custom tasks to compile, run, generate Javadoc, etc. so the tasks could be automated for the future. By conforming to conventions originally defined by Maven and adopted by the others subsequently (like putting your source in src/main/java), this becomes possible. If I follow the conventions, the build tool can compile, run, generate Javadoc, test, and everything else with minimal extra work.
Now to your questions (in order):
Hope that helps.
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