Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PrivacyInfo.xcprivacy to plugin template #148485

Merged
merged 3 commits into from
May 16, 2024

Conversation

stuartmorgan
Copy link
Contributor

@stuartmorgan stuartmorgan commented May 16, 2024

Adds an empty privacy manifest, and commented out code to include it in the build, to the plugin template. This will make it much easier to explain how to add a privacy manifest in plugin docs, since instead of explaining the format of the file from scratch and providing example code to inculde it, we can just instruct people to add entries to an exisitng file and then uncomment a line or two. This will also make it much easier to figure out from the template output itself how to add support for people who don't find the documentation.

Part of #131940

Fixes #140013

Pre-launch Checklist

@github-actions github-actions bot added the tool Affects the "flutter" command-line tool. See also t: labels. label May 16, 2024
// reason APIs, update the PrivacyInfo.xcprivacy file to describe your plugin's privacy
// impact, and then uncomment these lines. For more information, see
// https://developer.apple.com/documentation/bundleresources/privacy_manifest_files
// , resources: [
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is gross, but because the parameters are order-specific and trailing commas aren't allowed, I couldn't see any other option.

I tried using excludes so this wouldn't be conditional at all, but that caused build failures for some reason (maybe due to everything being excluded?)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could put the comment inside and just comment out the .process("Resources"), line.

            dependencies: [], 
            resources: [
                        // If your plugin requires a privacy manifest, for example if it uses any required
                        // reason APIs, update the PrivacyInfo.xcprivacy file to describe your plugin's privacy
                        // impact, and then uncomment these lines. For more information, see
                        // https://developer.apple.com/documentation/bundleresources/privacy_manifest_files
                        //     .process("Resources"),
            ]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, the Resources folder is also where images and other resource files go, the comment kind of seems like it's only used for privacy manifests.

Maybe change to something like
"If your plugin uses resource files or requires a privacy manifest, uncomment the line below. If your plugin does not require a privacy manifest, delete the PrivacyInfo.xcprivacy file provided in the Resources directory. If your plugin does requires a privacy manifest, for example if it uses any required reason APIs, update the PrivacyInfo.xcprivacy file to describe your plugin's privacy impact. For more information, see https://developer.apple.com/documentation/bundleresources/privacy_manifest_files"

Idk, that's kind of long, though. We could also put the privacy manifest in a different spot so it's independent of other Resources

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So hopefully it's a niche situation they would have anything else in resources. I don't have a preference.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could put the comment inside and just comment out the .process("Resources"), line.

I thought I had tried that and gotten the same error as when I did exclude, but I must be misremembering since it works for me now.

Also, the Resources folder is also where images and other resource files go, the comment kind of seems like it's only used for privacy manifests.

Yes, I'd thought about that too, but when I had tried to make the comment cover everything it seemed like kind of a mess.

We could also put the privacy manifest in a different spot so it's independent of other Resources

