From 7c77fbb353967bf143f6efaaa7d40189d2f638f4 Mon Sep 17 00:00:00 2001 From: a-maurice Date: Thu, 21 Nov 2024 17:06:11 -0800 Subject: [PATCH 1/3] Add SPM logic for Analytics testapp --- analytics/integration_test/Podfile | 8 +++--- .../project.pbxproj | 25 +++++++++++++++++++ scripts/gha/build_testapps.py | 2 ++ 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/analytics/integration_test/Podfile b/analytics/integration_test/Podfile index 83b48e29d0..4d84884aa3 100644 --- a/analytics/integration_test/Podfile +++ b/analytics/integration_test/Podfile @@ -4,13 +4,13 @@ platform :ios, '13.0' use_frameworks! :linkage => :static target 'integration_test' do - platform :ios, '13.0' - pod 'Firebase/Analytics', '11.4.2' +# platform :ios, '13.0' +# pod 'Firebase/Analytics', '11.4.2' end target 'integration_test_tvos' do - platform :tvos, '13.0' - pod 'Firebase/Analytics', '11.4.2' +# platform :tvos, '13.0' +# pod 'Firebase/Analytics', '11.4.2' end post_install do |installer| diff --git a/analytics/integration_test/integration_test.xcodeproj/project.pbxproj b/analytics/integration_test/integration_test.xcodeproj/project.pbxproj index c9f051f91c..b960b85260 100644 --- a/analytics/integration_test/integration_test.xcodeproj/project.pbxproj +++ b/analytics/integration_test/integration_test.xcodeproj/project.pbxproj @@ -185,6 +185,9 @@ dependencies = ( ); name = integration_test; + packageProductDependencies = ( + 2A42CF362CED4B60001D5F83 /* FirebaseAnalytics */, + ); productName = testapp; productReference = 529226D21C85F68000C89379 /* integration_test.app */; productType = "com.apple.product-type.application"; @@ -239,6 +242,9 @@ Base, ); mainGroup = 529226C91C85F68000C89379; + packageReferences = ( + 2A42CF352CED4B60001D5F83 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */, + ); productRefGroup = 529226D31C85F68000C89379 /* Products */; projectDirPath = ""; projectRoot = ""; @@ -651,6 +657,25 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + 2A42CF352CED4B60001D5F83 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/firebase/firebase-ios-sdk"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 11.5.0; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 2A42CF362CED4B60001D5F83 /* FirebaseAnalytics */ = { + isa = XCSwiftPackageProductDependency; + package = 2A42CF352CED4B60001D5F83 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */; + productName = FirebaseAnalytics; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 529226CA1C85F68000C89379 /* Project object */; } diff --git a/scripts/gha/build_testapps.py b/scripts/gha/build_testapps.py index 867202f71e..2663262d1a 100644 --- a/scripts/gha/build_testapps.py +++ b/scripts/gha/build_testapps.py @@ -636,6 +636,8 @@ def _build_apple( logging.info("No entitlements found at %s.", entitlements_path) _run(xcode_patcher_args) + _run(["xcodebuild", "-resolvePackageDependencies", "-project", "integration_test.xcodeproj"]) + xcode_path = os.path.join(project_dir, "integration_test.xcworkspace") if _APPLE_SDK_SIMULATOR in apple_sdk: _run( From 12113cc3f0012981ae1d09e997176677db7cabbe Mon Sep 17 00:00:00 2001 From: a-maurice Date: Thu, 21 Nov 2024 18:24:08 -0800 Subject: [PATCH 2/3] Add it for tvOS --- .../integration_test.xcodeproj/project.pbxproj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/analytics/integration_test/integration_test.xcodeproj/project.pbxproj b/analytics/integration_test/integration_test.xcodeproj/project.pbxproj index b960b85260..d029969bbb 100644 --- a/analytics/integration_test/integration_test.xcodeproj/project.pbxproj +++ b/analytics/integration_test/integration_test.xcodeproj/project.pbxproj @@ -206,6 +206,9 @@ dependencies = ( ); name = integration_test_tvos; + packageProductDependencies = ( + 2A42CF362CED4B60001D5F83 /* FirebaseAnalytics */, + ); productName = integration_test_tvos; productReference = BC1D664C2668D109005DC2DA /* integration_test_tvos.app */; productType = "com.apple.product-type.application"; From 06955fd5c2316ed1f18a633591e3baf10f4f3a14 Mon Sep 17 00:00:00 2001 From: a-maurice Date: Tue, 17 Dec 2024 10:22:05 -0800 Subject: [PATCH 3/3] Trying more things --- analytics/integration_test/Podfile | 17 +++++++++++ .../project.pbxproj | 28 ------------------- 2 files changed, 17 insertions(+), 28 deletions(-) diff --git a/analytics/integration_test/Podfile b/analytics/integration_test/Podfile index 4d84884aa3..4d3462df00 100644 --- a/analytics/integration_test/Podfile +++ b/analytics/integration_test/Podfile @@ -17,5 +17,22 @@ post_install do |installer| # If this is running from inside the SDK directory, run the setup script. system("if [[ -r ../../setup_integration_tests.py ]]; then python3 ../../setup_integration_tests.py .; fi") system("python3 ./download_googletest.py") + + swift_package = installer.pods_project.new Xcodeproj::Project::Object::XCRemoteSwiftPackageReference + swift_package.repositoryURL = "https://github.com/firebase/firebase-ios-sdk" + swift_package.requirement = { + "kind" => "upToNextMajorVersion", + "minimumVersion" => "11.5.0" + } + + swift_package_product = installer.pods_project.new Xcodeproj::Project::Object::XCSwiftPackageProductDependency + swift_package_product.package = swift_package + swift_package_product.product_name = "FirebaseAnalytics" + + installer.pods_project.root_object.package_references << swift_package + installer.pods_project.native_targets.each do |target| + target.package_product_dependencies << swift_package_product + end + end diff --git a/analytics/integration_test/integration_test.xcodeproj/project.pbxproj b/analytics/integration_test/integration_test.xcodeproj/project.pbxproj index d029969bbb..c9f051f91c 100644 --- a/analytics/integration_test/integration_test.xcodeproj/project.pbxproj +++ b/analytics/integration_test/integration_test.xcodeproj/project.pbxproj @@ -185,9 +185,6 @@ dependencies = ( ); name = integration_test; - packageProductDependencies = ( - 2A42CF362CED4B60001D5F83 /* FirebaseAnalytics */, - ); productName = testapp; productReference = 529226D21C85F68000C89379 /* integration_test.app */; productType = "com.apple.product-type.application"; @@ -206,9 +203,6 @@ dependencies = ( ); name = integration_test_tvos; - packageProductDependencies = ( - 2A42CF362CED4B60001D5F83 /* FirebaseAnalytics */, - ); productName = integration_test_tvos; productReference = BC1D664C2668D109005DC2DA /* integration_test_tvos.app */; productType = "com.apple.product-type.application"; @@ -245,9 +239,6 @@ Base, ); mainGroup = 529226C91C85F68000C89379; - packageReferences = ( - 2A42CF352CED4B60001D5F83 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */, - ); productRefGroup = 529226D31C85F68000C89379 /* Products */; projectDirPath = ""; projectRoot = ""; @@ -660,25 +651,6 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ - -/* Begin XCRemoteSwiftPackageReference section */ - 2A42CF352CED4B60001D5F83 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/firebase/firebase-ios-sdk"; - requirement = { - kind = upToNextMajorVersion; - minimumVersion = 11.5.0; - }; - }; -/* End XCRemoteSwiftPackageReference section */ - -/* Begin XCSwiftPackageProductDependency section */ - 2A42CF362CED4B60001D5F83 /* FirebaseAnalytics */ = { - isa = XCSwiftPackageProductDependency; - package = 2A42CF352CED4B60001D5F83 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */; - productName = FirebaseAnalytics; - }; -/* End XCSwiftPackageProductDependency section */ }; rootObject = 529226CA1C85F68000C89379 /* Project object */; }