First install gradle - https://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
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:
Enable the Gradle Daemon:
Via properties file - add
org.gradle.daemon=true
to GRADLE_USER_HOME»/gradle.properties
Gradle Tutorial
Create build flavor with different MainActivity (start activity)
1. In Android Studio select Project view
2. app/src/main create new Java Folder name "full"
3. Inside "full"
CodePath: gradle dependncies:
https://guides.codepath.com/android/Getting-Started-with-Gradle
http://gradleplease.appspot.com/
Sign apk release key:
http://stackoverflow.com/questions/18328730/how-to-create-a-release-signed-apk-file-using-gradle
https://coderwall.com/p/zrdsmq/signing-configs-with-gradle-android
Reference 2.0:
https://spring.io/guides/gs/gradle-android/
https://objectpartners.com/2015/03/31/using-android-product-flavors-to-build-full-and-demo-version-of-the-app/
https://github.com/manijshrestha/BuildVariantDemo
http://developer.android.com/tools/building/configuring-gradle.html
http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Product-flavors
http://tulipemoutarde.be/2013/10/06/gradle-build-variants-for-your-android-project.html
http://www.vogella.com/tutorials/AndroidBuild/article.html
Reference:
No comments:
Post a Comment