Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/swift sh
- import Foundation
- import Path // mxcl/Path.swift ~> 0.16
- print("Current Directory:", Path.cwd)
- extension Array where Element == Entry {
- var frameworks: [Path] {
- return directories.frameworks
- }
- }
- extension Array where Element == Path {
- var frameworks: [Path] {
- return filter({$0.string.hasSuffix(".framework")})
- }
- }
- let carthage = Path.cwd/"Carthage/Build/iOS"
- func filelist(_ file: Path, with prefix: String) throws {
- var inputList: [String] = []
- try carthage.ls().frameworks.forEach { entry in
- if let filename = entry.components.last {
- inputList.append(prefix + filename)
- }
- }
- if !inputList.isEmpty {
- try inputList.sorted().joined(separator: "\n").write(to: file)
- print(file, "created")
- }
- }
- try filelist(Path.cwd/"Carthage/input.xcfilelist",
- with: "$(SRCROOT)/Carthage/Build/iOS/")
- try filelist(Path.cwd/"Carthage/output.xcfilelist",
- with: "$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement