Configure Firebase appdistribution plugin

This commit is contained in:
Benoit Marty 2022-07-06 00:15:32 +02:00 committed by Benoit Marty
parent 388a380101
commit 11b2cd3dc0
2 changed files with 18 additions and 3 deletions

View file

@ -24,6 +24,7 @@ buildscript {
classpath libs.gradle.gradlePlugin classpath libs.gradle.gradlePlugin
classpath libs.gradle.kotlinPlugin classpath libs.gradle.kotlinPlugin
classpath libs.gradle.hiltPlugin classpath libs.gradle.hiltPlugin
classpath 'com.google.firebase:firebase-appdistribution-gradle:3.0.2'
classpath 'com.google.gms:google-services:4.3.13' classpath 'com.google.gms:google-services:4.3.13'
classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.4.0.2513' classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.4.0.2513'
classpath 'com.google.android.gms:oss-licenses-plugin:0.10.5' classpath 'com.google.android.gms:oss-licenses-plugin:0.10.5'

View file

@ -1,6 +1,7 @@
import com.android.build.OutputFile import com.android.build.OutputFile
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.appdistribution'
apply plugin: 'com.google.android.gms.oss-licenses-plugin' apply plugin: 'com.google.android.gms.oss-licenses-plugin'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply plugin: 'kotlin-parcelize' apply plugin: 'kotlin-parcelize'
@ -229,10 +230,10 @@ android {
storePassword 'android' storePassword 'android'
} }
nightly { nightly {
keyAlias project.property("signing.element.nightly.keyId") keyAlias System.env.ELEMENT_ANDROID_NIGHTLY_KEYID ?: project.property("signing.element.nightly.keyId")
keyPassword project.property("signing.element.nightly.keyPassword") keyPassword System.env.ELEMENT_ANDROID_NIGHTLY_KEYPASSWORD ?: project.property("signing.element.nightly.keyPassword")
storeFile file('./signature/nightly.keystore') storeFile file('./signature/nightly.keystore')
storePassword project.property("signing.element.nightly.storePassword") storePassword System.env.ELEMENT_ANDROID_NIGHTLY_STOREPASSWORD ?: project.property("signing.element.nightly.storePassword")
} }
release { release {
keyAlias project.property("signing.element.keyId") keyAlias project.property("signing.element.keyId")
@ -285,6 +286,19 @@ android {
resValue "color", "launcher_background", "#07007E" resValue "color", "launcher_background", "#07007E"
matchingFallbacks = ['release'] matchingFallbacks = ['release']
signingConfig signingConfigs.nightly signingConfig signingConfigs.nightly
firebaseAppDistribution {
artifactType = "APK"
// We upload the universal APK to fix this error:
// "App Distribution found more than 1 output file for this variant.
// Please contact firebase-support@google.com for help using APK splits with App Distribution."
artifactPath = "$rootDir/vector/build/outputs/apk/gplay/nightly/vector-gplay-universal-nightly.apk"
// This file will be generated by the GitHub action
releaseNotesFile = "CHANGES_NIGHTLY.md"
groups = "external-testers"
// This should not be required, but if I do not add the appId, I get this error:
// "App Distribution halted because it had a problem uploading the APK: [404] Requested entity was not found."
appId = "1:912726360885:android:efd8545af52a9f9300427c"
}
} }
} }