Original address: Http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Introduction
Translator: Google unveiled a new Android studio integrated development environment, where the structure of the Android project differs greatly from the Eclipse's Android project structure because of the different build tools used by the two development environments. Android Studio uses the Gradle build tool, and Eclipse's ADT plugin uses the ant build tool. Because of the differences between the two build tools, developers accustomed to the eclipse development environment were just beginning to be more difficult to adapt to Android Studio. If you are migrating to Android Studio, it is recommended that you understand the next Gradle build tool. The Gradle build tool is a task-driven build tool and can be extended with various plugin plug-ins to accommodate a variety of build tasks. The Gradle plugin for Android projects is Android Gradle Plugin. This article is Google's official Android Gradle plugin use guide translation to facilitate my big Chinese developers to learn. If the English level is also good students, suggest direct view of the official text, my understanding and translation inevitably have overlooked.
1, Introduction (Introduction)
This document applies to the 0.9 version of Gradle plugin. Earlier versions may differ from this document due to the incompatibility we introduced prior to the 1.0 release.
1.1 goals of the new build system (Gradle the target of building systems)
Using Gradle as a target for the new building system:
* make it easier to reuse code and resources.
* make it easier to create different versions of the same application, whether it's multiple APK release versions or different custom versions of the same app.
* make the build process easier to configure, extend, and customize.
* integration of excellent IDE
1.2 Why Gradle? (Why use Gradle)
Gradle is an excellent build system and build tool that allows you to create custom build logic through plugins.
We chose it based on some of the features below Gradle:
* the Domain specific Language (DSL language) is used to describe and control the build logic.
* The build file is based on groovy and allows you to control the custom build logic by mixing the DSL elements and using code to control the DSL elements.
* support for Maven or Ivy dependency management.
* very flexible. Allows the use of the best implementations, but does not enforce them in a way.
* plugins can provide their own DSL and APIs for use in building files.
* Good API tools for IDE integration.
2. Requirements (required)
* Gradle 1.10 or Gradle 1.11 or Gradle 1.12, and use the 0.11.1 plugin version.
* SDK build tools requires version 19.0.0. Some of the new features may require a higher version.