Ooh, I like that. I hadn't considered that option; I'll set it up that way (and re-test to be sure it's working).

Do we want to keep the empty Resources folder at that point? I would be tempted to just put a comment saying other files or directories could be added if they happened to need other resources, since I don't think it's common.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to unconditionally have resources:, and moved the privacy manifest to a stand-alone file that is added to resources by a single commented-out line.

I also removed Resources and just put a comment since:

  • I think having other resources will be rare,
  • there's now an example right there someone can refer to if they need to see how it works, and
  • it completely avoids the whole .gitkeep issue with pub.

@vashworth
Copy link
Contributor

fyi @jmagman

Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM whenever @vashworth is happy. Thanks for doing this!
(linked this PR to close #140013)

// reason APIs, update the PrivacyInfo.xcprivacy file to describe your plugin's privacy
// impact, and then uncomment these lines. For more information, see
// https://developer.apple.com/documentation/bundleresources/privacy_manifest_files
// , resources: [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So hopefully it's a niche situation they would have anything else in resources. I don't have a preference.

Adds an empty privacy manifest, and commented out code to include it in
the build, to the plugin template. This will make it much easier to
explain how to add a privacy manifest in plugin docs, since instead of
explaining the format of the file from scratch and providing example
code to inculde it, we can just instruct people to add entries to an
exisitng file and then uncomment a line or two. This will also make it
much easier to figure out from the template output itself how to add
support for people who don't find the documentation.

Part of flutter#131940
@stuartmorgan stuartmorgan added the autosubmit Merge PR when tree becomes green via auto submit App label May 16, 2024
@stuartmorgan
Copy link
Contributor Author

You may want to adjust your migration instruction comment to match this structure, just for consistency.

@vashworth vashworth added autosubmit Merge PR when tree becomes green via auto submit App and removed autosubmit Merge PR when tree becomes green via auto submit App labels May 16, 2024
Copy link
Contributor

@vashworth vashworth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@auto-submit auto-submit bot merged commit b98ffdc into flutter:master May 16, 2024
131 checks passed
@stuartmorgan stuartmorgan deleted the manifest-template-in-plugin branch May 16, 2024 19:58
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 17, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 17, 2024
auto-submit bot pushed a commit to flutter/packages that referenced this pull request May 17, 2024
flutter/flutter@0d22d91...00425ef

2024-05-17 engine-flutter-autoroll@skia.org Roll Flutter Engine from d575e511f9e5 to a19d3722922d (2 revisions) (flutter/flutter#148534)
2024-05-17 engine-flutter-autoroll@skia.org Roll Flutter Engine from 8d1a1d8d7b48 to d575e511f9e5 (5 revisions) (flutter/flutter#148529)
2024-05-17 engine-flutter-autoroll@skia.org Manual roll Flutter Engine from 6fa734d68688 to 8d1a1d8d7b48 (8 revisions) (flutter/flutter#148528)
2024-05-17 32538273+ValentinVignal@users.noreply.github.com Add test for material_banner.0.dart and material_banner.1.dart (flutter/flutter#148452)
2024-05-17 nate.w5687@gmail.com `switch` statement cleanup (flutter/flutter#148382)
2024-05-16 goderbauer@google.com const vs. non-const widget build benchmark (flutter/flutter#148261)
2024-05-16 49699333+dependabot[bot]@users.noreply.github.com Bump actions/checkout from 4.1.5 to 4.1.6 (flutter/flutter#148516)
2024-05-16 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Roll Flutter Engine from 6fa734d68688 to 1850def2ccff (1 revision) (#148507)" (flutter/flutter#148517)
2024-05-16 stuartmorgan@google.com Add PrivacyInfo.xcprivacy to plugin template (flutter/flutter#148485)
2024-05-16 stuartmorgan@google.com Fix iOS reference in macOS Cocoapods error (flutter/flutter#148506)
2024-05-16 engine-flutter-autoroll@skia.org Roll Flutter Engine from 6fa734d68688 to 1850def2ccff (1 revision) (flutter/flutter#148507)
2024-05-16 engine-flutter-autoroll@skia.org Roll Flutter Engine from 460df6caef0e to 6fa734d68688 (4 revisions) (flutter/flutter#148500)
2024-05-16 nate.w5687@gmail.com Enhanced enum features for `AnimationStatus` (flutter/flutter#147801)
2024-05-16 matej.knopp@gmail.com [macOS] codesign native assets during embed (flutter/flutter#148310)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC rmistry@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
TecHaxter pushed a commit to TecHaxter/flutter_packages that referenced this pull request May 22, 2024
…r#6753)

flutter/flutter@0d22d91...00425ef

2024-05-17 engine-flutter-autoroll@skia.org Roll Flutter Engine from d575e511f9e5 to a19d3722922d (2 revisions) (flutter/flutter#148534)
2024-05-17 engine-flutter-autoroll@skia.org Roll Flutter Engine from 8d1a1d8d7b48 to d575e511f9e5 (5 revisions) (flutter/flutter#148529)
2024-05-17 engine-flutter-autoroll@skia.org Manual roll Flutter Engine from 6fa734d68688 to 8d1a1d8d7b48 (8 revisions) (flutter/flutter#148528)
2024-05-17 32538273+ValentinVignal@users.noreply.github.com Add test for material_banner.0.dart and material_banner.1.dart (flutter/flutter#148452)
2024-05-17 nate.w5687@gmail.com `switch` statement cleanup (flutter/flutter#148382)
2024-05-16 goderbauer@google.com const vs. non-const widget build benchmark (flutter/flutter#148261)
2024-05-16 49699333+dependabot[bot]@users.noreply.github.com Bump actions/checkout from 4.1.5 to 4.1.6 (flutter/flutter#148516)
2024-05-16 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Roll Flutter Engine from 6fa734d68688 to 1850def2ccff (1 revision) (#148507)" (flutter/flutter#148517)
2024-05-16 stuartmorgan@google.com Add PrivacyInfo.xcprivacy to plugin template (flutter/flutter#148485)
2024-05-16 stuartmorgan@google.com Fix iOS reference in macOS Cocoapods error (flutter/flutter#148506)
2024-05-16 engine-flutter-autoroll@skia.org Roll Flutter Engine from 6fa734d68688 to 1850def2ccff (1 revision) (flutter/flutter#148507)
2024-05-16 engine-flutter-autoroll@skia.org Roll Flutter Engine from 460df6caef0e to 6fa734d68688 (4 revisions) (flutter/flutter#148500)
2024-05-16 nate.w5687@gmail.com Enhanced enum features for `AnimationStatus` (flutter/flutter#147801)
2024-05-16 matej.knopp@gmail.com [macOS] codesign native assets during embed (flutter/flutter#148310)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC rmistry@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add blank Required Reason API xcprivacy manifest to plugin template for new plugins
3 participants