From e5670231f0b2588255e2465dff0deced5dc1ff5d Mon Sep 17 00:00:00 2001 From: JayShortway <29483617+JayShortway@users.noreply.github.com> Date: Mon, 17 Jun 2024 10:57:54 +0200 Subject: [PATCH] get_phc_version now also checks PHC UI versions (#1100) --- fastlane/Fastfile | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index fe3677ad7..37a896865 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -269,12 +269,26 @@ def get_phc_version android_phc_version = android_build_gradle_contents.match("ext.common_version = '(.*)'").captures[0] UI.user_error!("Android PHC version not found.") if android_phc_version.nil? + android_ui_build_gradle_path = '../purchases_ui_flutter/android/build.gradle' + android_ui_build_gradle_contents = File.read(android_ui_build_gradle_path) + android_phc_ui_version = android_ui_build_gradle_contents.match("ext.common_version = '(.*)'").captures[0] + UI.user_error!("Android PHC UI version not found.") if android_phc_ui_version.nil? + ios_podspec_path = '../ios/purchases_flutter.podspec' ios_podspec_contents = File.read(ios_podspec_path) ios_phc_version = ios_podspec_contents.match("s.dependency 'PurchasesHybridCommon', '(.*)'").captures[0] UI.user_error!("iOS PHC version not found.") if ios_phc_version.nil? - UI.user_error!("Android and iOS PHC versions don't match. Please make sure they match.") if android_phc_version != ios_phc_version + ios_ui_podspec_path = '../purchases_ui_flutter/ios/purchases_ui_flutter.podspec' + ios_ui_podspec_contents = File.read(ios_ui_podspec_path) + ios_phc_ui_version = ios_ui_podspec_contents.match("s.dependency 'PurchasesHybridCommonUI', '(.*)'").captures[0] + UI.user_error!("iOS PHC UI version not found.") if ios_phc_ui_version.nil? + + versions_match = + android_phc_version == ios_phc_version && + android_phc_version == android_phc_ui_version && + ios_phc_version == ios_phc_ui_version + UI.user_error!("Android and iOS PHC (UI) versions don't match. Please make sure they match.") unless versions_match ios_phc_version end