Uh oh!
There was an error while loading. Please reload this page.
forked from 42Box/iOS
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProject.swift
More file actions
Latest commit
124 lines (108 loc) · 4.07 KB
/
Copy pathProject.swift
File metadata and controls
124 lines (108 loc) · 4.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
import ProjectDescription
// MARK: - Project Factory
protocolProjectFactory{
varprojectName:String{get}
vardependencies:[TargetDependency]{get}
func generateTarget()->[Target]
}
// MARK: - iBox Factory
classiBoxFactory:ProjectFactory{
letprojectName:String="iBox"
letbundleId:String="com.box42.iBox"
letiosVersion:String="15.0"
letdependencies:[TargetDependency]=[
.external(name:"SnapKit"),
.external(name:"SwiftSoup"),
.external(name:"SkeletonView"),
.target(name:"iBoxShareExtension")
]
letiBoxShareExtensionDependencies:[TargetDependency]=[
.external(name:"SnapKit")
]
privateletappInfoPlist:[String:Plist.Value]=[
"ITSAppUsesNonExemptEncryption":false,
"CFBundleDisplayName":"iBox",
"CFBundleName":"iBox",
"CFBundleShortVersionString":"1.0.0",
"CFBundleVersion":"1",
"UILaunchStoryboardName":"LaunchScreen",
"UIApplicationSceneManifest":[
"UIApplicationSupportsMultipleScenes":false,
"UISceneConfigurations":[
"UIWindowSceneSessionRoleApplication":[
[
"UISceneConfigurationName":"Default Configuration",
"UISceneDelegateClassName":"$(PRODUCT_MODULE_NAME).SceneDelegate"
],
]
]
],
"CFBundleURLTypes":[
[
"CFBundleURLName":"com.url.iBox",
"CFBundleURLSchemes":["iBox"],
"CFBundleTypeRole":"Editor"
]
],
"NSAppTransportSecurity":[
"NSAllowsArbitraryLoadsInWebContent":true
]
]
privateletshareExtensionInfoPlist:[String:Plist.Value]=[
"CFBundleDisplayName":"iBox.Share",
"CFBundleShortVersionString":"1.0.0",
"CFBundleVersion":"1",
"NSExtension":[
"NSExtensionAttributes":[
"NSExtensionActivationRule":[
"NSExtensionActivationSupportsWebPageWithMaxCount":1,
"NSExtensionActivationSupportsWebURLWithMaxCount":1,
"SUBQUERY":[
"extensionItems":[
"SUBQUERY":[
"attachments":[
"ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO 'public.data'":"TRUE"
],
"@count":1
]
],
"@count":1
]
]
],
"NSExtensionPointIdentifier":"com.apple.share-services",
"NSExtensionPrincipalClass":"$(PRODUCT_MODULE_NAME).CustomShareViewController"
]
]
func generateTarget()->[ProjectDescription.Target]{
letappTarget=Target(
name: projectName,
destinations:.iOS,
product:.app,
bundleId: bundleId,
deploymentTargets:.iOS(iosVersion),
infoPlist:.extendingDefault(with: appInfoPlist),
sources:["\(projectName)/Sources/**"],
resources:"\(projectName)/Resources/**",
dependencies: dependencies
)
letshareExtensionTarget=Target(
name:"\(projectName)ShareExtension",
destinations:.iOS,
product:.appExtension,
bundleId:"\(bundleId).ShareExtension",
deploymentTargets:.iOS(iosVersion),
infoPlist:.extendingDefault(with: shareExtensionInfoPlist),
sources:["ShareExtension/Sources/**"],
resources:["ShareExtension/Resources/**"],
dependencies: iBoxShareExtensionDependencies
)
return[appTarget, shareExtensionTarget]
}
}
// MARK: - Project
letfactory=iBoxFactory()
letproject:Project=.init(
name: factory.projectName,
targets: factory.generateTarget()
)