Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .configure
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
{
"file": "android/debug.keystore",
"destination": "~/.configure/wordpress-android/secrets/debug_a8c.keystore",
"destination": "~/.configure/wordpress-android/secrets/debug.keystore",
"encrypt": true
},
{
Expand All @@ -25,7 +25,7 @@
},
{
"file": "android/automattic_upload.jks",
"destination": "WordPress/upload.jks",
"destination": "~/.configure/wordpress-android/secrets/upload.jks",
"encrypt": true
},
{
Expand Down
20 changes: 10 additions & 10 deletions WordPress/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -280,24 +280,24 @@ android {
}

signingConfigs {
if (["uploadStoreFile", "uploadStorePassword", "uploadKeyAlias", "uploadKeyPassword"].count { !gradle.ext.secretProperties.containsKey(it) } == 0) {
logger.info("App signing properties found in secrets.properties, configuring signing for release builds.")
def uploadKeystore = new File(gradle.ext.decryptedSecretsDir, "upload.jks")
def uploadCredentials = ["uploadStorePassword", "uploadKeyAlias", "uploadKeyPassword"]
if (uploadKeystore.exists() && uploadCredentials.every { gradle.ext.secretProperties.containsKey(it) }) {
logger.info("Upload keystore found, configuring signing for release builds.")
release {
storeFile = rootProject.file(gradle.ext.secretProperties.get("uploadStoreFile"))
storeFile = uploadKeystore
storePassword = gradle.ext.secretProperties.get("uploadStorePassword")
keyAlias = gradle.ext.secretProperties.get("uploadKeyAlias")
keyPassword = gradle.ext.secretProperties.get("uploadKeyPassword")
}
android.buildTypes.release.signingConfig = android.signingConfigs.release
}

if (gradle.ext.secretProperties.containsKey("debugStoreFile")) {
logger.info("Debug signing properties found in secrets.properties, configuring signing for debug builds.")
def sharedDebugStore = file(gradle.ext.secretProperties.get("debugStoreFile").replaceFirst("^~", System.getProperty("user.home")))
if (sharedDebugStore.exists()) {
debug {
storeFile sharedDebugStore
}
def debugKeystore = new File(gradle.ext.decryptedSecretsDir, "debug.keystore")
if (debugKeystore.exists()) {
logger.info("Shared debug keystore found, configuring signing for debug builds.")
debug {
storeFile debugKeystore
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ plugins {
gradle.ext {
isCi = System.getenv('CI')?.toBoolean() ?: false

secretPath = "${System.getProperty("user.home")}/.configure/wordpress-android/secrets/secrets.properties"
decryptedSecretsDir = file("${System.getProperty("user.home")}/.configure/wordpress-android/secrets")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This will become a8c-secrets ad hoc project's folder once we adopt the tool.

secretPath = new File(decryptedSecretsDir, "secrets.properties").path
secretProperties = loadSecrets(
logger,
file("${rootDir}/defaults.properties"),
Expand Down
Loading