Skip to content

Commit

Permalink
apply bugly in production mode only
Browse files Browse the repository at this point in the history
  • Loading branch information
FlyingRadish committed Feb 16, 2017
1 parent 61743f3 commit fdf863c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 16 deletions.
14 changes: 2 additions & 12 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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']
}
}


Expand Down
2 changes: 0 additions & 2 deletions app/production.properties

This file was deleted.

2 changes: 0 additions & 2 deletions app/staging.properties

This file was deleted.

0 comments on commit fdf863c

Please sign in to comment.