From 5218b75275c7fab4f8bdef11dcba0e07bbe080ee Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 2 Jul 2024 14:28:59 +0200 Subject: [PATCH 1/8] Fix Element Enterprise nightly build: towncrier is gone. --- .github/workflows/nightly_enterprise.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/nightly_enterprise.yml b/.github/workflows/nightly_enterprise.yml index 9cd80fe0948..d1d77b45f51 100644 --- a/.github/workflows/nightly_enterprise.yml +++ b/.github/workflows/nightly_enterprise.yml @@ -28,15 +28,6 @@ jobs: with: distribution: 'temurin' # See 'Supported distributions' for available options java-version: '17' - - name: Install towncrier - run: | - python3 -m pip install towncrier - - name: Prepare changelog file - run: | - mv towncrier.toml towncrier.toml.bak - sed 's/CHANGES\.md/CHANGES_NIGHTLY\.md/' towncrier.toml.bak > towncrier.toml - rm towncrier.toml.bak - yes n | towncrier build --version nightly - name: Build and upload Nightly application run: | ./gradlew assembleGplayNightly appDistributionUploadGplayNightly $CI_GRADLE_ARG_PROPERTIES From 9a2d5b15476f4aa8410de1ee0f516927b7e0e32b Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 2 Jul 2024 14:32:57 +0200 Subject: [PATCH 2/8] Rename copyright file for consistency --- .idea/copyright/{Enterprise.xml => Element_Enterprise.xml} | 4 ++-- .idea/copyright/profiles_settings.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename .idea/copyright/{Enterprise.xml => Element_Enterprise.xml} (92%) diff --git a/.idea/copyright/Enterprise.xml b/.idea/copyright/Element_Enterprise.xml similarity index 92% rename from .idea/copyright/Enterprise.xml rename to .idea/copyright/Element_Enterprise.xml index 2d430b46131..e8c30197324 100644 --- a/.idea/copyright/Enterprise.xml +++ b/.idea/copyright/Element_Enterprise.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml index 69d52afca4a..2e68dd339fb 100644 --- a/.idea/copyright/profiles_settings.xml +++ b/.idea/copyright/profiles_settings.xml @@ -1,7 +1,7 @@ - + \ No newline at end of file From 65eff95335f43993004df88611328716fc6d354a Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 2 Jul 2024 14:40:49 +0200 Subject: [PATCH 3/8] Remove CI properties, this is not needed when publishing locally. --- docs/nightly_build.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/nightly_build.md b/docs/nightly_build.md index 9fa9ea9bb68..3a3345d662a 100644 --- a/docs/nightly_build.md +++ b/docs/nightly_build.md @@ -42,7 +42,7 @@ Then you can run the following commands (which are also used in the file for [th ```sh git checkout develop -./gradlew assembleGplayNightly appDistributionUploadGplayNightly $CI_GRADLE_ARG_PROPERTIES +./gradlew assembleGplayNightly appDistributionUploadGplayNightly ``` Then you can reset the change on the codebase. From 85c55150b57b6d64af7557d74270d7f25142136d Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 2 Jul 2024 14:52:13 +0200 Subject: [PATCH 4/8] Remove removal of `androidx.startup.InitializationProvider`. This provider is declared at line 39 in this file. Fix the warning: `provider#androidx.startup.InitializationProvider was tagged at AndroidManifest.xml:149 to remove other declarations but no other declaration present` --- app/src/main/AndroidManifest.xml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index b3872a18fd7..49da0a2b22d 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -40,11 +40,9 @@ android:name="androidx.startup.InitializationProvider" android:authorities="${applicationId}.androidx-startup" android:exported="false"> - - - - Date: Tue, 2 Jul 2024 14:58:13 +0200 Subject: [PATCH 5/8] Element Enterprise: use different appId for nightly build. --- app/build.gradle.kts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 7bc3504d848..f1d5a97bb61 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -156,7 +156,11 @@ android { 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:e17435e0beb0303000427c" + appId = if (isEnterpriseBuild) { + "1:912726360885:android:3f7e1fe644d99d5a00427c" + } else { + "1:912726360885:android:e17435e0beb0303000427c" + } } } } From c25cdafff8a758798cd56fef71e25cbf686bcb72 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 2 Jul 2024 15:27:31 +0200 Subject: [PATCH 6/8] Move google_app_id from resource file to build.gradle.kts file and use different values for enterprise build. --- libraries/pushproviders/firebase/README.md | 2 +- .../pushproviders/firebase/build.gradle.kts | 39 ++++++++++++++++++- .../src/debug/res/values/firebase.xml | 4 -- .../src/nightly/res/values/firebase.xml | 4 -- .../src/release/res/values/firebase.xml | 4 -- 5 files changed, 39 insertions(+), 14 deletions(-) delete mode 100644 libraries/pushproviders/firebase/src/debug/res/values/firebase.xml delete mode 100644 libraries/pushproviders/firebase/src/nightly/res/values/firebase.xml delete mode 100644 libraries/pushproviders/firebase/src/release/res/values/firebase.xml diff --git a/libraries/pushproviders/firebase/README.md b/libraries/pushproviders/firebase/README.md index 204ac6dd193..a2a7ad97ed0 100644 --- a/libraries/pushproviders/firebase/README.md +++ b/libraries/pushproviders/firebase/README.md @@ -4,4 +4,4 @@ In order to make this module only know about Firebase, the plugin `com.google.gms.google-services` has been disabled from the `app` module. -To be able to change the values in the file `firebase.xml` from this module, you should enable the plugin `com.google.gms.google-services` again, copy the file `google-services.json` to the folder `/app/src/main`, build the project, and check the generated file `app/build/generated/res/google-services//values/values.xml` to import the generated values into the `firebase.xml` files. +To be able to change the values set to `google_app_id` in the file `build.gradle.kts` of this module, you should enable the plugin `com.google.gms.google-services` again, copy the file `google-services.json` to the folder `/app/src/main`, build the project, and check the generated file `app/build/generated/res/google-services//values/values.xml` to import the generated values into the `build.gradle.kts` files. diff --git a/libraries/pushproviders/firebase/build.gradle.kts b/libraries/pushproviders/firebase/build.gradle.kts index d1c9f62ef0e..28b58b1faa3 100644 --- a/libraries/pushproviders/firebase/build.gradle.kts +++ b/libraries/pushproviders/firebase/build.gradle.kts @@ -13,6 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +@file:Suppress("UnstableApiUsage") + plugins { id("io.element.android-library") alias(libs.plugins.anvil) @@ -22,9 +25,43 @@ android { namespace = "io.element.android.libraries.pushproviders.firebase" buildTypes { - release { + getByName("release") { + isMinifyEnabled = true + consumerProguardFiles("consumer-proguard-rules.pro") + resValue( + type = "string", + name = "google_app_id", + value = if (isEnterpriseBuild) { + "1:912726360885:android:d273c2077ec3291500427c" + } else { + "1:912726360885:android:d097de99a4c23d2700427c" + } + ) + } + getByName("debug") { + resValue( + type = "string", + name = "google_app_id", + value = if (isEnterpriseBuild) { + "1:912726360885:android:f8de9126a94143d300427c" + } else { + "1:912726360885:android:def0a4e454042e9b00427c" + } + ) + } + register("nightly") { isMinifyEnabled = true consumerProguardFiles("consumer-proguard-rules.pro") + matchingFallbacks += listOf("release") + resValue( + type = "string", + name = "google_app_id", + value = if (isEnterpriseBuild) { + "1:912726360885:android:3f7e1fe644d99d5a00427c" + } else { + "1:912726360885:android:e17435e0beb0303000427c" + } + ) } } } diff --git a/libraries/pushproviders/firebase/src/debug/res/values/firebase.xml b/libraries/pushproviders/firebase/src/debug/res/values/firebase.xml deleted file mode 100644 index 540f0e9bbe9..00000000000 --- a/libraries/pushproviders/firebase/src/debug/res/values/firebase.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - 1:912726360885:android:def0a4e454042e9b00427c - diff --git a/libraries/pushproviders/firebase/src/nightly/res/values/firebase.xml b/libraries/pushproviders/firebase/src/nightly/res/values/firebase.xml deleted file mode 100644 index f793ba93f95..00000000000 --- a/libraries/pushproviders/firebase/src/nightly/res/values/firebase.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - 1:912726360885:android:e17435e0beb0303000427c - diff --git a/libraries/pushproviders/firebase/src/release/res/values/firebase.xml b/libraries/pushproviders/firebase/src/release/res/values/firebase.xml deleted file mode 100644 index d563b43d05a..00000000000 --- a/libraries/pushproviders/firebase/src/release/res/values/firebase.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - 1:912726360885:android:d097de99a4c23d2700427c - From 49c3b16f163837125046ad2c01a89e853ce50717 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 2 Jul 2024 16:48:58 +0200 Subject: [PATCH 7/8] Release note for nightly: remove title so that it can be used for Enterprise nightly without confusing the user. --- tools/release/ReleaseNotesNightly.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/release/ReleaseNotesNightly.md b/tools/release/ReleaseNotesNightly.md index 02f76416463..0c1a2e5393a 100644 --- a/tools/release/ReleaseNotesNightly.md +++ b/tools/release/ReleaseNotesNightly.md @@ -1,5 +1,3 @@ -# Element X Android nightly build - See which PRs have been merged recently here: https://github.com/element-hq/element-x-android/pulls?q=is%3Apr+sort%3Aupdated-desc+is%3Aclosed From 0d8064b9da94a978b7579df4c55667f05c35c04e Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 2 Jul 2024 17:21:03 +0200 Subject: [PATCH 8/8] Use different groups for Element Enterprise --- app/build.gradle.kts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index f1d5a97bb61..af70c6ae399 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -153,7 +153,11 @@ android { // artifactType = "AAB" // artifactPath = "$rootDir/app/build/outputs/bundle/nightly/app-nightly.aab" releaseNotesFile = "tools/release/ReleaseNotesNightly.md" - groups = "external-testers" + groups = if (isEnterpriseBuild) { + "enterprise-testers" + } else { + "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 = if (isEnterpriseBuild) {