aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/build.gradle
diff options
context:
space:
mode:
authorDominik Schürmann <dominik@dominikschuermann.de>2015-10-21 21:40:24 +0200
committerDominik Schürmann <dominik@dominikschuermann.de>2015-10-21 21:40:24 +0200
commit14d193a0f26c1e56e561d16a76b59f60dc6c7d91 (patch)
tree8610e1b0fabe512edbbe2dd45dd8232e581a882c /OpenKeychain/build.gradle
parent8f565296b9503b210cd8edb8cb9ea42a3055c3c6 (diff)
downloadopen-keychain-14d193a0f26c1e56e561d16a76b59f60dc6c7d91.tar.gz
open-keychain-14d193a0f26c1e56e561d16a76b59f60dc6c7d91.tar.bz2
open-keychain-14d193a0f26c1e56e561d16a76b59f60dc6c7d91.zip
Use Github OAuth ID and secret from properties
Diffstat (limited to 'OpenKeychain/build.gradle')
-rw-r--r--OpenKeychain/build.gradle21
1 files changed, 17 insertions, 4 deletions
diff --git a/OpenKeychain/build.gradle b/OpenKeychain/build.gradle
index fcf099023..98d183741 100644
--- a/OpenKeychain/build.gradle
+++ b/OpenKeychain/build.gradle
@@ -160,6 +160,19 @@ android {
// Reference them in .xml files.
resValue "string", "account_type", "org.sufficientlysecure.keychain.account"
resValue "string", "provider_content_authority", "org.sufficientlysecure.keychain.provider"
+
+ // Github API ID and secret are read from gradle.properties (not in git!)
+ // must use double escaping in gradle.properties! For example:
+ // githubClientId="\\"7a011b66275f244d3f21\\""
+ // githubClientSecret="\\"eaced8a6655719d8c6848396de97b3f5d7a89fec\\""
+ if (project.hasProperty('githubClientId') &&
+ project.hasProperty('githubClientSecret')) {
+
+ println "Found github oauth properties"
+
+ buildConfigField "String", "GITHUB_CLIENT_ID", githubClientId
+ buildConfigField "String", "GITHUB_CLIENT_SECRET", githubClientSecret
+ }
}
debug {
@@ -169,14 +182,14 @@ android {
buildConfigField "String", "ACCOUNT_TYPE", "\"org.sufficientlysecure.keychain.debug.account\""
buildConfigField "String", "PROVIDER_CONTENT_AUTHORITY", "\"org.sufficientlysecure.keychain.debug.provider\""
- // Github api for debug build only
- buildConfigField "String", "GITHUB_CLIENT_ID", "\"7a011b66275f244d3f21\""
- buildConfigField "String", "GITHUB_CLIENT_SECRET", "\"eaced8a6655719d8c6848396de97b3f5d7a89fec\""
-
// Reference them in .xml files.
resValue "string", "account_type", "org.sufficientlysecure.keychain.debug.account"
resValue "string", "provider_content_authority", "org.sufficientlysecure.keychain.debug.provider"
+ // Github API for debug build only
+ buildConfigField "String", "GITHUB_CLIENT_ID", "\"7a011b66275f244d3f21\""
+ buildConfigField "String", "GITHUB_CLIENT_SECRET", "\"eaced8a6655719d8c6848396de97b3f5d7a89fec\""
+
// Enable code coverage (Jacoco)
testCoverageEnabled true
}