diff --git a/app/android/app/build.gradle b/app/android/app/build.gradle index 435a7d892..ea7f7c3c2 100644 --- a/app/android/app/build.gradle +++ b/app/android/app/build.gradle @@ -25,9 +25,20 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" -def secretsPropertiesFile = new File(rootProject.projectDir, "secrets.properties") def secrets = new Properties() -secretsPropertiesFile.withReader("UTF-8") { reader -> secrets.load(reader) } +def secretsPropertiesFile = new File(rootProject.projectDir, "secrets.properties") +if (secretsPropertiesFile.isFile()) { + secretsPropertiesFile.withReader("UTF-8") { reader -> secrets.load(reader) } +} else { + assert System.getenv('GPR_USER') + assert System.getenv('GPR_TOKEN') + assert System.getenv('D4L_CLIENT_ID') + assert System.getenv('D4L_CLIENT_SECRET') + secrets.setProperty("gpr.user", System.getenv('GPR_USER')) + secrets.setProperty("gpr.token", System.getenv('GPR_TOKEN')) + secrets.setProperty("d4l.clientId", System.getenv('D4L_CLIENT_ID')) + secrets.setProperty("d4l.clientSecret", System.getenv('D4L_CLIENT_SECRET')) +} android { compileSdkVersion 31 diff --git a/app/android/build.gradle b/app/android/build.gradle index f42aa7de7..a481163f5 100644 --- a/app/android/build.gradle +++ b/app/android/build.gradle @@ -11,9 +11,20 @@ buildscript { } } -def secretsPropertiesFile = new File(rootProject.projectDir, "secrets.properties") def secrets = new Properties() -secretsPropertiesFile.withReader("UTF-8") { reader -> secrets.load(reader) } +def secretsPropertiesFile = new File(rootProject.projectDir, "secrets.properties") +if (secretsPropertiesFile.isFile()) { + secretsPropertiesFile.withReader("UTF-8") { reader -> secrets.load(reader) } +} else { + assert System.getenv('GPR_USER') + assert System.getenv('GPR_TOKEN') + assert System.getenv('D4L_CLIENT_ID') + assert System.getenv('D4L_CLIENT_SECRET') + secrets.setProperty("gpr.user", System.getenv('GPR_USER')) + secrets.setProperty("gpr.token", System.getenv('GPR_TOKEN')) + secrets.setProperty("d4l.clientId", System.getenv('D4L_CLIENT_ID')) + secrets.setProperty("d4l.clientSecret", System.getenv('D4L_CLIENT_SECRET')) +} allprojects { repositories {