Build automation is the act of scripting or automating a wide variety of tasks that software developers do in their day-to-day activities including things like:
Google selected Gradle as the foundation of the Android SDK build system because,
Product Flavors - Many mobile applications have a free version and a paid version while other applications may ship seasonal variations. With Gradle product flavors are easy to manage with a few lines of code.
Build Type - Build types control application packaging and build configuration for different types of debug and release builds.
Build Variants - Combination of BuildTypes and Flavors.
Signing Configuration - The Gradle Android DSL provides a very simple way to customize keystores and signing configuration across different build types.
Dependency Management - Gradle offers a flexible approach to dependency management that can reuse existing Maven repositories or reference local JARs. If you depend on libraries from Central or if you run your own local repositories, Gradle can adapt to any requirement.
Android Studio is an integrated development environment (IDE) for the Android platform. It was announced on 16 May 2013 at the Google I/O conference by Google.
Latest Android Studio Canary Build: 0.9.3 released on Nov 14, 2014 and Developer Build: 0.8.9 released on Sep 03, 2014
The basic project starts with two components called “source sets”.
Inside each of these folders,
For both the Java and Android plugin, the location of the Java source code and the Java resources:
Extra files and folders specific to Android:
To replace the default source folders, you will want to use srcDirs
Here’s an example, using the old project structure for the main code and remapping the androidTest sourceSet to the tests folder:
Signing an application requires the following:
Default - debug and a release versions.
Project Structure:
settings.gradle:
include ':app', ':libraries:lib1', ':libraries:lib2'
build.gradle:
build.gradle:
There are a few values that can be configured for the test app:
build/reports/androidTests
.
Enables creating different versions of the same application.
Use cases:
Defines a customized version of the application.
Configuration:
This creates four sourceSets:
.gradle
/local.properties
/.idea/workspace.xml
/.idea/tasks.xml
.DS_Store
adb shell am start -n com.package.name/com.package.name.ActivityName