Skip to content

Commit

Permalink
add public.properties
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirtyDegreesRay committed Jan 24, 2018
1 parent 91f2473 commit 65e0f3e
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 12 deletions.
Binary file added app/OpenHubPublicSign.jks
Binary file not shown.
28 changes: 17 additions & 11 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
apply plugin: 'com.android.application'
apply plugin: 'com.novoda.build-properties'

Properties properties = new Properties()
//read properties
properties.load(project.rootProject.file('local.properties').newDataInputStream())
buildProperties {
getPublic {
file rootProject.file('public.properties')
}
getLocal {
file rootProject.file('local.properties')
}
}

android {
compileSdkVersion COMPILE_SDK_VERSION as int
Expand All @@ -17,10 +23,10 @@ android {
vectorDrawables.useSupportLibrary = true
multiDexEnabled false

buildConfigField "String", "OPENHUB_CLIENT_ID", properties.getProperty("openhub_client_id")
buildConfigField "String", "OPENHUB_CLIENT_SECRET", properties.getProperty("openhub_client_secret")
buildConfigField "String", "BUGLY_ID", properties.getProperty("bugly_appid")
buildConfigField "String", "DEBUG_BUGLY_ID", properties.getProperty("debug_bugly_appid")
buildConfigField "String", "OPENHUB_CLIENT_ID", (buildProperties.getLocal['openhub_client_id'] | buildProperties.getPublic['openhub_client_id']).string
buildConfigField "String", "OPENHUB_CLIENT_SECRET", (buildProperties.getLocal['openhub_client_secret'] | buildProperties.getPublic['openhub_client_secret']).string
buildConfigField "String", "BUGLY_ID", (buildProperties.getLocal['bugly_appid'] | buildProperties.getPublic['bugly_appid']).string
buildConfigField "String", "DEBUG_BUGLY_ID", (buildProperties.getLocal['debug_bugly_appid'] | buildProperties.getPublic['debug_bugly_appid']).string

ndk {
abiFilters 'armeabi', 'armeabi-v7a', 'x86'
Expand All @@ -30,10 +36,10 @@ android {

signingConfigs {
release {
storeFile file(properties.getProperty("sign_path"))
storePassword properties.getProperty("store_password")
keyAlias properties.getProperty("key_alias")
keyPassword properties.getProperty("key_password")
storeFile(file((buildProperties.getLocal['sign_path'] | buildProperties.getPublic['sign_path']).string))
storePassword((buildProperties.getLocal['store_password'] | buildProperties.getPublic['store_password']).string)
keyAlias((buildProperties.getLocal['key_alias'] | buildProperties.getPublic['key_alias']).string)
keyPassword((buildProperties.getLocal['key_password'] | buildProperties.getPublic['key_password']).string)
}
}

Expand Down
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
buildscript {
repositories {
jcenter()
// google()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.novoda:gradle-build-properties-plugin:0.3'
}
}

Expand Down
9 changes: 9 additions & 0 deletions public.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
openhub_client_id = "8f7213694e115df205fb"
openhub_client_secret = "82c57672382db5c7b528d79e283c398ad02e3c3f"
bugly_appid = "1ae5c67d6b"
debug_bugly_appid = "1ae5c67d6b"

sign_path = OpenHubPublicSign.jks
store_password = OpenHub
key_alias = Public
key_password = OpenHub

1 comment on commit 65e0f3e

@Martin-Kraus
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.