add special build variant for amazon

This commit is contained in:
Phillip Thelen 2017-04-26 13:30:27 +02:00
parent e99059b298
commit 964bf160c5
2 changed files with 12 additions and 4 deletions

View file

@ -117,13 +117,13 @@ dependencies {
compile 'io.reactivex:rxjava:1.2.0'
//Analytics
compile 'com.amplitude:android-sdk:2.13.1'
compile 'com.amplitude:android-sdk:2.13.3'
// Fresco Image Management Library
compile('com.facebook.fresco:fresco:1.0.1') {
compile('com.facebook.fresco:fresco:1.3.0') {
exclude module: 'bolts-android'
}
compile('com.facebook.fresco:animated-gif:1.0.1') {
compile('com.facebook.fresco:animated-gif:1.3.0') {
exclude module: 'bolts-android'
}
//Tests
@ -162,6 +162,7 @@ android {
defaultConfig {
applicationId "com.habitrpg.android.habitica"
vectorDrawables.useSupportLibrary = true
buildConfigField "String", "STORE", "\"google\""
}
lintOptions {
@ -198,6 +199,10 @@ android {
prod {
}
amazon {
buildConfigField "String", "STORE", "\"amazon\""
}
}
sourceSets {
@ -294,7 +299,7 @@ if (HRPG_RES_FILE.canRead()) {
}
tasks.whenTaskAdded { task ->
if (task.name.equals("lint")) {
if (task.name == "lint") {
task.enabled = false
}
}

View file

@ -18,6 +18,7 @@ import android.support.multidex.MultiDexApplication;
import android.util.Log;
import com.amplitude.api.Amplitude;
import com.amplitude.api.Identify;
import com.facebook.FacebookSdk;
import com.facebook.drawee.backends.pipeline.Fresco;
import com.habitrpg.android.habitica.components.AppComponent;
@ -140,6 +141,8 @@ public abstract class HabiticaBaseApplication extends MultiDexApplication {
if (!BuildConfig.DEBUG) {
try {
Amplitude.getInstance().initialize(this, getString(R.string.amplitude_app_id)).enableForegroundTracking(this);
Identify identify = new Identify().setOnce("androidStore", BuildConfig.STORE);
Amplitude.getInstance().identify(identify);
} catch (Resources.NotFoundException e) {
//pass
}