@@ -2,7 +2,9 @@ import Foundation
22
33/// This is the element for the copy file build phase.
44public final class PBXCopyFilesBuildPhase : PBXBuildPhase {
5- public enum SubFolder : UInt , Decodable {
5+
6+ @available ( * , deprecated, renamed: " SubFolder " , message: " May become obsolete in the future in favor of dstSubfolder " )
7+ public enum SubFolderSpec : UInt , Decodable {
68 case absolutePath = 0
79 case productsDirectory = 16
810 case wrapper = 1
@@ -15,14 +17,32 @@ public final class PBXCopyFilesBuildPhase: PBXBuildPhase {
1517 case plugins = 13
1618 case other
1719 }
20+
21+ public enum SubFolder : String , Decodable {
22+ case absolutePath = " AbsolutePath "
23+ case productsDirectory = " ProductsDirectory "
24+ case wrapper = " Wrapper "
25+ case executables = " Executables "
26+ case resources = " Resources "
27+ case javaResources = " JavaResources "
28+ case frameworks = " Frameworks "
29+ case sharedFrameworks = " SharedFrameworks "
30+ case sharedSupport = " SharedSupport "
31+ case plugins = " PlugIns "
32+ case other = " Other "
33+ case product = " Product "
34+ case none = " None "
35+ }
1836
1937 // MARK: - Attributes
2038
2139 /// Element destination path
2240 public var dstPath : String ?
2341
2442 /// Element destination subfolder spec
25- public var dstSubfolderSpec : SubFolder ?
43+ public var dstSubfolderSpec : SubFolderSpec ?
44+
45+ public var dstSubfolder : SubFolder ?
2646
2747 /// Copy files build phase name
2848 public var name : String ?
@@ -42,13 +62,15 @@ public final class PBXCopyFilesBuildPhase: PBXBuildPhase {
4262 /// - files: Build files to copy.
4363 /// - runOnlyForDeploymentPostprocessing: Run only for deployment post processing.
4464 public init ( dstPath: String ? = nil ,
45- dstSubfolderSpec: SubFolder ? = nil ,
65+ dstSubfolderSpec: SubFolderSpec ? = nil ,
66+ dstSubfolder: SubFolder ? = nil ,
4667 name: String ? = nil ,
4768 buildActionMask: UInt = defaultBuildActionMask,
4869 files: [ PBXBuildFile ] = [ ] ,
4970 runOnlyForDeploymentPostprocessing: Bool = false ) {
5071 self . dstPath = dstPath
5172 self . dstSubfolderSpec = dstSubfolderSpec
73+ self . dstSubfolder = dstSubfolder
5274 self . name = name
5375 super. init ( files: files,
5476 buildActionMask: buildActionMask,
@@ -61,13 +83,15 @@ public final class PBXCopyFilesBuildPhase: PBXBuildPhase {
6183 fileprivate enum CodingKeys : String , CodingKey {
6284 case dstPath
6385 case dstSubfolderSpec
86+ case dstSubfolder
6487 case name
6588 }
6689
6790 public required init ( from decoder: Decoder ) throws {
6891 let container = try decoder. container ( keyedBy: CodingKeys . self)
6992 dstPath = try container. decodeIfPresent ( . dstPath)
70- dstSubfolderSpec = try container. decodeIntIfPresent ( . dstSubfolderSpec) . flatMap ( SubFolder . init)
93+ dstSubfolderSpec = try container. decodeIntIfPresent ( . dstSubfolderSpec) . flatMap ( SubFolderSpec . init)
94+ dstSubfolder = try container. decodeIfPresent ( . dstSubfolder)
7195 name = try container. decodeIfPresent ( . name)
7296 try super. init ( from: decoder)
7397 }
@@ -93,6 +117,9 @@ extension PBXCopyFilesBuildPhase: PlistSerializable {
93117 if let dstSubfolderSpec {
94118 dictionary [ " dstSubfolderSpec " ] = . string( CommentedString ( " \( dstSubfolderSpec. rawValue) " ) )
95119 }
120+ if let dstSubfolder {
121+ dictionary [ " dstSubfolder " ] = . string( CommentedString ( " \( dstSubfolder. rawValue) " ) )
122+ }
96123 return ( key: CommentedString ( reference, comment: name ?? " CopyFiles " ) , value: . dictionary( dictionary) )
97124 }
98125}
0 commit comments