apply bugly in production mode only

This commit is contained in:
houxg
2017-02-16 13:02:24 +08:00
parent 61743f341b
commit fdf863cd82
3 changed files with 2 additions and 16 deletions

View File

@@ -17,7 +17,7 @@ apply plugin: 'com.neenbedankt.android-apt'
def dbflow_version = "4.0.0-beta2"
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 buglyPrdKey = isEmpty(System.getenv('BUGLY_PRD')) ? "" : System.getenv('BUGLY_PRD')
def isEmpty(String str) {
return str == null || "".equals(str);
}
@@ -56,19 +56,9 @@ android {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
buildConfigField "String", "BUGLY_KEY", String.format("\"%s\"", buglyPrdKey)
}
}
buildTypes.each { buildType ->
def properties = new Properties();
if (buildType.isDebuggable()) {
properties.load(new FileInputStream(new File(projectDir.absolutePath + "/staging.properties")))
} else {
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']
}
}

View File

@@ -1,2 +0,0 @@
FLURRY_KEY="M6HD6WJPT9Y274MG2FSF"
BUGLY_KEY="cf1aa1ccff"

View File

@@ -1,2 +0,0 @@
FLURRY_KEY="XQP2X5N9BCGB7Z5JHS28"
BUGLY_KEY="747b676abf"