File tree Expand file tree Collapse file tree 4 files changed +113
-0
lines changed Expand file tree Collapse file tree 4 files changed +113
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ let package = Package(
26
26
. executable( name: " zip-builder " , targets: [ " ZipBuilder " ] ) ,
27
27
. executable( name: " podspecs-tester " , targets: [ " PodspecsTester " ] ) ,
28
28
. executable( name: " manifest " , targets: [ " ManifestParser " ] ) ,
29
+ . executable( name: " privacy-manifest-generator " , targets: [ " PrivacyManifestGenerator " ] ) ,
29
30
] ,
30
31
dependencies: [
31
32
. package ( url: " https://github.com/apple/swift-argument-parser " , . exact( " 0.1.0 " ) ) ,
@@ -53,5 +54,12 @@ let package = Package(
53
54
. target(
54
55
name: " Utils "
55
56
) ,
57
+ . target(
58
+ name: " PrivacyManifestGenerator " ,
59
+ dependencies: [ " ArgumentParser " , " PrivacyKit " ]
60
+ ) ,
61
+ . target(
62
+ name: " PrivacyKit "
63
+ ) ,
56
64
]
57
65
)
Original file line number Diff line number Diff line change
1
+ // Copyright 2023 Google LLC
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ import Foundation
16
+
17
+ /// Represents a Privacy Manifest as described in
18
+ /// https://developer.apple.com/documentation/bundleresources/privacy_manifest_files
19
+ public struct PrivacyManifest {
20
+ public init ( ) { }
21
+ }
Original file line number Diff line number Diff line change
1
+ // Copyright 2023 Google LLC
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ import Foundation
16
+ import PrivacyKit
17
+
18
+ /// Provides an API to walk the client through the creation of a Privacy
19
+ /// Manifest via a series of questions.
20
+ final class PrivacyManifestWizard {
21
+ private let xcframework : URL
22
+
23
+ init ( xcframework: URL ) {
24
+ self . xcframework = xcframework
25
+ }
26
+
27
+ func nextQuestion( ) -> String ? {
28
+ // TODO(ncooke3): Implement.
29
+ nil
30
+ }
31
+
32
+ func processAnswer( _ answer: String ) throws {
33
+ // TODO(ncooke3): Implement.
34
+ }
35
+
36
+ func createManifest( ) throws -> PrivacyManifest {
37
+ // TODO(ncooke3): Implement.
38
+ return PrivacyManifest ( )
39
+ }
40
+ }
Original file line number Diff line number Diff line change
1
+ // Copyright 2023 Google LLC
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ import ArgumentParser
16
+ import Foundation
17
+
18
+ struct PrivacyManifestGenerator : ParsableCommand {
19
+ @Argument (
20
+ help: ArgumentHelp ( " The xcframework to create the Privacy Manifest for. " ) ,
21
+ transform: URL . init ( fileURLWithPath: )
22
+ )
23
+ var xcframework : URL
24
+
25
+ func validate( ) throws {
26
+ guard xcframework. pathExtension == " xcframework " else {
27
+ throw ValidationError ( " Given path does not end in `.xcframework`: \( xcframework. path) " )
28
+ }
29
+ }
30
+
31
+ func run( ) throws {
32
+ let wizard = PrivacyManifestWizard ( xcframework: xcframework)
33
+
34
+ while let question = wizard. nextQuestion ( ) {
35
+ print ( question)
36
+ if let answer = readLine ( ) {
37
+ try wizard. processAnswer ( answer)
38
+ }
39
+ }
40
+
41
+ let privacyManifest = try wizard. createManifest ( )
42
+ print ( privacyManifest)
43
+ }
44
+ }
You can’t perform that action at this time.
0 commit comments