Commit 4a475b9c authored by Tiago Cunha's avatar Tiago Cunha

Preparing new build

parent 58177d52
...@@ -33,3 +33,9 @@ proguard/ ...@@ -33,3 +33,9 @@ proguard/
# MacOS # MacOS
.DS_Store .DS_Store
# Auth files
*.jks
app/rocket-chat.json
app/src/release/google-services.json
app/src/release/res/values/api_key_strings.xml
...@@ -31,6 +31,11 @@ android { ...@@ -31,6 +31,11 @@ android {
minifyEnabled false minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
} }
debug {
defaultConfig {
minSdkVersion 21
}
}
} }
} }
......
...@@ -2,6 +2,7 @@ apply plugin: 'com.android.application' ...@@ -2,6 +2,7 @@ apply plugin: 'com.android.application'
apply plugin: 'me.tatarka.retrolambda' apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'realm-android' apply plugin: 'realm-android'
apply plugin: 'com.jakewharton.hugo' apply plugin: 'com.jakewharton.hugo'
apply plugin: 'com.github.triplet.play'
apply from: '../config/quality/quality.gradle' apply from: '../config/quality/quality.gradle'
buildscript { buildscript {
...@@ -19,6 +20,7 @@ buildscript { ...@@ -19,6 +20,7 @@ buildscript {
classpath rootProject.ext.realmPlugin classpath rootProject.ext.realmPlugin
classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1' classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1'
classpath 'com.google.gms:google-services:3.0.0' classpath 'com.google.gms:google-services:3.0.0'
classpath 'com.github.triplet.gradle:play-publisher:1.1.5'
} }
// Exclude the version that the android plugin depends on. // Exclude the version that the android plugin depends on.
...@@ -53,6 +55,19 @@ android { ...@@ -53,6 +55,19 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release signingConfig signingConfigs.release
} }
debug {
defaultConfig {
minSdkVersion 21
}
}
}
productFlavors {
qa {
// something - qa builds will have some extra stuff for alpha testers
}
prod {
// another
}
} }
packagingOptions { packagingOptions {
exclude 'META-INF/LICENSE.txt' exclude 'META-INF/LICENSE.txt'
...@@ -67,6 +82,10 @@ android { ...@@ -67,6 +82,10 @@ android {
lintConfig file("lint.xml") lintConfig file("lint.xml")
} }
} }
play {
jsonFile = file('rocket-chat.json')
track = "${track}"
}
repositories { repositories {
mavenCentral() mavenCentral()
...@@ -84,7 +103,7 @@ dependencies { ...@@ -84,7 +103,7 @@ dependencies {
compile rootProject.ext.supportAppCompat compile rootProject.ext.supportAppCompat
compile rootProject.ext.supportDesign compile rootProject.ext.supportDesign
compile('com.instabug.library:instabug:3.1.0') { qaCompile('com.instabug.library:instabug:3.1.0') {
exclude group: 'io.reactivex' exclude group: 'io.reactivex'
} }
compile 'com.android.support:multidex:1.0.1' compile 'com.android.support:multidex:1.0.1'
......
...@@ -4,13 +4,11 @@ import android.support.multidex.MultiDexApplication; ...@@ -4,13 +4,11 @@ import android.support.multidex.MultiDexApplication;
import chat.rocket.android.model.ServerConfig; import chat.rocket.android.model.ServerConfig;
import chat.rocket.android.realm_helper.RealmStore; import chat.rocket.android.realm_helper.RealmStore;
import com.facebook.stetho.Stetho; import com.facebook.stetho.Stetho;
import com.instabug.library.Feature;
import com.instabug.library.Instabug;
import com.instabug.library.invocation.InstabugInvocationEvent;
import com.uphyca.stetho_realm.RealmInspectorModulesProvider; import com.uphyca.stetho_realm.RealmInspectorModulesProvider;
import io.realm.Realm; import io.realm.Realm;
import io.realm.RealmConfiguration; import io.realm.RealmConfiguration;
import java.util.List; import java.util.List;
import chat.rocket.android.wrappers.InstabugWrapper;
import timber.log.Timber; import timber.log.Timber;
/** /**
...@@ -37,10 +35,7 @@ public class RocketChatApplication extends MultiDexApplication { ...@@ -37,10 +35,7 @@ public class RocketChatApplication extends MultiDexApplication {
.enableWebKitInspector(RealmInspectorModulesProvider.builder(this).build()) .enableWebKitInspector(RealmInspectorModulesProvider.builder(this).build())
.build()); .build());
new Instabug.Builder(this, getString(R.string.instabug_api_key)) InstabugWrapper.build(this, getString(R.string.instabug_api_key));
.setInvocationEvent(InstabugInvocationEvent.FLOATING_BUTTON)
.setInAppMessagingState(Feature.State.DISABLED) //not available in Free plan...
.build();
//TODO: add periodic trigger for RocketChatService.keepalive(this) here! //TODO: add periodic trigger for RocketChatService.keepalive(this) here!
} }
......
...@@ -7,8 +7,9 @@ import android.support.v4.app.Fragment; ...@@ -7,8 +7,9 @@ import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentManager;
import android.view.MotionEvent; import android.view.MotionEvent;
import chat.rocket.android.helper.OnBackPressListener; import chat.rocket.android.helper.OnBackPressListener;
import com.instabug.library.InstabugTrackingDelegate;
import com.trello.rxlifecycle.components.support.RxAppCompatActivity; import com.trello.rxlifecycle.components.support.RxAppCompatActivity;
import chat.rocket.android.wrappers.InstabugWrapper;
import icepick.Icepick; import icepick.Icepick;
import timber.log.Timber; import timber.log.Timber;
...@@ -68,7 +69,7 @@ abstract class AbstractFragmentActivity extends RxAppCompatActivity { ...@@ -68,7 +69,7 @@ abstract class AbstractFragmentActivity extends RxAppCompatActivity {
@Override public boolean dispatchTouchEvent(MotionEvent event) { @Override public boolean dispatchTouchEvent(MotionEvent event) {
try { try {
InstabugTrackingDelegate.notifyActivityGotTouchEvent(event, this); InstabugWrapper.wrap(event, this);
} catch (IllegalStateException exception) { } catch (IllegalStateException exception) {
Timber.w(exception, "Instabug error (ignored)"); Timber.w(exception, "Instabug error (ignored)");
} }
......
package chat.rocket.android.wrappers;
import android.app.Activity;
import android.app.Application;
import android.view.MotionEvent;
public class InstabugWrapper {
public static void build(Application application, String apiKey) {
// stub
}
public static void wrap(MotionEvent event, Activity activity) {
// stub
}
}
package chat.rocket.android.wrappers;
import android.app.Activity;
import android.app.Application;
import android.view.MotionEvent;
import com.instabug.library.Feature;
import com.instabug.library.Instabug;
import com.instabug.library.InstabugTrackingDelegate;
import com.instabug.library.invocation.InstabugInvocationEvent;
public class InstabugWrapper {
public static void build(Application application, String apiKey) {
new Instabug.Builder(application, apiKey)
.setInvocationEvent(InstabugInvocationEvent.FLOATING_BUTTON)
.setInAppMessagingState(Feature.State.DISABLED) //not available in Free plan...
.build();
}
public static void wrap(MotionEvent event, Activity activity) {
InstabugTrackingDelegate.notifyActivityGotTouchEvent(event, activity);
}
}
...@@ -40,7 +40,7 @@ task checkstyle(type: Checkstyle, group: 'Verification', description: 'Runs code ...@@ -40,7 +40,7 @@ task checkstyle(type: Checkstyle, group: 'Verification', description: 'Runs code
task findbugs(type: FindBugs, task findbugs(type: FindBugs,
group: 'Verification', group: 'Verification',
description: 'Inspect java bytecode for bugs', description: 'Inspect java bytecode for bugs',
dependsOn: ['compileDebugSources', 'compileReleaseSources']) { dependsOn: ['compileQaDebugSources']) {
ignoreFailures = false ignoreFailures = false
effort = "max" effort = "max"
......
...@@ -5,7 +5,7 @@ ext { ...@@ -5,7 +5,7 @@ ext {
retroLambdaPatch = 'me.tatarka.retrolambda.projectlombok:lombok.ast:0.2.3.a2' retroLambdaPatch = 'me.tatarka.retrolambda.projectlombok:lombok.ast:0.2.3.a2'
compileSdkVersion = 25 compileSdkVersion = 25
buildToolsVersion = '25.0.1' buildToolsVersion = '25.0.1'
minSdkVersion = 21 //for accelerating multi-dex build. OVERRIDEN BY Circle CI to 17 minSdkVersion = 17
supportVersion = '25.0.1' supportVersion = '25.0.1'
supportAnnotations = "com.android.support:support-annotations:$supportVersion" supportAnnotations = "com.android.support:support-annotations:$supportVersion"
......
...@@ -33,6 +33,11 @@ android { ...@@ -33,6 +33,11 @@ android {
minifyEnabled false minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
} }
debug {
defaultConfig {
minSdkVersion 21
}
}
} }
} }
......
...@@ -26,6 +26,11 @@ android { ...@@ -26,6 +26,11 @@ android {
minifyEnabled false minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
} }
debug {
defaultConfig {
minSdkVersion 21
}
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment