@@ -16,6 +16,67 @@ public final class PBXCopyFilesBuildPhase: PBXBuildPhase {
1616 case other
1717 }
1818
19+ public enum DstSubfolder : Equatable , Decodable {
20+ case absolutePath
21+ case productsDirectory
22+ case wrapper
23+ case executables
24+ case resources
25+ case javaResources
26+ case frameworks
27+ case sharedFrameworks
28+ case sharedSupport
29+ case plugins
30+ case other
31+ case product
32+ case none
33+ case unknown( String )
34+
35+ public init ( rawValue: String ) {
36+ switch rawValue {
37+ case " AbsolutePath " : self = . absolutePath
38+ case " ProductsDirectory " : self = . productsDirectory
39+ case " Wrapper " : self = . wrapper
40+ case " Executables " : self = . executables
41+ case " Resources " : self = . resources
42+ case " JavaResources " : self = . javaResources
43+ case " Frameworks " : self = . frameworks
44+ case " SharedFrameworks " : self = . sharedFrameworks
45+ case " SharedSupport " : self = . sharedSupport
46+ case " PlugIns " : self = . plugins
47+ case " Other " : self = . other
48+ case " Product " : self = . product
49+ case " None " : self = . none
50+ default : self = . unknown( rawValue)
51+ }
52+ }
53+
54+ public var rawValue : String {
55+ switch self {
56+ case . absolutePath: " AbsolutePath "
57+ case . productsDirectory: " ProductsDirectory "
58+ case . wrapper: " Wrapper "
59+ case . executables: " Executables "
60+ case . resources: " Resources "
61+ case . javaResources: " JavaResources "
62+ case . frameworks: " Frameworks "
63+ case . sharedFrameworks: " SharedFrameworks "
64+ case . sharedSupport: " SharedSupport "
65+ case . plugins: " PlugIns "
66+ case . other: " Other "
67+ case . product: " Product "
68+ case . none: " None "
69+ case let . unknown( rawValue) : rawValue
70+ }
71+ }
72+
73+ public init ( from decoder: Decoder ) throws {
74+ let container = try decoder. singleValueContainer ( )
75+ let rawValue = try container. decode ( String . self)
76+ self = . init( rawValue: rawValue)
77+ }
78+ }
79+
1980 // MARK: - Attributes
2081
2182 /// Element destination path
@@ -24,6 +85,8 @@ public final class PBXCopyFilesBuildPhase: PBXBuildPhase {
2485 /// Element destination subfolder spec
2586 public var dstSubfolderSpec : SubFolder ?
2687
88+ public var dstSubfolder : DstSubfolder ?
89+
2790 /// Copy files build phase name
2891 public var name : String ?
2992
@@ -38,17 +101,20 @@ public final class PBXCopyFilesBuildPhase: PBXBuildPhase {
38101 /// - Parameters:
39102 /// - dstPath: Destination path.
40103 /// - dstSubfolderSpec: Destination subfolder spec.
104+ /// - dstSubfolder: Destination subfolder.
41105 /// - buildActionMask: Build action mask.
42106 /// - files: Build files to copy.
43107 /// - runOnlyForDeploymentPostprocessing: Run only for deployment post processing.
44108 public init ( dstPath: String ? = nil ,
45109 dstSubfolderSpec: SubFolder ? = nil ,
110+ dstSubfolder: DstSubfolder ? = nil ,
46111 name: String ? = nil ,
47112 buildActionMask: UInt = defaultBuildActionMask,
48113 files: [ PBXBuildFile ] = [ ] ,
49114 runOnlyForDeploymentPostprocessing: Bool = false ) {
50115 self . dstPath = dstPath
51116 self . dstSubfolderSpec = dstSubfolderSpec
117+ self . dstSubfolder = dstSubfolder
52118 self . name = name
53119 super. init ( files: files,
54120 buildActionMask: buildActionMask,
@@ -61,13 +127,15 @@ public final class PBXCopyFilesBuildPhase: PBXBuildPhase {
61127 fileprivate enum CodingKeys : String , CodingKey {
62128 case dstPath
63129 case dstSubfolderSpec
130+ case dstSubfolder
64131 case name
65132 }
66133
67134 public required init ( from decoder: Decoder ) throws {
68135 let container = try decoder. container ( keyedBy: CodingKeys . self)
69136 dstPath = try container. decodeIfPresent ( . dstPath)
70137 dstSubfolderSpec = try container. decodeIntIfPresent ( . dstSubfolderSpec) . flatMap ( SubFolder . init)
138+ dstSubfolder = try container. decodeIfPresent ( . dstSubfolder)
71139 name = try container. decodeIfPresent ( . name)
72140 try super. init ( from: decoder)
73141 }
@@ -93,6 +161,9 @@ extension PBXCopyFilesBuildPhase: PlistSerializable {
93161 if let dstSubfolderSpec {
94162 dictionary [ " dstSubfolderSpec " ] = . string( CommentedString ( " \( dstSubfolderSpec. rawValue) " ) )
95163 }
164+ if let dstSubfolder {
165+ dictionary [ " dstSubfolder " ] = . string( CommentedString ( " \( dstSubfolder. rawValue) " ) )
166+ }
96167 return ( key: CommentedString ( reference, comment: name ?? " CopyFiles " ) , value: . dictionary( dictionary) )
97168 }
98169}
0 commit comments