mirror of
https://github.com/leanote/leanote-android.git
synced 2025-10-15 14:51:04 +00:00
apply prd bugly only in travis build
This commit is contained in:
@@ -17,7 +17,7 @@ apply plugin: 'com.neenbedankt.android-apt'
|
|||||||
def dbflow_version = "4.0.0-beta2"
|
def dbflow_version = "4.0.0-beta2"
|
||||||
def ciName = isEmpty(System.getenv("TRAVIS_TAG")) ? "Staging" : System.getenv("TRAVIS_TAG")
|
def ciName = isEmpty(System.getenv("TRAVIS_TAG")) ? "Staging" : System.getenv("TRAVIS_TAG")
|
||||||
def ciCode = isEmpty(System.getenv("TRAVIS_BUILD_NUMBER")) ? 1000 : Integer.valueOf(System.getenv("TRAVIS_BUILD_NUMBER"))
|
def ciCode = isEmpty(System.getenv("TRAVIS_BUILD_NUMBER")) ? 1000 : Integer.valueOf(System.getenv("TRAVIS_BUILD_NUMBER"))
|
||||||
|
def buglyPrdKey = isEmpty(System.getenv('BUGLY_PRD')) ? "" : System.getenv('BUGLY_PRD')
|
||||||
def isEmpty(String str) {
|
def isEmpty(String str) {
|
||||||
return str == null || "".equals(str);
|
return str == null || "".equals(str);
|
||||||
}
|
}
|
||||||
@@ -56,6 +56,7 @@ android {
|
|||||||
minifyEnabled false
|
minifyEnabled false
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
signingConfig signingConfigs.config
|
signingConfig signingConfigs.config
|
||||||
|
buildConfigField "String", "BUGLY_KEY", String.format("\"%s\"", buglyPrdKey)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,11 +64,8 @@ android {
|
|||||||
def properties = new Properties();
|
def properties = new Properties();
|
||||||
if (buildType.isDebuggable()) {
|
if (buildType.isDebuggable()) {
|
||||||
properties.load(new FileInputStream(new File(projectDir.absolutePath + "/staging.properties")))
|
properties.load(new FileInputStream(new File(projectDir.absolutePath + "/staging.properties")))
|
||||||
} else {
|
buildType.buildConfigField "String", "BUGLY_KEY", properties['BUGLY_KEY']
|
||||||
properties.load(new FileInputStream(new File(projectDir.absolutePath + "/production.properties")))
|
|
||||||
}
|
}
|
||||||
buildType.buildConfigField "String", "FLURRY_KEY", properties['FLURRY_KEY']
|
|
||||||
buildType.buildConfigField "String", "BUGLY_KEY", properties['BUGLY_KEY']
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,2 +0,0 @@
|
|||||||
FLURRY_KEY="M6HD6WJPT9Y274MG2FSF"
|
|
||||||
BUGLY_KEY="cf1aa1ccff"
|
|
@@ -4,6 +4,7 @@ package org.houxg.leamonax;
|
|||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import com.elvishew.xlog.LogLevel;
|
import com.elvishew.xlog.LogLevel;
|
||||||
import com.elvishew.xlog.XLog;
|
import com.elvishew.xlog.XLog;
|
||||||
@@ -31,7 +32,9 @@ public class Leamonax extends Application {
|
|||||||
super.onCreate();
|
super.onCreate();
|
||||||
mContext = this;
|
mContext = this;
|
||||||
XLog.init(BuildConfig.DEBUG ? LogLevel.ALL : LogLevel.NONE);
|
XLog.init(BuildConfig.DEBUG ? LogLevel.ALL : LogLevel.NONE);
|
||||||
initBugly();
|
if (!TextUtils.isEmpty(BuildConfig.BUGLY_KEY)) {
|
||||||
|
initBugly();
|
||||||
|
}
|
||||||
|
|
||||||
EventBus.builder()
|
EventBus.builder()
|
||||||
.logNoSubscriberMessages(false)
|
.logNoSubscriberMessages(false)
|
||||||
@@ -39,8 +42,10 @@ public class Leamonax extends Application {
|
|||||||
.throwSubscriberException(true)
|
.throwSubscriberException(true)
|
||||||
.installDefaultEventBus();
|
.installDefaultEventBus();
|
||||||
FlowManager.init(new FlowConfig.Builder(this).build());
|
FlowManager.init(new FlowConfig.Builder(this).build());
|
||||||
Stetho.initializeWithDefaults(this);
|
|
||||||
JodaTimeAndroid.init(this);
|
JodaTimeAndroid.init(this);
|
||||||
|
if (BuildConfig.DEBUG) {
|
||||||
|
Stetho.initializeWithDefaults(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initBugly() {
|
private void initBugly() {
|
||||||
|
Reference in New Issue
Block a user