I have an app that needs to be built with custom packages and a custom configuration file. I took a look on the internet and found about gradle flavors
, but I couldn't figure out how to use them.
Basically I have an app with package com.example.apps.myapp
. I need to build the same application using a different package com.example.apps.myapp2
and a custom config class like com.example.config.myapp2.Configuration
I currently have this on my build.gradle
:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.0.1"
defaultConfig {
applicationId "com.example.apps.myapp"
minSdkVersion 15
targetSdkVersion 20
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':api')
compile project(':view-pager-indicator')
compile project(':MaterialEditText')
compile 'com.pkmmte.view:circularimageview:1.1'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
compile 'com.google.android.gms:play-services:6.5.87'
compile 'com.android.support:support-v4:21.0.3'
compile 'com.android.support:appcompat-v7:21+'
compile 'com.android.support:cardview-v7:21.+'
compile 'com.facebook.android:facebook-android-sdk:3.21.1'
compile 'com.mauriciogiordano:easydb:0.1.0'
}
How easy is to create a gradle task or something to make those changes and build the application? PS: I have zero knowledge about gradle.
Thank you.