Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. #!/usr/bin/swift sh
  2.  
  3. import Foundation
  4. import Path // mxcl/Path.swift ~> 0.16
  5.  
  6. print("Current Directory:", Path.cwd)
  7.  
  8. extension Array where Element == Entry {
  9. var frameworks: [Path] {
  10. return directories.frameworks
  11. }
  12. }
  13.  
  14. extension Array where Element == Path {
  15. var frameworks: [Path] {
  16. return filter({$0.string.hasSuffix(".framework")})
  17. }
  18. }
  19.  
  20. let carthage = Path.cwd/"Carthage/Build/iOS"
  21.  
  22. func filelist(_ file: Path, with prefix: String) throws {
  23. var inputList: [String] = []
  24. try carthage.ls().frameworks.forEach { entry in
  25. if let filename = entry.components.last {
  26. inputList.append(prefix + filename)
  27. }
  28. }
  29. if !inputList.isEmpty {
  30. try inputList.sorted().joined(separator: "\n").write(to: file)
  31. print(file, "created")
  32. }
  33. }
  34.  
  35. try filelist(Path.cwd/"Carthage/input.xcfilelist",
  36. with: "$(SRCROOT)/Carthage/Build/iOS/")
  37.  
  38. try filelist(Path.cwd/"Carthage/output.xcfilelist",
  39. with: "$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement