From 40900d082d468672b14d1a6185f3e01b52b7063c Mon Sep 17 00:00:00 2001 From: Hannah Shi Date: Mon, 18 Mar 2024 12:37:55 -0700 Subject: [PATCH] PR #1643: add xcprivacy to all subspecs Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1643 Addressing comments at https://github.com/abseil/abseil-cpp/pull/1604/#pullrequestreview-1937008657 Add a xcprivacy subspec and have all other subspecs depend on it (option 1) Didn't going with option 3 because there are several levels of subspecs in abseil podspec, it's difficult to track whether all of them directly or indirectly depends on abseil/base/config or ensure they will continue to depend on it. Example of generated podsped: https://gist.github.com/HannahShiSFB/15d8fb6aa637f2781b7be4218d080f11 Merge 4405cdfe71129bebb13c02a6d8ee18be7e813f73 into 4539c540fe48d6a7f0cc4ed3ace2971c9038cc75 Merging this change closes #1643 COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1643 from HannahShiSFB:privacy-manifests 4405cdfe71129bebb13c02a6d8ee18be7e813f73 PiperOrigin-RevId: 616914674 Change-Id: If56d5a4f1a7cc6f9fac7a2d8e95b55d140e645fc --- absl/abseil.podspec.gen.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/absl/abseil.podspec.gen.py b/absl/abseil.podspec.gen.py index e567e8790aa..cbf7cb423ba 100755 --- a/absl/abseil.podspec.gen.py +++ b/absl/abseil.podspec.gen.py @@ -47,6 +47,11 @@ s.osx.deployment_target = '10.11' s.tvos.deployment_target = '9.0' s.watchos.deployment_target = '2.0' + s.subspec 'xcprivacy' do |ss| + ss.resource_bundles = { + ss.module_name => 'PrivacyInfo.xcprivacy', + } + end """ # Rule object representing the rule of Bazel BUILD. @@ -191,6 +196,12 @@ def write_podspec_rule(f, rule, depth): name = get_spec_name(dep.replace(":", "/")) f.write("{indent}{var}.dependency '{dep}'\n".format( indent=indent, var=spec_var, dep=name)) + # Writes dependency to xcprivacy + f.write( + "{indent}{var}.dependency '{dep}'\n".format( + indent=indent, var=spec_var, dep="abseil/xcprivacy" + ) + ) def write_indented_list(f, leading, values):