Gradle for Android
suggest changeIntroduction
Gradle is a JVM-based build system that enables developers to write high-level scripts that can be used to automate the process of compilation and application production. It is a flexible plugin-based system, which allows you to automate various aspects of the build process; including compiling and signing a .jar, downloading and managing external dependencies, injecting fields into the AndroidManifest or utilising specific SDK versions.
Syntax
-
apply plugin: The plugin to apply, normally'com.android.application'or'com.android.library'. -
android: The main configuration of your appcompileSdkVersion: The compile SDK versionbuildToolsVersion: The build tools versiondefaultConfig: The default settings, which product flavors and build types can overrideapplicationId: The application id, for example in the Play Store. It is often the same as the package nameminSdkVersion: The minimum required SDK versiontargetSdkVersion: The API level whose behavior the app targets.compileSdkVersionis the SDK you compile againstversionCode: The internal version number, which needs to increase on each updateversionName: The version number the user can see on the app details page
buildTypes: See somewhere else (TODO)
-
dependencies: The maven or local dependencies of your app -
compilea single dependency -
testCompile: a dependency for the unit or integration tests
Remarks
See also
- The official gradle homepage
- How to configure gradle builds
- The android plugin for gradle
- Android Gradle DSL
Gradle for Android - Extended documentation:
There is another tag where you can find more topics and examples about the use of gradle in Android.
http://stackoverflow.com/documentation/android-gradle/topics