mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Add PrivacyInfo.xcprivacy to macOS plugin template (#155570)
macOS version of https://github.com/flutter/flutter/pull/148485 without NSPrivacyAccessedAPITypes. Fixes https://github.com/flutter/flutter/issues/155563
This commit is contained in:
parent
52d8d0715c
commit
9d42f826d7
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>NSPrivacyTrackingDomains</key>
|
||||
<array/>
|
||||
<key>NSPrivacyCollectedDataTypes</key>
|
||||
<array/>
|
||||
<key>NSPrivacyTracking</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</plist>
|
@ -26,6 +26,18 @@ Pod::Spec.new do |s|
|
||||
{{^withSwiftPackageManager}}
|
||||
s.source_files = 'Classes/**/*'
|
||||
{{/withSwiftPackageManager}}
|
||||
|
||||
# If your plugin requires a privacy manifest, for example if it collects user
|
||||
# data, update the PrivacyInfo.xcprivacy file to describe your plugin's
|
||||
# privacy impact, and then uncomment this line. For more information,
|
||||
# see https://developer.apple.com/documentation/bundleresources/privacy_manifest_files
|
||||
{{#withSwiftPackageManager}}
|
||||
# s.resource_bundles = {'{{projectName}}_privacy' => ['{{projectName}}/Sources/{{projectName}}/PrivacyInfo.xcprivacy']}
|
||||
{{/withSwiftPackageManager}}
|
||||
{{^withSwiftPackageManager}}
|
||||
# s.resource_bundles = {'{{projectName}}_privacy' => ['Resources/PrivacyInfo.xcprivacy']}
|
||||
{{/withSwiftPackageManager}}
|
||||
|
||||
s.dependency 'FlutterMacOS'
|
||||
|
||||
s.platform = :osx, '10.11'
|
||||
|
@ -17,7 +17,15 @@ let package = Package(
|
||||
name: "{{projectName}}",
|
||||
dependencies: [],
|
||||
resources: [
|
||||
.process("Resources"),
|
||||
// If your plugin requires a privacy manifest, for example if it collects user
|
||||
// data, 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("PrivacyInfo.xcprivacy"),
|
||||
|
||||
// If you have other resources that need to be bundled with your plugin, refer to
|
||||
// the following instructions to add them:
|
||||
// https://developer.apple.com/documentation/xcode/bundling-resources-with-a-swift-package
|
||||
]
|
||||
)
|
||||
]
|
||||
|
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>NSPrivacyTrackingDomains</key>
|
||||
<array/>
|
||||
<key>NSPrivacyCollectedDataTypes</key>
|
||||
<array/>
|
||||
<key>NSPrivacyTracking</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</plist>
|
@ -339,6 +339,7 @@
|
||||
"templates/plugin_cocoapods/ios.tmpl/Assets/.gitkeep",
|
||||
"templates/plugin_cocoapods/ios.tmpl/Resources/PrivacyInfo.xcprivacy",
|
||||
"templates/plugin_cocoapods/macos.tmpl/Classes/pluginClass.swift.tmpl",
|
||||
"templates/plugin_cocoapods/macos.tmpl/Resources/PrivacyInfo.xcprivacy",
|
||||
|
||||
"templates/plugin_swift_package_manager/ios-objc.tmpl/projectName.tmpl/Sources/projectName.tmpl/include/projectName.tmpl/pluginClass.h.tmpl",
|
||||
"templates/plugin_swift_package_manager/ios-objc.tmpl/projectName.tmpl/Sources/projectName.tmpl/pluginClass.m.tmpl",
|
||||
@ -349,6 +350,7 @@
|
||||
"templates/plugin_swift_package_manager/macos.tmpl/projectName.tmpl/Sources/projectName.tmpl/Resources/.gitkeep",
|
||||
"templates/plugin_swift_package_manager/macos.tmpl/projectName.tmpl/Sources/projectName.tmpl/pluginClass.swift.tmpl",
|
||||
"templates/plugin_swift_package_manager/macos.tmpl/projectName.tmpl/Package.swift.tmpl",
|
||||
"templates/plugin_swift_package_manager/macos.tmpl/projectName.tmpl/Sources/projectName.tmpl/PrivacyInfo.xcprivacy",
|
||||
|
||||
"templates/skeleton/assets/images/2.0x/flutter_logo.png.img.tmpl",
|
||||
"templates/skeleton/assets/images/3.0x/flutter_logo.png.img.tmpl",
|
||||
|
@ -712,7 +712,7 @@ void main() {
|
||||
testUsingContext('kotlin/swift plugin project without Swift Package Manager', () async {
|
||||
return _createProject(
|
||||
projectDir,
|
||||
<String>['--no-pub', '--template=plugin', '-a', 'kotlin', '--ios-language', 'swift', '--platforms', 'ios,android'],
|
||||
<String>['--no-pub', '--template=plugin', '-a', 'kotlin', '--ios-language', 'swift', '--platforms', 'android,ios,macos'],
|
||||
<String>[
|
||||
'analysis_options.yaml',
|
||||
'android/src/main/kotlin/com/example/flutter_project/FlutterProjectPlugin.kt',
|
||||
@ -722,6 +722,8 @@ void main() {
|
||||
'example/lib/main.dart',
|
||||
'ios/Classes/FlutterProjectPlugin.swift',
|
||||
'ios/Resources/PrivacyInfo.xcprivacy',
|
||||
'macos/Classes/FlutterProjectPlugin.swift',
|
||||
'macos/Resources/PrivacyInfo.xcprivacy',
|
||||
'lib/flutter_project.dart',
|
||||
],
|
||||
unexpectedPaths: <String>[
|
||||
@ -736,7 +738,7 @@ void main() {
|
||||
);
|
||||
}, overrides: <Type, Generator>{
|
||||
// Test flags disable Swift Package Manager.
|
||||
FeatureFlags: () => TestFeatureFlags(),
|
||||
FeatureFlags: () => TestFeatureFlags(isMacOSEnabled: true),
|
||||
});
|
||||
|
||||
testUsingContext('swift plugin project with Swift Package Manager', () async {
|
||||
@ -749,7 +751,7 @@ void main() {
|
||||
'ios/flutter_project/Sources/flutter_project/PrivacyInfo.xcprivacy',
|
||||
'macos/flutter_project/Package.swift',
|
||||
'macos/flutter_project/Sources/flutter_project/FlutterProjectPlugin.swift',
|
||||
'macos/flutter_project/Sources/flutter_project/Resources/.gitkeep',
|
||||
'macos/flutter_project/Sources/flutter_project/PrivacyInfo.xcprivacy',
|
||||
],
|
||||
unexpectedPaths: <String>[
|
||||
'ios/Classes/FlutterProjectPlugin.swift',
|
||||
|
Loading…
Reference in New Issue
Block a user