From 727ac1de7077ca28ac91947fa673c259c362782c Mon Sep 17 00:00:00 2001 From: Jake Wharton Date: Fri, 9 Jan 2015 01:22:12 -0800 Subject: [PATCH] Extract and change analytics key. Not sure if secret. --- RELEASING.md | 13 +++++++++++++ telecine/build.gradle | 4 ++++ .../com/jakewharton/telecine/TelecineModule.java | 4 +++- telecine/src/main/res/xml/analytics_tracker.xml | 5 ----- 4 files changed, 20 insertions(+), 6 deletions(-) delete mode 100644 telecine/src/main/res/xml/analytics_tracker.xml diff --git a/RELEASING.md b/RELEASING.md index b42fba4..4abba73 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -1,6 +1,19 @@ Release Process =============== +Setup +----- + +Place the following in `~/.gradle/gradle.properties`: +``` +TELECINE_BUGSNAG_KEY= +TELECINE_ANALYTICS_KEY= +``` + + +Release +------- + 1. Update the `telecine/build.gradle` versions to whatever you feel conveys the sheer awesomeness of the update to which you are about to bestow on the masses. diff --git a/telecine/build.gradle b/telecine/build.gradle index f83d8dd..69a1e49 100644 --- a/telecine/build.gradle +++ b/telecine/build.gradle @@ -14,6 +14,9 @@ buildscript { def getBugsnagKey() { return hasProperty('TELECINE_BUGSNAG_KEY') ? TELECINE_BUGSNAG_KEY : '' } +def getAnalyticsKey() { + return hasProperty('TELECINE_ANALYTICS_KEY') ? TELECINE_ANALYTICS_KEY : '' +} apply plugin: 'com.android.application' apply plugin: 'com.neenbedankt.android-apt' @@ -32,6 +35,7 @@ android { versionName "${versionMajor}.${versionMinor}.${versionPatch}" buildConfigField "String", "BUGSNAG_KEY", "\"${getBugsnagKey()}\"" + buildConfigField "String", "ANALYTICS_KEY", "\"${getAnalyticsKey()}\"" // Resource language filters resConfigs "en" diff --git a/telecine/src/main/java/com/jakewharton/telecine/TelecineModule.java b/telecine/src/main/java/com/jakewharton/telecine/TelecineModule.java index c14128a..711d604 100644 --- a/telecine/src/main/java/com/jakewharton/telecine/TelecineModule.java +++ b/telecine/src/main/java/com/jakewharton/telecine/TelecineModule.java @@ -30,7 +30,9 @@ final class TelecineModule { @Provides @Singleton Tracker provideAnalyticsTracker() { GoogleAnalytics googleAnalytics = GoogleAnalytics.getInstance(app); - return googleAnalytics.newTracker(R.xml.analytics_tracker); + Tracker tracker = googleAnalytics.newTracker(BuildConfig.ANALYTICS_KEY); + tracker.setSessionTimeout(300); // ms? s? better be s. + return tracker; } @Provides @Singleton SharedPreferences provideSharedPreferences() { diff --git a/telecine/src/main/res/xml/analytics_tracker.xml b/telecine/src/main/res/xml/analytics_tracker.xml deleted file mode 100644 index a177931..0000000 --- a/telecine/src/main/res/xml/analytics_tracker.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 300 - UA-3637749-20 -