Monday, May 11, 2015

Android and Gradle

Gradle: is a build system for Android apps.

First install gradlehttps://gradle.org/downloads/

Info:
Below image shows three directories
1. Vanilla
2. Strawberry
3. Main

Vanilla and Strawberry are the apk build flavors, this both dirctories by default will use the settings from Main folders(java/... ; res/...; AndroidManifest.xml), if we declare this folders inside Vanilla or Strawberry it will override the setting from Main.
Ex:
Change icon for Vanilla apk. You can modified the app icon by adding res directory to the project.


Commands:
run: $chmod +x gradlew

info: $./gradlew -P
Generate APKs: $./gradlew assemble
Generate Taks: $./gradlew tasks 
Install apk build genreated by tasks: $./gradlew installVanillaDebug 

build- generates .apk file, need to configure: $./gradlew build

clean- deletes the generated .apk file: $./gradlew clean

version: $./gradlew -v

Enable the Gradle Daemon:
Via properties file - add org.gradle.daemon=true to GRADLE_USER_HOME»/gradle.properties
Reference:

No comments:

Post a Comment