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

Adding Apple Privacy Manifest #550

Open
wants to merge 10 commits into
base: stable
Choose a base branch
from
11 changes: 7 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.0
// swift-tools-version:5.3

import PackageDescription

Expand All @@ -14,9 +14,12 @@ let package = Package(

targets: [
.target(
name: "Swifter",
dependencies: [],
path: "Xcode/Sources"
name: "Swifter",
dependencies: [],
path: "Xcode/Sources",
resources: [
.copy("../Resources/PrivacyInfo.xcprivacy")
]
),

.target(
Expand Down
38 changes: 38 additions & 0 deletions [email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// swift-tools-version:5.0

import PackageDescription

let package = Package(
name: "Swifter",

products: [
.library(name: "Swifter", targets: ["Swifter"]),
.executable(name: "SwifterExample", targets: ["SwifterExample"])
],

dependencies: [],

targets: [
.target(
name: "Swifter",
dependencies: [],
path: "Xcode/Sources"
),

.target(
name: "SwifterExample",
dependencies: [
"Swifter"
],
path: "SwifterExample"
),

.testTarget(
name: "SwifterTests",
dependencies: [
"Swifter"
],
path: "Xcode/Tests"
)
]
)
1 change: 1 addition & 0 deletions Swifter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ Pod::Spec.new do |s|
s.source = { :git => "https://github.com/httpswift/swifter.git", :tag => "1.5.0" }
s.source_files = 'Xcode/Sources/*.{swift}'
s.swift_version = '5.0'
s.resource_bundles = {'Swifter' => ['Xcode/Resources/PrivacyInfo.xcprivacy']}

Choose a reason for hiding this comment

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

Could we add spaces after { and before } for better consistency? For example:

{ 'Swifter' => ['Xcode/Resources/PrivacyInfo.xcprivacy'] }


end
17 changes: 17 additions & 0 deletions Xcode/Resources/PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?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>NSPrivacyAccessedAPITypes</key>

Choose a reason for hiding this comment

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

This will also need to include the other required keys, even with empty values

<key>NSPrivacyTracking</key>
<false/>
<key>NSPrivacyTrackingDomains</key>
<array/>
<key>NSPrivacyCollectedDataTypes</key>
<array/>

<array>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>C617.1</string>
</array>
</dict>
</array>
</dict>
</plist>
6 changes: 6 additions & 0 deletions Xcode/Swifter.xcodeproj/project.pbxproj
haniewais marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
269B47981D3AAAE20042D137 /* Errno.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C76B2A11D369C9D00D35BFB /* Errno.swift */; };
269B47991D3AAAE20042D137 /* String+BASE64.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C76B6F61D2C44F30030FC98 /* String+BASE64.swift */; };
269B47A71D3AAC4F0042D137 /* SwiftertvOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 269B47A51D3AAC4F0042D137 /* SwiftertvOS.h */; settings = {ATTRIBUTES = (Public, ); }; };
3768D9FA2BA7884700A70E4E /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 3768D9F92BA7884700A70E4E /* PrivacyInfo.xcprivacy */; };
3768D9FB2BA7884700A70E4E /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 3768D9F92BA7884700A70E4E /* PrivacyInfo.xcprivacy */; };
39BFCFFA26E4F0A000A6D7BF /* FilesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39BFCFF926E4F0A000A6D7BF /* FilesTests.swift */; };
39BFCFFB26E4F0A000A6D7BF /* FilesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39BFCFF926E4F0A000A6D7BF /* FilesTests.swift */; };
39BFCFFC26E4F0A000A6D7BF /* FilesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39BFCFF926E4F0A000A6D7BF /* FilesTests.swift */; };
Expand Down Expand Up @@ -177,6 +179,7 @@
269B47A11D3AAAE20042D137 /* Swifter.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Swifter.framework; sourceTree = BUILT_PRODUCTS_DIR; };
269B47A41D3AAC4F0042D137 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
269B47A51D3AAC4F0042D137 /* SwiftertvOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SwiftertvOS.h; sourceTree = "<group>"; };
3768D9F92BA7884700A70E4E /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
39BFCFF926E4F0A000A6D7BF /* FilesTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FilesTests.swift; sourceTree = "<group>"; };
540CA839228F275B00A3AF9B /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
540CA83A228F275B00A3AF9B /* CHANGELOG.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; name = CHANGELOG.md; path = ../CHANGELOG.md; sourceTree = "<group>"; };
Expand Down Expand Up @@ -408,6 +411,7 @@
7CA4815619A2EF2B0030B30D /* Resources */ = {
isa = PBXGroup;
children = (
3768D9F92BA7884700A70E4E /* PrivacyInfo.xcprivacy */,
7CB102DF1A17381D00CBA3B4 /* logo.png */,
);
path = Resources;
Expand Down Expand Up @@ -723,6 +727,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
3768D9FB2BA7884700A70E4E /* PrivacyInfo.xcprivacy in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -740,6 +745,7 @@
7AE8940D1C05151100A29F63 /* Launch Screen.storyboard in Resources */,
7CB102E01A17381D00CBA3B4 /* logo.png in Resources */,
7CDAB8141BE2A1D400C8A977 /* Images.xcassets in Resources */,
3768D9FA2BA7884700A70E4E /* PrivacyInfo.xcprivacy in Resources */,
7CDAB8131BE2A1D400C8A977 /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
6 changes: 3 additions & 3 deletions Xcode/Tests/FilesTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class FilesTests: XCTestCase {
let closure = shareFile(temporaryDirectoryURL.appendingPathComponent("does_not_exist").path)
let result = closure(request)

XCTAssert(result == .notFound)
XCTAssert(result == .notFound())
}

func testShareFilesFromDirectory() {
Expand All @@ -77,7 +77,7 @@ class FilesTests: XCTestCase {
let closure = shareFilesFromDirectory(temporaryDirectoryURL.path)
let result = closure(request)

XCTAssert(result == .notFound)
XCTAssert(result == .notFound())
}

func testDirectoryBrowser() {
Expand All @@ -95,6 +95,6 @@ class FilesTests: XCTestCase {
let closure = directoryBrowser(temporaryDirectoryURL.path)
let result = closure(request)

XCTAssert(result == .notFound)
XCTAssert(result == .notFound())
}
}
Loading