From 9efe8be9e9071ce2349b014a9fd29707dd82ecd1 Mon Sep 17 00:00:00 2001 From: Olivier Halligon Date: Tue, 13 Oct 2015 04:47:39 +0200 Subject: [PATCH] Using CocoaPods and a Development Pod --- Podfile | 11 +- .../Commander/ArgumentConvertible.swift | 89 ++ .../Commander/ArgumentDescription.swift | 236 +++++ Pods/Commander/Commander/ArgumentParser.swift | 236 +++++ Pods/Commander/Commander/Command.swift | 23 + Pods/Commander/Commander/CommandDarwin.swift | 39 + Pods/Commander/Commander/CommandType.swift | 14 + Pods/Commander/Commander/Commander.h | 7 + Pods/Commander/Commander/Commands.swift | 536 +++++++++++ Pods/Commander/Commander/Group.swift | 73 ++ Pods/Commander/LICENSE | 27 + Pods/Commander/README.md | 218 +++++ Pods/Headers/Private/Commander/Commander.h | 1 + Pods/Local Podspecs/SwiftGenKit.podspec.json | 19 + Pods/Manifest.lock | 17 + Pods/Pods.xcodeproj/project.pbxproj | 901 ++++++++++++++++++ .../xcschemes/SwiftGenKit.xcscheme | 60 ++ .../Commander/Commander-dummy.m | 5 + .../Commander/Commander-prefix.pch | 4 + .../Commander/Commander-umbrella.h | 7 + .../Commander/Commander.modulemap | 6 + .../Commander/Commander.xcconfig | 6 + .../Target Support Files/Commander/Info.plist | 26 + .../Pods-SwiftGenKitTests/Info.plist | 26 + ...SwiftGenKitTests-acknowledgements.markdown | 3 + ...ds-SwiftGenKitTests-acknowledgements.plist | 29 + .../Pods-SwiftGenKitTests-dummy.m | 5 + .../Pods-SwiftGenKitTests-frameworks.sh | 91 ++ .../Pods-SwiftGenKitTests-resources.sh | 95 ++ .../Pods-SwiftGenKitTests-umbrella.h | 6 + .../Pods-SwiftGenKitTests.debug.xcconfig | 9 + .../Pods-SwiftGenKitTests.modulemap | 6 + .../Pods-SwiftGenKitTests.release.xcconfig | 9 + .../Pods-swiftgen/Info.plist | 26 + .../Pods-swiftgen-acknowledgements.markdown | 34 + .../Pods-swiftgen-acknowledgements.plist | 64 ++ .../Pods-swiftgen/Pods-swiftgen-dummy.m | 5 + .../Pods-swiftgen/Pods-swiftgen-frameworks.sh | 93 ++ .../Pods-swiftgen/Pods-swiftgen-resources.sh | 95 ++ .../Pods-swiftgen/Pods-swiftgen-umbrella.h | 6 + .../Pods-swiftgen.debug.xcconfig | 9 + .../Pods-swiftgen/Pods-swiftgen.modulemap | 6 + .../Pods-swiftgen.release.xcconfig | 9 + .../SwiftGenKit/Info.plist | 26 + .../SwiftGenKit/SwiftGenKit-dummy.m | 5 + .../SwiftGenKit/SwiftGenKit-prefix.pch | 4 + .../SwiftGenKit/SwiftGenKit-umbrella.h | 6 + .../SwiftGenKit/SwiftGenKit.modulemap | 6 + .../SwiftGenKit/SwiftGenKit.xcconfig | 6 + Rakefile | 5 +- SwiftGen.xcodeproj/project.pbxproj | 528 +++++----- .../xcshareddata/xcschemes/UnitTests.xcscheme | 56 ++ ...n-cli.xcscheme => swiftgen (CLI).xcscheme} | 48 +- SwiftGen.xcworkspace/contents.xcworkspacedata | 10 + .../EnumBuilders/L10nEnumBuilder.swift | 6 +- UnitTests/Assets/AssetsTests.swift | 9 +- ...ft.out => AssetsEntriesDefaults.swift.out} | 0 ...swift.out => AssetsFileDefaults.swift.out} | 0 UnitTests/Colors/ColorsTests.swift | 1 + UnitTests/L10n/L10nTests.swift | 37 +- UnitTests/Storyboard/StoryboardTests.swift | 9 +- .../Storyboard/fixtures/Message.storyboard | 8 +- swiftgen-cli/main.swift | 8 +- 63 files changed, 3653 insertions(+), 312 deletions(-) create mode 100644 Pods/Commander/Commander/ArgumentConvertible.swift create mode 100644 Pods/Commander/Commander/ArgumentDescription.swift create mode 100644 Pods/Commander/Commander/ArgumentParser.swift create mode 100644 Pods/Commander/Commander/Command.swift create mode 100644 Pods/Commander/Commander/CommandDarwin.swift create mode 100644 Pods/Commander/Commander/CommandType.swift create mode 100644 Pods/Commander/Commander/Commander.h create mode 100644 Pods/Commander/Commander/Commands.swift create mode 100644 Pods/Commander/Commander/Group.swift create mode 100644 Pods/Commander/LICENSE create mode 100644 Pods/Commander/README.md create mode 120000 Pods/Headers/Private/Commander/Commander.h create mode 100644 Pods/Local Podspecs/SwiftGenKit.podspec.json create mode 100644 Pods/Manifest.lock create mode 100644 Pods/Pods.xcodeproj/project.pbxproj create mode 100644 Pods/Pods.xcodeproj/xcshareddata/xcschemes/SwiftGenKit.xcscheme create mode 100644 Pods/Target Support Files/Commander/Commander-dummy.m create mode 100644 Pods/Target Support Files/Commander/Commander-prefix.pch create mode 100644 Pods/Target Support Files/Commander/Commander-umbrella.h create mode 100644 Pods/Target Support Files/Commander/Commander.modulemap create mode 100644 Pods/Target Support Files/Commander/Commander.xcconfig create mode 100644 Pods/Target Support Files/Commander/Info.plist create mode 100644 Pods/Target Support Files/Pods-SwiftGenKitTests/Info.plist create mode 100644 Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests-acknowledgements.markdown create mode 100644 Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests-acknowledgements.plist create mode 100644 Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests-dummy.m create mode 100755 Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests-frameworks.sh create mode 100755 Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests-resources.sh create mode 100644 Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests-umbrella.h create mode 100644 Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests.debug.xcconfig create mode 100644 Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests.modulemap create mode 100644 Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests.release.xcconfig create mode 100644 Pods/Target Support Files/Pods-swiftgen/Info.plist create mode 100644 Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen-acknowledgements.markdown create mode 100644 Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen-acknowledgements.plist create mode 100644 Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen-dummy.m create mode 100755 Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen-frameworks.sh create mode 100755 Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen-resources.sh create mode 100644 Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen-umbrella.h create mode 100644 Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen.debug.xcconfig create mode 100644 Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen.modulemap create mode 100644 Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen.release.xcconfig create mode 100644 Pods/Target Support Files/SwiftGenKit/Info.plist create mode 100644 Pods/Target Support Files/SwiftGenKit/SwiftGenKit-dummy.m create mode 100644 Pods/Target Support Files/SwiftGenKit/SwiftGenKit-prefix.pch create mode 100644 Pods/Target Support Files/SwiftGenKit/SwiftGenKit-umbrella.h create mode 100644 Pods/Target Support Files/SwiftGenKit/SwiftGenKit.modulemap create mode 100644 Pods/Target Support Files/SwiftGenKit/SwiftGenKit.xcconfig create mode 100644 SwiftGen.xcodeproj/xcshareddata/xcschemes/UnitTests.xcscheme rename SwiftGen.xcodeproj/xcshareddata/xcschemes/{swiftgen-cli.xcscheme => swiftgen (CLI).xcscheme} (67%) create mode 100644 SwiftGen.xcworkspace/contents.xcworkspacedata rename UnitTests/Assets/expected/{EntriesDefaults.swift.out => AssetsEntriesDefaults.swift.out} (100%) rename UnitTests/Assets/expected/{FileDefaults.swift.out => AssetsFileDefaults.swift.out} (100%) diff --git a/Podfile b/Podfile index 6e0017f5e..8add87fd4 100644 --- a/Podfile +++ b/Podfile @@ -1,8 +1,11 @@ platform :osx, '10.9' use_frameworks! -plugin 'cocoapods-rome' - -pod 'Commander' -pod 'SwiftGenKit', :path => 'SwiftGenKit' +target 'swiftgen' do + pod 'Commander' + pod 'SwiftGenKit', :path => 'SwiftGenKit' +end +target 'SwiftGenKitTests' do + pod 'SwiftGenKit', :path => 'SwiftGenKit' +end diff --git a/Pods/Commander/Commander/ArgumentConvertible.swift b/Pods/Commander/Commander/ArgumentConvertible.swift new file mode 100644 index 000000000..b8774b2ff --- /dev/null +++ b/Pods/Commander/Commander/ArgumentConvertible.swift @@ -0,0 +1,89 @@ +public enum ArgumentError : ErrorType, CustomStringConvertible { + case MissingValue(argument: String?) + + /// Value is not convertible to type + case InvalidType(value:String, type:String, argument:String?) + + /// Unused Argument + case UnusedArgument(String) + + public var description:String { + switch self { + case .MissingValue(let key): + if let key = key { + return "Missing value for `\(key)`" + } + return "Missing argument" + case .InvalidType(let value, let type, let argument): + if let argument = argument { + return "`\(value)` is not a valid `\(type)` for `\(argument)`" + } + return "`\(value)` is not a `\(type)`" + case .UnusedArgument(let argument): + return "Unexpected argument `\(argument)`" + } + } +} + +public protocol ArgumentConvertible : CustomStringConvertible { + /// Initialise the type with an ArgumentParser + init(parser: ArgumentParser) throws +} + +extension String : ArgumentConvertible, CustomStringConvertible { + public init(parser: ArgumentParser) throws { + if let value = parser.shift() { + self.init(value) + } else { + throw ArgumentError.MissingValue(argument: nil) + } + } + + public var description:String { + return self + } +} + +extension Int : ArgumentConvertible { + public init(parser: ArgumentParser) throws { + if let value = parser.shift() { + if let value = Int(value) { + self.init(value) + } else { + throw ArgumentError.InvalidType(value: value, type: "number", argument: nil) + } + } else { + throw ArgumentError.MissingValue(argument: nil) + } + } +} + + +extension Float : ArgumentConvertible { + public init(parser: ArgumentParser) throws { + if let value = parser.shift() { + if let value = Float(value) { + self.init(value) + } else { + throw ArgumentError.InvalidType(value: value, type: "number", argument: nil) + } + } else { + throw ArgumentError.MissingValue(argument: nil) + } + } +} + + +extension Double : ArgumentConvertible { + public init(parser: ArgumentParser) throws { + if let value = parser.shift() { + if let value = Double(value) { + self.init(value) + } else { + throw ArgumentError.InvalidType(value: value, type: "number", argument: nil) + } + } else { + throw ArgumentError.MissingValue(argument: nil) + } + } +} diff --git a/Pods/Commander/Commander/ArgumentDescription.swift b/Pods/Commander/Commander/ArgumentDescription.swift new file mode 100644 index 000000000..617c47001 --- /dev/null +++ b/Pods/Commander/Commander/ArgumentDescription.swift @@ -0,0 +1,236 @@ +public enum ArgumentType { + case Argument + case Option +} + +public protocol ArgumentDescriptor { + typealias ValueType + + /// The arguments name + var name:String { get } + + /// The arguments description + var description:String? { get } + + var type:ArgumentType { get } + + /// Parse the argument + func parse(parser:ArgumentParser) throws -> ValueType +} + +extension ArgumentConvertible { + init(string: String) throws { + try self.init(parser: ArgumentParser(arguments: [string])) + } +} + +public class Argument : ArgumentDescriptor { + public typealias ValueType = T + public typealias Validator = ValueType throws -> ValueType + + public let name:String + public let description:String? + public let validator:Validator? + + public var type:ArgumentType { return .Argument } + + public init(_ name:String, description:String? = nil, validator: Validator? = nil) { + self.name = name + self.description = description + self.validator = validator + } + + public func parse(parser:ArgumentParser) throws -> ValueType { + let value = try T(parser: parser) + + if let validator = validator { + return try validator(value) + } + + return value + } +} + + +public class Option : ArgumentDescriptor { + public typealias ValueType = T + public typealias Validator = ValueType throws -> ValueType + + public let name:String + public let flag:Character? + public let description:String? + public let `default`:ValueType + public var type:ArgumentType { return .Option } + public let validator:Validator? + + public init(_ name:String, _ `default`:ValueType, flag:Character? = nil, description:String? = nil, validator: Validator? = nil) { + self.name = name + self.flag = flag + self.description = description + self.`default` = `default` + self.validator = validator + } + + public func parse(parser:ArgumentParser) throws -> ValueType { + if let value = try parser.shiftValueForOption(name) { + let value = try T(string: value) + + if let validator = validator { + return try validator(value) + } + + return value + } + + if let flag = flag { + if let value = try parser.shiftValueForFlag(flag) { + let value = try T(string: value) + + if let validator = validator { + return try validator(value) + } + + return value + } + } + + return `default` + } +} + +public class Options : ArgumentDescriptor { + public typealias ValueType = [T] + + public let name:String + public let description:String? + public let count:Int + public let `default`:ValueType + public var type:ArgumentType { return .Option } + + public init(_ name:String, _ `default`:ValueType, count: Int, description:String? = nil) { + self.name = name + self.`default` = `default` + self.count = count + self.description = description + } + + public func parse(parser:ArgumentParser) throws -> ValueType { + let values = try parser.shiftValuesForOption(name, count: count) + return try values?.map { try T(string: $0) } ?? `default` + } +} + +public class Flag : ArgumentDescriptor { + public typealias ValueType = Bool + + public let name:String + public let flag:Character? + public let description:String? + public let `default`:ValueType + public var type:ArgumentType { return .Option } + + public init(_ name:String, flag:Character? = nil, description:String? = nil, `default`:Bool = false) { + self.name = name + self.flag = flag + self.description = description + self.`default` = `default` + } + + public func parse(parser:ArgumentParser) throws -> ValueType { + if parser.hasOption("no-\(name)") { + return false + } + + if parser.hasOption(name) { + return true + } + + if let flag = flag { + if parser.hasFlag(flag) { + return true + } + } + + return `default` + } +} + +class BoxedArgumentDescriptor { + let name:String + let description:String? + let `default`:String? + let type:ArgumentType + + init(value:T) { + name = value.name + description = value.description + type = value.type + + if let value = value as? Flag { + `default` = value.`default`.description + } else { + // TODO, default for Option and Options + `default` = nil + } + } +} + +class Help : ErrorType, CustomStringConvertible { + let command:String? + let group:Group? + let descriptors:[BoxedArgumentDescriptor] + + init(_ descriptors:[BoxedArgumentDescriptor], command:String? = nil, group:Group? = nil) { + self.command = command + self.group = group + self.descriptors = descriptors + } + + func reraise(command:String? = nil) -> Help { + if let oldCommand = self.command, newCommand = command { + return Help(descriptors, command: "\(newCommand) \(oldCommand)") + } + return Help(descriptors, command: command ?? self.command) + } + + var description:String { + var output = [String]() + + let arguments = descriptors.filter { $0.type == ArgumentType.Argument } + let options = descriptors.filter { $0.type == ArgumentType.Option } + + if let command = command { + let args = arguments.map { $0.name } + let usage = ([command] + args).joinWithSeparator(" ") + + output.append("Usage:") + output.append("") + output.append(" \(usage)") + output.append("") + } + + if let group = group { + output.append("Commands:") + output.append("") + for (name, _) in group.commands { + output.append(" + \(name)") + } + output.append("") + } + + if !options.isEmpty { + output.append("Options:") + for option in options { + // TODO: default, [default: `\(`default`)`] + + if let description = option.description { + output.append(" --\(option.name) - \(description)") + } else { + output.append(" --\(option.name)") + } + } + } + + return output.joinWithSeparator("\n") + } +} diff --git a/Pods/Commander/Commander/ArgumentParser.swift b/Pods/Commander/Commander/ArgumentParser.swift new file mode 100644 index 000000000..aab9c08da --- /dev/null +++ b/Pods/Commander/Commander/ArgumentParser.swift @@ -0,0 +1,236 @@ +private enum Arg : CustomStringConvertible { + /// A positional argument + case Argument(String) + + /// A boolean like option, `--version`, `--help`, `--no-clean`. + case Option(String) + + /// A flag + case Flag(Set) + + var description:String { + switch self { + case .Argument(let value): + return value + case .Option(let key): + return "--\(key)" + case .Flag(let flags): + return "-\(String(flags))" + } + } + + var type:String { + switch self { + case .Argument: + return "argument" + case .Option: + return "option" + case .Flag: + return "flag" + } + } +} + + +public struct ArgumentParserError : ErrorType, CustomStringConvertible { + public let description:String + + init(description:String) { + self.description = description + } +} + + +public final class ArgumentParser : ArgumentConvertible, CustomStringConvertible { + private var arguments:[Arg] + + /// Initialises the ArgumentParser with an array of arguments + public init(arguments: [String]) { + self.arguments = arguments.map { argument in + if argument.hasPrefix("-") { + let flags = argument[argument.startIndex.successor().. String? { + for (index, argument) in arguments.enumerate() { + switch argument { + case .Argument(let value): + arguments.removeAtIndex(index) + return value + default: + continue + } + } + + return nil + } + + /// Returns the value for an option (--name Kyle, --name=Kyle) + public func shiftValueForOption(name:String) throws -> String? { + return try shiftValuesForOption(name)?.first + } + + /// Returns the value for an option (--name Kyle, --name=Kyle) + public func shiftValuesForOption(name:String, count:Int = 1) throws -> [String]? { + var index = 0 + var hasOption = false + + for argument in arguments { + switch argument { + case .Option(let option): + if option == name { + hasOption = true + break + } + fallthrough + default: + ++index + } + + if hasOption { + break + } + } + + if hasOption { + arguments.removeAtIndex(index) // Pop option + return try (0.. index { + let argument = arguments.removeAtIndex(index) + switch argument { + case .Argument(let value): + return value + default: + throw ArgumentParserError(description: "Unexpected \(argument.type) `\(argument)` as a value for `--\(name)`") + } + } + + throw ArgumentError.MissingValue(argument: "--\(name)") + } + } + + return nil + } + + /// Returns whether an option was specified in the arguments + public func hasOption(name:String) -> Bool { + var index = 0 + for argument in arguments { + switch argument { + case .Option(let option): + if option == name { + arguments.removeAtIndex(index) + return true + } + default: + break + } + + ++index + } + + return false + } + + /// Returns whether a flag was specified in the arguments + public func hasFlag(flag:Character) -> Bool { + var index = 0 + for argument in arguments { + switch argument { + case .Flag(var option): + if option.contains(flag) { + option.remove(flag) + arguments.removeAtIndex(index) + + if !option.isEmpty { + arguments.insert(.Flag(option), atIndex: index) + } + return true + } + default: + break + } + + ++index + } + + return false + } + + /// Returns the value for a flag (-n Kyle) + public func shiftValueForFlag(flag:Character) throws -> String? { + return try shiftValuesForFlag(flag)?.first + } + + /// Returns the value for a flag (-n Kyle) + public func shiftValuesForFlag(flag:Character, count:Int = 1) throws -> [String]? { + var index = 0 + var hasFlag = false + + for argument in arguments { + switch argument { + case .Flag(let flags): + if flags.contains(flag) { + hasFlag = true + break + } + fallthrough + default: + ++index + } + + if hasFlag { + break + } + } + + if hasFlag { + ++index // Jump flags + + return try (0.. index { + let argument = arguments.removeAtIndex(index) + switch argument { + case .Argument(let value): + return value + default: + throw ArgumentParserError(description: "Unexpected \(argument.type) `\(argument)` as a value for `-\(flag)`") + } + } + + throw ArgumentError.MissingValue(argument: "-\(flag)") + } + } + + return nil + } +} diff --git a/Pods/Commander/Commander/Command.swift b/Pods/Commander/Commander/Command.swift new file mode 100644 index 000000000..54334e6ba --- /dev/null +++ b/Pods/Commander/Commander/Command.swift @@ -0,0 +1,23 @@ +/// A simple CommandType using a closure +struct AnonymousCommand : CommandType { + var closure:ArgumentParser throws -> () + + init(_ closure:(ArgumentParser throws -> ())) { + self.closure = closure + } + + func run(parser:ArgumentParser) throws { + try closure(parser) + } +} + +enum CommandError : ErrorType { + case InvalidArgument +} + +/// Create a command using a closure +public func command(closure:() -> ()) -> CommandType { + return AnonymousCommand { parser in + closure() + } +} diff --git a/Pods/Commander/Commander/CommandDarwin.swift b/Pods/Commander/Commander/CommandDarwin.swift new file mode 100644 index 000000000..6073d1976 --- /dev/null +++ b/Pods/Commander/Commander/CommandDarwin.swift @@ -0,0 +1,39 @@ +import Darwin.libc + +/// Extensions to CommandType to provide convinience running methods for CLI tools +extension CommandType { + /// Run the command using the `Process.argument`, removing the executable name + @noreturn public func run(version:String? = nil) { + let parser = ArgumentParser(arguments: Process.arguments) + + if parser.hasOption("version") && !parser.hasOption("help") { + if let version = version { + print(version) + exit(0) + } + } + + let executableName = parser.shift()! // Executable Name + + do { + try run(parser) + } catch let error as Help { + let help = error.reraise("$ \(executableName)") + fputs("\(help)\n", stderr) + exit(1) + } catch GroupError.NoCommand(let path, let group) { + var usage = "$ \(executableName)" + if let path = path { + usage += " \(path)" + } + let help = Help([], command: usage, group: group) + fputs("\(help)\n", stderr) + exit(1) + } catch { + fputs("\(error)\n", stderr) + exit(1) + } + + exit(0) + } +} diff --git a/Pods/Commander/Commander/CommandType.swift b/Pods/Commander/Commander/CommandType.swift new file mode 100644 index 000000000..60cb9a04e --- /dev/null +++ b/Pods/Commander/Commander/CommandType.swift @@ -0,0 +1,14 @@ +/// Represents a command that can be run, given an argument parser +public protocol CommandType { + func run(parser:ArgumentParser) throws +} + + +/// Extensions to CommandType to provide convinience running methods +extension CommandType { + /// Run the command with an array of arguments + public func run(arguments:[String]) throws { + try run(ArgumentParser(arguments: arguments)) + } +} + diff --git a/Pods/Commander/Commander/Commander.h b/Pods/Commander/Commander/Commander.h new file mode 100644 index 000000000..3c2db631b --- /dev/null +++ b/Pods/Commander/Commander/Commander.h @@ -0,0 +1,7 @@ +#import + +//! Project version number for Commander. +FOUNDATION_EXPORT double CommanderVersionNumber; + +//! Project version string for Commander. +FOUNDATION_EXPORT const unsigned char CommanderVersionString[]; diff --git a/Pods/Commander/Commander/Commands.swift b/Pods/Commander/Commander/Commands.swift new file mode 100644 index 000000000..87e66ff9f --- /dev/null +++ b/Pods/Commander/Commander/Commands.swift @@ -0,0 +1,536 @@ +/// Automatically generated file from Examples/generator.swift + +// MARK: Commands + + +/// Create a command which takes 1 argument using a closure +public func command(closure:(A) -> ()) -> CommandType { + return AnonymousCommand { parser in + closure(try A(parser: parser)) + } +} + +/// Create a command which takes 2 argument using a closure +public func command(closure:(A, A1) -> ()) -> CommandType { + return AnonymousCommand { parser in + closure(try A(parser: parser), try A1(parser: parser)) + } +} + +/// Create a command which takes 3 argument using a closure +public func command(closure:(A, A1, A2) -> ()) -> CommandType { + return AnonymousCommand { parser in + closure(try A(parser: parser), try A1(parser: parser), try A2(parser: parser)) + } +} + +/// Create a command which takes 4 argument using a closure +public func command(closure:(A, A1, A2, A3) -> ()) -> CommandType { + return AnonymousCommand { parser in + closure(try A(parser: parser), try A1(parser: parser), try A2(parser: parser), try A3(parser: parser)) + } +} + +/// Create a command which takes 5 argument using a closure +public func command(closure:(A, A1, A2, A3, A4) -> ()) -> CommandType { + return AnonymousCommand { parser in + closure(try A(parser: parser), try A1(parser: parser), try A2(parser: parser), try A3(parser: parser), try A4(parser: parser)) + } +} + +/// Create a command which takes 6 argument using a closure +public func command(closure:(A, A1, A2, A3, A4, A5) -> ()) -> CommandType { + return AnonymousCommand { parser in + closure(try A(parser: parser), try A1(parser: parser), try A2(parser: parser), try A3(parser: parser), try A4(parser: parser), try A5(parser: parser)) + } +} + +/// Create a command which takes 7 argument using a closure +public func command(closure:(A, A1, A2, A3, A4, A5, A6) -> ()) -> CommandType { + return AnonymousCommand { parser in + closure(try A(parser: parser), try A1(parser: parser), try A2(parser: parser), try A3(parser: parser), try A4(parser: parser), try A5(parser: parser), try A6(parser: parser)) + } +} + +/// Create a command which takes 8 argument using a closure +public func command(closure:(A, A1, A2, A3, A4, A5, A6, A7) -> ()) -> CommandType { + return AnonymousCommand { parser in + closure(try A(parser: parser), try A1(parser: parser), try A2(parser: parser), try A3(parser: parser), try A4(parser: parser), try A5(parser: parser), try A6(parser: parser), try A7(parser: parser)) + } +} + +/// Create a command which takes 9 argument using a closure +public func command(closure:(A, A1, A2, A3, A4, A5, A6, A7, A8) -> ()) -> CommandType { + return AnonymousCommand { parser in + closure(try A(parser: parser), try A1(parser: parser), try A2(parser: parser), try A3(parser: parser), try A4(parser: parser), try A5(parser: parser), try A6(parser: parser), try A7(parser: parser), try A8(parser: parser)) + } +} + +/// Create a command which takes 10 argument using a closure +public func command(closure:(A, A1, A2, A3, A4, A5, A6, A7, A8, A9) -> ()) -> CommandType { + return AnonymousCommand { parser in + closure(try A(parser: parser), try A1(parser: parser), try A2(parser: parser), try A3(parser: parser), try A4(parser: parser), try A5(parser: parser), try A6(parser: parser), try A7(parser: parser), try A8(parser: parser), try A9(parser: parser)) + } +} + +/// Create a command which takes 11 argument using a closure +public func command(closure:(A, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) -> ()) -> CommandType { + return AnonymousCommand { parser in + closure(try A(parser: parser), try A1(parser: parser), try A2(parser: parser), try A3(parser: parser), try A4(parser: parser), try A5(parser: parser), try A6(parser: parser), try A7(parser: parser), try A8(parser: parser), try A9(parser: parser), try A10(parser: parser)) + } +} + +/// Create a command which takes 12 argument using a closure +public func command(closure:(A, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) -> ()) -> CommandType { + return AnonymousCommand { parser in + closure(try A(parser: parser), try A1(parser: parser), try A2(parser: parser), try A3(parser: parser), try A4(parser: parser), try A5(parser: parser), try A6(parser: parser), try A7(parser: parser), try A8(parser: parser), try A9(parser: parser), try A10(parser: parser), try A11(parser: parser)) + } +} + +/// Create a command which takes 13 argument using a closure +public func command(closure:(A, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) -> ()) -> CommandType { + return AnonymousCommand { parser in + closure(try A(parser: parser), try A1(parser: parser), try A2(parser: parser), try A3(parser: parser), try A4(parser: parser), try A5(parser: parser), try A6(parser: parser), try A7(parser: parser), try A8(parser: parser), try A9(parser: parser), try A10(parser: parser), try A11(parser: parser), try A12(parser: parser)) + } +} + +/// Create a command which takes 14 argument using a closure +public func command(closure:(A, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13) -> ()) -> CommandType { + return AnonymousCommand { parser in + closure(try A(parser: parser), try A1(parser: parser), try A2(parser: parser), try A3(parser: parser), try A4(parser: parser), try A5(parser: parser), try A6(parser: parser), try A7(parser: parser), try A8(parser: parser), try A9(parser: parser), try A10(parser: parser), try A11(parser: parser), try A12(parser: parser), try A13(parser: parser)) + } +} + + +// MARK: Argument Descriptor Commands + + +/// Create a command which takes 1 argument using a closure with arguments +public func command(descriptor:A, closure:(A.ValueType) -> ()) -> CommandType { + return AnonymousCommand { parser in + if parser.hasOption("help") { + throw Help([ + BoxedArgumentDescriptor(value: descriptor), + ]) + } + + closure(try descriptor.parse(parser)) + } +} + +/// Create a command which takes 2 argument using a closure with arguments +public func command(descriptor:A, _ descriptor1:A1, closure:(A.ValueType, A1.ValueType) -> ()) -> CommandType { + return AnonymousCommand { parser in + if parser.hasOption("help") { + throw Help([ + BoxedArgumentDescriptor(value: descriptor), + BoxedArgumentDescriptor(value: descriptor1), + ]) + } + + closure(try descriptor.parse(parser), try descriptor1.parse(parser)) + } +} + +/// Create a command which takes 3 argument using a closure with arguments +public func command(descriptor:A, _ descriptor1:A1, _ descriptor2:A2, closure:(A.ValueType, A1.ValueType, A2.ValueType) -> ()) -> CommandType { + return AnonymousCommand { parser in + if parser.hasOption("help") { + throw Help([ + BoxedArgumentDescriptor(value: descriptor), + BoxedArgumentDescriptor(value: descriptor1), + BoxedArgumentDescriptor(value: descriptor2), + ]) + } + + closure(try descriptor.parse(parser), try descriptor1.parse(parser), try descriptor2.parse(parser)) + } +} + +/// Create a command which takes 4 argument using a closure with arguments +public func command(descriptor:A, _ descriptor1:A1, _ descriptor2:A2, _ descriptor3:A3, closure:(A.ValueType, A1.ValueType, A2.ValueType, A3.ValueType) -> ()) -> CommandType { + return AnonymousCommand { parser in + if parser.hasOption("help") { + throw Help([ + BoxedArgumentDescriptor(value: descriptor), + BoxedArgumentDescriptor(value: descriptor1), + BoxedArgumentDescriptor(value: descriptor2), + BoxedArgumentDescriptor(value: descriptor3), + ]) + } + + closure(try descriptor.parse(parser), try descriptor1.parse(parser), try descriptor2.parse(parser), try descriptor3.parse(parser)) + } +} + +/// Create a command which takes 5 argument using a closure with arguments +public func command(descriptor:A, _ descriptor1:A1, _ descriptor2:A2, _ descriptor3:A3, _ descriptor4:A4, closure:(A.ValueType, A1.ValueType, A2.ValueType, A3.ValueType, A4.ValueType) -> ()) -> CommandType { + return AnonymousCommand { parser in + if parser.hasOption("help") { + throw Help([ + BoxedArgumentDescriptor(value: descriptor), + BoxedArgumentDescriptor(value: descriptor1), + BoxedArgumentDescriptor(value: descriptor2), + BoxedArgumentDescriptor(value: descriptor3), + BoxedArgumentDescriptor(value: descriptor4), + ]) + } + + closure(try descriptor.parse(parser), try descriptor1.parse(parser), try descriptor2.parse(parser), try descriptor3.parse(parser), try descriptor4.parse(parser)) + } +} + +/// Create a command which takes 6 argument using a closure with arguments +public func command(descriptor:A, _ descriptor1:A1, _ descriptor2:A2, _ descriptor3:A3, _ descriptor4:A4, _ descriptor5:A5, closure:(A.ValueType, A1.ValueType, A2.ValueType, A3.ValueType, A4.ValueType, A5.ValueType) -> ()) -> CommandType { + return AnonymousCommand { parser in + if parser.hasOption("help") { + throw Help([ + BoxedArgumentDescriptor(value: descriptor), + BoxedArgumentDescriptor(value: descriptor1), + BoxedArgumentDescriptor(value: descriptor2), + BoxedArgumentDescriptor(value: descriptor3), + BoxedArgumentDescriptor(value: descriptor4), + BoxedArgumentDescriptor(value: descriptor5), + ]) + } + + closure(try descriptor.parse(parser), try descriptor1.parse(parser), try descriptor2.parse(parser), try descriptor3.parse(parser), try descriptor4.parse(parser), try descriptor5.parse(parser)) + } +} + +/// Create a command which takes 7 argument using a closure with arguments +public func command(descriptor:A, _ descriptor1:A1, _ descriptor2:A2, _ descriptor3:A3, _ descriptor4:A4, _ descriptor5:A5, _ descriptor6:A6, closure:(A.ValueType, A1.ValueType, A2.ValueType, A3.ValueType, A4.ValueType, A5.ValueType, A6.ValueType) -> ()) -> CommandType { + return AnonymousCommand { parser in + if parser.hasOption("help") { + throw Help([ + BoxedArgumentDescriptor(value: descriptor), + BoxedArgumentDescriptor(value: descriptor1), + BoxedArgumentDescriptor(value: descriptor2), + BoxedArgumentDescriptor(value: descriptor3), + BoxedArgumentDescriptor(value: descriptor4), + BoxedArgumentDescriptor(value: descriptor5), + BoxedArgumentDescriptor(value: descriptor6), + ]) + } + + closure(try descriptor.parse(parser), try descriptor1.parse(parser), try descriptor2.parse(parser), try descriptor3.parse(parser), try descriptor4.parse(parser), try descriptor5.parse(parser), try descriptor6.parse(parser)) + } +} + +/// Create a command which takes 8 argument using a closure with arguments +public func command(descriptor:A, _ descriptor1:A1, _ descriptor2:A2, _ descriptor3:A3, _ descriptor4:A4, _ descriptor5:A5, _ descriptor6:A6, _ descriptor7:A7, closure:(A.ValueType, A1.ValueType, A2.ValueType, A3.ValueType, A4.ValueType, A5.ValueType, A6.ValueType, A7.ValueType) -> ()) -> CommandType { + return AnonymousCommand { parser in + if parser.hasOption("help") { + throw Help([ + BoxedArgumentDescriptor(value: descriptor), + BoxedArgumentDescriptor(value: descriptor1), + BoxedArgumentDescriptor(value: descriptor2), + BoxedArgumentDescriptor(value: descriptor3), + BoxedArgumentDescriptor(value: descriptor4), + BoxedArgumentDescriptor(value: descriptor5), + BoxedArgumentDescriptor(value: descriptor6), + BoxedArgumentDescriptor(value: descriptor7), + ]) + } + + closure(try descriptor.parse(parser), try descriptor1.parse(parser), try descriptor2.parse(parser), try descriptor3.parse(parser), try descriptor4.parse(parser), try descriptor5.parse(parser), try descriptor6.parse(parser), try descriptor7.parse(parser)) + } +} + +/// Create a command which takes 9 argument using a closure with arguments +public func command(descriptor:A, _ descriptor1:A1, _ descriptor2:A2, _ descriptor3:A3, _ descriptor4:A4, _ descriptor5:A5, _ descriptor6:A6, _ descriptor7:A7, _ descriptor8:A8, closure:(A.ValueType, A1.ValueType, A2.ValueType, A3.ValueType, A4.ValueType, A5.ValueType, A6.ValueType, A7.ValueType, A8.ValueType) -> ()) -> CommandType { + return AnonymousCommand { parser in + if parser.hasOption("help") { + throw Help([ + BoxedArgumentDescriptor(value: descriptor), + BoxedArgumentDescriptor(value: descriptor1), + BoxedArgumentDescriptor(value: descriptor2), + BoxedArgumentDescriptor(value: descriptor3), + BoxedArgumentDescriptor(value: descriptor4), + BoxedArgumentDescriptor(value: descriptor5), + BoxedArgumentDescriptor(value: descriptor6), + BoxedArgumentDescriptor(value: descriptor7), + BoxedArgumentDescriptor(value: descriptor8), + ]) + } + + closure(try descriptor.parse(parser), try descriptor1.parse(parser), try descriptor2.parse(parser), try descriptor3.parse(parser), try descriptor4.parse(parser), try descriptor5.parse(parser), try descriptor6.parse(parser), try descriptor7.parse(parser), try descriptor8.parse(parser)) + } +} + +/// Create a command which takes 10 argument using a closure with arguments +public func command(descriptor:A, _ descriptor1:A1, _ descriptor2:A2, _ descriptor3:A3, _ descriptor4:A4, _ descriptor5:A5, _ descriptor6:A6, _ descriptor7:A7, _ descriptor8:A8, _ descriptor9:A9, closure:(A.ValueType, A1.ValueType, A2.ValueType, A3.ValueType, A4.ValueType, A5.ValueType, A6.ValueType, A7.ValueType, A8.ValueType, A9.ValueType) -> ()) -> CommandType { + return AnonymousCommand { parser in + if parser.hasOption("help") { + throw Help([ + BoxedArgumentDescriptor(value: descriptor), + BoxedArgumentDescriptor(value: descriptor1), + BoxedArgumentDescriptor(value: descriptor2), + BoxedArgumentDescriptor(value: descriptor3), + BoxedArgumentDescriptor(value: descriptor4), + BoxedArgumentDescriptor(value: descriptor5), + BoxedArgumentDescriptor(value: descriptor6), + BoxedArgumentDescriptor(value: descriptor7), + BoxedArgumentDescriptor(value: descriptor8), + BoxedArgumentDescriptor(value: descriptor9), + ]) + } + + closure(try descriptor.parse(parser), try descriptor1.parse(parser), try descriptor2.parse(parser), try descriptor3.parse(parser), try descriptor4.parse(parser), try descriptor5.parse(parser), try descriptor6.parse(parser), try descriptor7.parse(parser), try descriptor8.parse(parser), try descriptor9.parse(parser)) + } +} + +/// Create a command which takes 11 argument using a closure with arguments +public func command(descriptor:A, _ descriptor1:A1, _ descriptor2:A2, _ descriptor3:A3, _ descriptor4:A4, _ descriptor5:A5, _ descriptor6:A6, _ descriptor7:A7, _ descriptor8:A8, _ descriptor9:A9, _ descriptor10:A10, closure:(A.ValueType, A1.ValueType, A2.ValueType, A3.ValueType, A4.ValueType, A5.ValueType, A6.ValueType, A7.ValueType, A8.ValueType, A9.ValueType, A10.ValueType) -> ()) -> CommandType { + return AnonymousCommand { parser in + if parser.hasOption("help") { + throw Help([ + BoxedArgumentDescriptor(value: descriptor), + BoxedArgumentDescriptor(value: descriptor1), + BoxedArgumentDescriptor(value: descriptor2), + BoxedArgumentDescriptor(value: descriptor3), + BoxedArgumentDescriptor(value: descriptor4), + BoxedArgumentDescriptor(value: descriptor5), + BoxedArgumentDescriptor(value: descriptor6), + BoxedArgumentDescriptor(value: descriptor7), + BoxedArgumentDescriptor(value: descriptor8), + BoxedArgumentDescriptor(value: descriptor9), + BoxedArgumentDescriptor(value: descriptor10), + ]) + } + + closure(try descriptor.parse(parser), try descriptor1.parse(parser), try descriptor2.parse(parser), try descriptor3.parse(parser), try descriptor4.parse(parser), try descriptor5.parse(parser), try descriptor6.parse(parser), try descriptor7.parse(parser), try descriptor8.parse(parser), try descriptor9.parse(parser), try descriptor10.parse(parser)) + } +} + +/// Create a command which takes 12 argument using a closure with arguments +public func command(descriptor:A, _ descriptor1:A1, _ descriptor2:A2, _ descriptor3:A3, _ descriptor4:A4, _ descriptor5:A5, _ descriptor6:A6, _ descriptor7:A7, _ descriptor8:A8, _ descriptor9:A9, _ descriptor10:A10, _ descriptor11:A11, closure:(A.ValueType, A1.ValueType, A2.ValueType, A3.ValueType, A4.ValueType, A5.ValueType, A6.ValueType, A7.ValueType, A8.ValueType, A9.ValueType, A10.ValueType, A11.ValueType) -> ()) -> CommandType { + return AnonymousCommand { parser in + if parser.hasOption("help") { + throw Help([ + BoxedArgumentDescriptor(value: descriptor), + BoxedArgumentDescriptor(value: descriptor1), + BoxedArgumentDescriptor(value: descriptor2), + BoxedArgumentDescriptor(value: descriptor3), + BoxedArgumentDescriptor(value: descriptor4), + BoxedArgumentDescriptor(value: descriptor5), + BoxedArgumentDescriptor(value: descriptor6), + BoxedArgumentDescriptor(value: descriptor7), + BoxedArgumentDescriptor(value: descriptor8), + BoxedArgumentDescriptor(value: descriptor9), + BoxedArgumentDescriptor(value: descriptor10), + BoxedArgumentDescriptor(value: descriptor11), + ]) + } + + closure(try descriptor.parse(parser), try descriptor1.parse(parser), try descriptor2.parse(parser), try descriptor3.parse(parser), try descriptor4.parse(parser), try descriptor5.parse(parser), try descriptor6.parse(parser), try descriptor7.parse(parser), try descriptor8.parse(parser), try descriptor9.parse(parser), try descriptor10.parse(parser), try descriptor11.parse(parser)) + } +} + +/// Create a command which takes 13 argument using a closure with arguments +public func command(descriptor:A, _ descriptor1:A1, _ descriptor2:A2, _ descriptor3:A3, _ descriptor4:A4, _ descriptor5:A5, _ descriptor6:A6, _ descriptor7:A7, _ descriptor8:A8, _ descriptor9:A9, _ descriptor10:A10, _ descriptor11:A11, _ descriptor12:A12, closure:(A.ValueType, A1.ValueType, A2.ValueType, A3.ValueType, A4.ValueType, A5.ValueType, A6.ValueType, A7.ValueType, A8.ValueType, A9.ValueType, A10.ValueType, A11.ValueType, A12.ValueType) -> ()) -> CommandType { + return AnonymousCommand { parser in + if parser.hasOption("help") { + throw Help([ + BoxedArgumentDescriptor(value: descriptor), + BoxedArgumentDescriptor(value: descriptor1), + BoxedArgumentDescriptor(value: descriptor2), + BoxedArgumentDescriptor(value: descriptor3), + BoxedArgumentDescriptor(value: descriptor4), + BoxedArgumentDescriptor(value: descriptor5), + BoxedArgumentDescriptor(value: descriptor6), + BoxedArgumentDescriptor(value: descriptor7), + BoxedArgumentDescriptor(value: descriptor8), + BoxedArgumentDescriptor(value: descriptor9), + BoxedArgumentDescriptor(value: descriptor10), + BoxedArgumentDescriptor(value: descriptor11), + BoxedArgumentDescriptor(value: descriptor12), + ]) + } + + closure(try descriptor.parse(parser), try descriptor1.parse(parser), try descriptor2.parse(parser), try descriptor3.parse(parser), try descriptor4.parse(parser), try descriptor5.parse(parser), try descriptor6.parse(parser), try descriptor7.parse(parser), try descriptor8.parse(parser), try descriptor9.parse(parser), try descriptor10.parse(parser), try descriptor11.parse(parser), try descriptor12.parse(parser)) + } +} + +/// Create a command which takes 14 argument using a closure with arguments +public func command(descriptor:A, _ descriptor1:A1, _ descriptor2:A2, _ descriptor3:A3, _ descriptor4:A4, _ descriptor5:A5, _ descriptor6:A6, _ descriptor7:A7, _ descriptor8:A8, _ descriptor9:A9, _ descriptor10:A10, _ descriptor11:A11, _ descriptor12:A12, _ descriptor13:A13, closure:(A.ValueType, A1.ValueType, A2.ValueType, A3.ValueType, A4.ValueType, A5.ValueType, A6.ValueType, A7.ValueType, A8.ValueType, A9.ValueType, A10.ValueType, A11.ValueType, A12.ValueType, A13.ValueType) -> ()) -> CommandType { + return AnonymousCommand { parser in + if parser.hasOption("help") { + throw Help([ + BoxedArgumentDescriptor(value: descriptor), + BoxedArgumentDescriptor(value: descriptor1), + BoxedArgumentDescriptor(value: descriptor2), + BoxedArgumentDescriptor(value: descriptor3), + BoxedArgumentDescriptor(value: descriptor4), + BoxedArgumentDescriptor(value: descriptor5), + BoxedArgumentDescriptor(value: descriptor6), + BoxedArgumentDescriptor(value: descriptor7), + BoxedArgumentDescriptor(value: descriptor8), + BoxedArgumentDescriptor(value: descriptor9), + BoxedArgumentDescriptor(value: descriptor10), + BoxedArgumentDescriptor(value: descriptor11), + BoxedArgumentDescriptor(value: descriptor12), + BoxedArgumentDescriptor(value: descriptor13), + ]) + } + + closure(try descriptor.parse(parser), try descriptor1.parse(parser), try descriptor2.parse(parser), try descriptor3.parse(parser), try descriptor4.parse(parser), try descriptor5.parse(parser), try descriptor6.parse(parser), try descriptor7.parse(parser), try descriptor8.parse(parser), try descriptor9.parse(parser), try descriptor10.parse(parser), try descriptor11.parse(parser), try descriptor12.parse(parser), try descriptor13.parse(parser)) + } +} + + +// MARK: Group commands + +extension Group { + // MARK: Argument Description Commands + + /// Add a command which takes no argument using a closure + public func command(name:String, closure:() -> ()) { + addCommand(name, Commander.command(closure)) + } + + /// Add a command which takes 1 arguments using a closure + public func command(name:String, closure:(A) -> ()) { + addCommand(name, Commander.command(closure)) + } + + /// Add a command which takes 2 arguments using a closure + public func command(name:String, closure:(A, A1) -> ()) { + addCommand(name, Commander.command(closure)) + } + + /// Add a command which takes 3 arguments using a closure + public func command(name:String, closure:(A, A1, A2) -> ()) { + addCommand(name, Commander.command(closure)) + } + + /// Add a command which takes 4 arguments using a closure + public func command(name:String, closure:(A, A1, A2, A3) -> ()) { + addCommand(name, Commander.command(closure)) + } + + /// Add a command which takes 5 arguments using a closure + public func command(name:String, closure:(A, A1, A2, A3, A4) -> ()) { + addCommand(name, Commander.command(closure)) + } + + /// Add a command which takes 6 arguments using a closure + public func command(name:String, closure:(A, A1, A2, A3, A4, A5) -> ()) { + addCommand(name, Commander.command(closure)) + } + + /// Add a command which takes 7 arguments using a closure + public func command(name:String, closure:(A, A1, A2, A3, A4, A5, A6) -> ()) { + addCommand(name, Commander.command(closure)) + } + + /// Add a command which takes 8 arguments using a closure + public func command(name:String, closure:(A, A1, A2, A3, A4, A5, A6, A7) -> ()) { + addCommand(name, Commander.command(closure)) + } + + /// Add a command which takes 9 arguments using a closure + public func command(name:String, closure:(A, A1, A2, A3, A4, A5, A6, A7, A8) -> ()) { + addCommand(name, Commander.command(closure)) + } + + /// Add a command which takes 10 arguments using a closure + public func command(name:String, closure:(A, A1, A2, A3, A4, A5, A6, A7, A8, A9) -> ()) { + addCommand(name, Commander.command(closure)) + } + + /// Add a command which takes 11 arguments using a closure + public func command(name:String, closure:(A, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) -> ()) { + addCommand(name, Commander.command(closure)) + } + + /// Add a command which takes 12 arguments using a closure + public func command(name:String, closure:(A, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) -> ()) { + addCommand(name, Commander.command(closure)) + } + + /// Add a command which takes 13 arguments using a closure + public func command(name:String, closure:(A, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) -> ()) { + addCommand(name, Commander.command(closure)) + } + + /// Add a command which takes 14 arguments using a closure + public func command(name:String, closure:(A, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13) -> ()) { + addCommand(name, Commander.command(closure)) + } + + // MARK: Argument Descriptor Commands + + + /// Add a command which takes 1 arguments using a closure + public func command(name:String, descriptor:A, closure:(A.ValueType) -> ()) { + addCommand(name, Commander.command(descriptor, closure: closure)) + } + + /// Add a command which takes 2 arguments using a closure + public func command(name:String, descriptor:A, descriptor1:A1, closure:(A.ValueType, A1.ValueType) -> ()) { + addCommand(name, Commander.command(descriptor, descriptor1, closure: closure)) + } + + /// Add a command which takes 3 arguments using a closure + public func command(name:String, descriptor:A, descriptor1:A1, descriptor2:A2, closure:(A.ValueType, A1.ValueType, A2.ValueType) -> ()) { + addCommand(name, Commander.command(descriptor, descriptor1, descriptor2, closure: closure)) + } + + /// Add a command which takes 4 arguments using a closure + public func command(name:String, descriptor:A, descriptor1:A1, descriptor2:A2, descriptor3:A3, closure:(A.ValueType, A1.ValueType, A2.ValueType, A3.ValueType) -> ()) { + addCommand(name, Commander.command(descriptor, descriptor1, descriptor2, descriptor3, closure: closure)) + } + + /// Add a command which takes 5 arguments using a closure + public func command(name:String, descriptor:A, descriptor1:A1, descriptor2:A2, descriptor3:A3, descriptor4:A4, closure:(A.ValueType, A1.ValueType, A2.ValueType, A3.ValueType, A4.ValueType) -> ()) { + addCommand(name, Commander.command(descriptor, descriptor1, descriptor2, descriptor3, descriptor4, closure: closure)) + } + + /// Add a command which takes 6 arguments using a closure + public func command(name:String, descriptor:A, descriptor1:A1, descriptor2:A2, descriptor3:A3, descriptor4:A4, descriptor5:A5, closure:(A.ValueType, A1.ValueType, A2.ValueType, A3.ValueType, A4.ValueType, A5.ValueType) -> ()) { + addCommand(name, Commander.command(descriptor, descriptor1, descriptor2, descriptor3, descriptor4, descriptor5, closure: closure)) + } + + /// Add a command which takes 7 arguments using a closure + public func command(name:String, descriptor:A, descriptor1:A1, descriptor2:A2, descriptor3:A3, descriptor4:A4, descriptor5:A5, descriptor6:A6, closure:(A.ValueType, A1.ValueType, A2.ValueType, A3.ValueType, A4.ValueType, A5.ValueType, A6.ValueType) -> ()) { + addCommand(name, Commander.command(descriptor, descriptor1, descriptor2, descriptor3, descriptor4, descriptor5, descriptor6, closure: closure)) + } + + /// Add a command which takes 8 arguments using a closure + public func command(name:String, descriptor:A, descriptor1:A1, descriptor2:A2, descriptor3:A3, descriptor4:A4, descriptor5:A5, descriptor6:A6, descriptor7:A7, closure:(A.ValueType, A1.ValueType, A2.ValueType, A3.ValueType, A4.ValueType, A5.ValueType, A6.ValueType, A7.ValueType) -> ()) { + addCommand(name, Commander.command(descriptor, descriptor1, descriptor2, descriptor3, descriptor4, descriptor5, descriptor6, descriptor7, closure: closure)) + } + + /// Add a command which takes 9 arguments using a closure + public func command(name:String, descriptor:A, descriptor1:A1, descriptor2:A2, descriptor3:A3, descriptor4:A4, descriptor5:A5, descriptor6:A6, descriptor7:A7, descriptor8:A8, closure:(A.ValueType, A1.ValueType, A2.ValueType, A3.ValueType, A4.ValueType, A5.ValueType, A6.ValueType, A7.ValueType, A8.ValueType) -> ()) { + addCommand(name, Commander.command(descriptor, descriptor1, descriptor2, descriptor3, descriptor4, descriptor5, descriptor6, descriptor7, descriptor8, closure: closure)) + } + + /// Add a command which takes 10 arguments using a closure + public func command(name:String, descriptor:A, descriptor1:A1, descriptor2:A2, descriptor3:A3, descriptor4:A4, descriptor5:A5, descriptor6:A6, descriptor7:A7, descriptor8:A8, descriptor9:A9, closure:(A.ValueType, A1.ValueType, A2.ValueType, A3.ValueType, A4.ValueType, A5.ValueType, A6.ValueType, A7.ValueType, A8.ValueType, A9.ValueType) -> ()) { + addCommand(name, Commander.command(descriptor, descriptor1, descriptor2, descriptor3, descriptor4, descriptor5, descriptor6, descriptor7, descriptor8, descriptor9, closure: closure)) + } + + /// Add a command which takes 11 arguments using a closure + public func command(name:String, descriptor:A, descriptor1:A1, descriptor2:A2, descriptor3:A3, descriptor4:A4, descriptor5:A5, descriptor6:A6, descriptor7:A7, descriptor8:A8, descriptor9:A9, descriptor10:A10, closure:(A.ValueType, A1.ValueType, A2.ValueType, A3.ValueType, A4.ValueType, A5.ValueType, A6.ValueType, A7.ValueType, A8.ValueType, A9.ValueType, A10.ValueType) -> ()) { + addCommand(name, Commander.command(descriptor, descriptor1, descriptor2, descriptor3, descriptor4, descriptor5, descriptor6, descriptor7, descriptor8, descriptor9, descriptor10, closure: closure)) + } + + /// Add a command which takes 12 arguments using a closure + public func command(name:String, descriptor:A, descriptor1:A1, descriptor2:A2, descriptor3:A3, descriptor4:A4, descriptor5:A5, descriptor6:A6, descriptor7:A7, descriptor8:A8, descriptor9:A9, descriptor10:A10, descriptor11:A11, closure:(A.ValueType, A1.ValueType, A2.ValueType, A3.ValueType, A4.ValueType, A5.ValueType, A6.ValueType, A7.ValueType, A8.ValueType, A9.ValueType, A10.ValueType, A11.ValueType) -> ()) { + addCommand(name, Commander.command(descriptor, descriptor1, descriptor2, descriptor3, descriptor4, descriptor5, descriptor6, descriptor7, descriptor8, descriptor9, descriptor10, descriptor11, closure: closure)) + } + + /// Add a command which takes 13 arguments using a closure + public func command(name:String, descriptor:A, descriptor1:A1, descriptor2:A2, descriptor3:A3, descriptor4:A4, descriptor5:A5, descriptor6:A6, descriptor7:A7, descriptor8:A8, descriptor9:A9, descriptor10:A10, descriptor11:A11, descriptor12:A12, closure:(A.ValueType, A1.ValueType, A2.ValueType, A3.ValueType, A4.ValueType, A5.ValueType, A6.ValueType, A7.ValueType, A8.ValueType, A9.ValueType, A10.ValueType, A11.ValueType, A12.ValueType) -> ()) { + addCommand(name, Commander.command(descriptor, descriptor1, descriptor2, descriptor3, descriptor4, descriptor5, descriptor6, descriptor7, descriptor8, descriptor9, descriptor10, descriptor11, descriptor12, closure: closure)) + } + + /// Add a command which takes 14 arguments using a closure + public func command(name:String, descriptor:A, descriptor1:A1, descriptor2:A2, descriptor3:A3, descriptor4:A4, descriptor5:A5, descriptor6:A6, descriptor7:A7, descriptor8:A8, descriptor9:A9, descriptor10:A10, descriptor11:A11, descriptor12:A12, descriptor13:A13, closure:(A.ValueType, A1.ValueType, A2.ValueType, A3.ValueType, A4.ValueType, A5.ValueType, A6.ValueType, A7.ValueType, A8.ValueType, A9.ValueType, A10.ValueType, A11.ValueType, A12.ValueType, A13.ValueType) -> ()) { + addCommand(name, Commander.command(descriptor, descriptor1, descriptor2, descriptor3, descriptor4, descriptor5, descriptor6, descriptor7, descriptor8, descriptor9, descriptor10, descriptor11, descriptor12, descriptor13, closure: closure)) + } + +} + diff --git a/Pods/Commander/Commander/Group.swift b/Pods/Commander/Commander/Group.swift new file mode 100644 index 000000000..1faf8ebf0 --- /dev/null +++ b/Pods/Commander/Commander/Group.swift @@ -0,0 +1,73 @@ +public enum GroupError : ErrorType, CustomStringConvertible { + /// No-subcommand was found with the given name + case UnknownCommand(String) + + /// No command was given + /// :param: The current path to the command (i.e, all the group names) + /// :param: The group raising the error + case NoCommand(String?, Group) + + public var description:String { + switch self { + case .UnknownCommand(let name): + return "Unknown command: `\(name)`" + case .NoCommand(let path, let group): + let available = group.commands.keys.sort().joinWithSeparator(", ") + if let path = path { + return "Usage: \(path) COMMAND\n\nCommands: \(available)" + } else { + return "Commands: \(available)" + } + } + } +} + +/// Represents a group of commands +public class Group : CommandType { + var commands = [String:CommandType]() + + /// Create a new group + public init() {} + + /// Add a named sub-command to the group + public func addCommand(name:String, _ command:CommandType) { + commands[name] = command + } + + /// Run the group command + public func run(parser:ArgumentParser) throws { + if let name = parser.shift() { + if let command = commands[name] { + do { + try command.run(parser) + } catch GroupError.UnknownCommand(let childName) { + throw GroupError.UnknownCommand("\(name) \(childName)") + } catch GroupError.NoCommand(let path, let group) { + if let path = path { + throw GroupError.NoCommand("\(name) \(path)", group) + } + + throw GroupError.NoCommand(name, group) + } catch let error as Help { + throw error.reraise(name) + } + } else { + throw GroupError.UnknownCommand(name) + } + } else { + throw GroupError.NoCommand(nil, self) + } + } +} + +extension Group { + public convenience init(closure:Group -> ()) { + self.init() + closure(self) + } + + /// Add a sub-group using a closure + public func group(name:String, closure:Group -> ()) { + addCommand(name, Group(closure: closure)) + } +} diff --git a/Pods/Commander/LICENSE b/Pods/Commander/LICENSE new file mode 100644 index 000000000..76bafeaf8 --- /dev/null +++ b/Pods/Commander/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2015, Kyle Fuller +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the {organization} nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Pods/Commander/README.md b/Pods/Commander/README.md new file mode 100644 index 000000000..da938275d --- /dev/null +++ b/Pods/Commander/README.md @@ -0,0 +1,218 @@ +Commander + +# Commander + +[![Build Status](http://img.shields.io/travis/kylef/Commander/master.svg?style=flat)](https://travis-ci.org/kylef/Commander) + +Commander is a small Swift framework allowing you to craft beautiful command +line interfaces in a composable way. + +## Usage + +##### Simple Hello World + +```swift +import Commander + +let main = command { + print("Hello World") +} + +main.run() +``` + +##### Type-safe argument handling + +The closure passed to the command function takes any arguments that +conform to `ArgumentConvertible`, Commander will automatically convert the +arguments to these types. If they can't be converted the user will receive a +nice error message informing them that their argument doesn't match the +expected type. + +`String`, `Int`, `Double`, and `Float` are extended to conform to +`ArgumentConvertible`, you can easily extend any other class or structure +so you can use it as an argument to your command. + +```swift +command { (hostname:String, port:Int) in + print("Connecting to \(hostname) on port \(port)...") +} +``` + +##### Grouping commands + +You can group a collection of commands together. + +```swift +Group { + $0.command("login") { (name:String) in + print("Hello \(name)") + } + + $0.command("logout") { + print("Goodbye.") + } +} +``` + +Usage: + +```shell +$ auth +Usage: + + $ auth COMMAND + +Commands: + + + login + + logout + +$ auth login Kyle +Hello Kyle +$ auth logout +Goodbye. +``` + +#### Describing arguments + +You can describe arguments and options for a command to auto-generate help, +this is done by passing in descriptors of these arguments. + +For example, to describe a command which takes two options, `--name` and +`--count` where the default value for name is `world` and the default value for +count is `1`. + +```swift +command( + Option("name", "world"), + Option("count", 1, description: "The number of times to print.") +) { name, count in + for _ in 0.. + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Pods/Target Support Files/Commander/Commander-dummy.m b/Pods/Target Support Files/Commander/Commander-dummy.m new file mode 100644 index 000000000..2211ce6dc --- /dev/null +++ b/Pods/Target Support Files/Commander/Commander-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Commander : NSObject +@end +@implementation PodsDummy_Commander +@end diff --git a/Pods/Target Support Files/Commander/Commander-prefix.pch b/Pods/Target Support Files/Commander/Commander-prefix.pch new file mode 100644 index 000000000..b9c163b49 --- /dev/null +++ b/Pods/Target Support Files/Commander/Commander-prefix.pch @@ -0,0 +1,4 @@ +#ifdef __OBJC__ +#import +#endif + diff --git a/Pods/Target Support Files/Commander/Commander-umbrella.h b/Pods/Target Support Files/Commander/Commander-umbrella.h new file mode 100644 index 000000000..6fffa987c --- /dev/null +++ b/Pods/Target Support Files/Commander/Commander-umbrella.h @@ -0,0 +1,7 @@ +#import + +#import "Commander.h" + +FOUNDATION_EXPORT double CommanderVersionNumber; +FOUNDATION_EXPORT const unsigned char CommanderVersionString[]; + diff --git a/Pods/Target Support Files/Commander/Commander.modulemap b/Pods/Target Support Files/Commander/Commander.modulemap new file mode 100644 index 000000000..cd853ab16 --- /dev/null +++ b/Pods/Target Support Files/Commander/Commander.modulemap @@ -0,0 +1,6 @@ +framework module Commander { + umbrella header "Commander-umbrella.h" + + export * + module * { export * } +} diff --git a/Pods/Target Support Files/Commander/Commander.xcconfig b/Pods/Target Support Files/Commander/Commander.xcconfig new file mode 100644 index 000000000..eba678150 --- /dev/null +++ b/Pods/Target Support Files/Commander/Commander.xcconfig @@ -0,0 +1,6 @@ +CODE_SIGN_IDENTITY = +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Commander" "${PODS_ROOT}/Headers/Public" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_ROOT = ${SRCROOT} +SKIP_INSTALL = YES \ No newline at end of file diff --git a/Pods/Target Support Files/Commander/Info.plist b/Pods/Target Support Files/Commander/Info.plist new file mode 100644 index 000000000..595bc9ae1 --- /dev/null +++ b/Pods/Target Support Files/Commander/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + org.cocoapods.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 0.2.2 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Pods/Target Support Files/Pods-SwiftGenKitTests/Info.plist b/Pods/Target Support Files/Pods-SwiftGenKitTests/Info.plist new file mode 100644 index 000000000..697454258 --- /dev/null +++ b/Pods/Target Support Files/Pods-SwiftGenKitTests/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + org.cocoapods.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests-acknowledgements.markdown b/Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests-acknowledgements.markdown new file mode 100644 index 000000000..255149a82 --- /dev/null +++ b/Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests-acknowledgements.markdown @@ -0,0 +1,3 @@ +# Acknowledgements +This application makes use of the following third party libraries: +Generated by CocoaPods - http://cocoapods.org diff --git a/Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests-acknowledgements.plist b/Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests-acknowledgements.plist new file mode 100644 index 000000000..e4edebe92 --- /dev/null +++ b/Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests-acknowledgements.plist @@ -0,0 +1,29 @@ + + + + + PreferenceSpecifiers + + + FooterText + This application makes use of the following third party libraries: + Title + Acknowledgements + Type + PSGroupSpecifier + + + FooterText + Generated by CocoaPods - http://cocoapods.org + Title + + Type + PSGroupSpecifier + + + StringsTable + Acknowledgements + Title + Acknowledgements + + diff --git a/Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests-dummy.m b/Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests-dummy.m new file mode 100644 index 000000000..d8d8a2d3d --- /dev/null +++ b/Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_SwiftGenKitTests : NSObject +@end +@implementation PodsDummy_Pods_SwiftGenKitTests +@end diff --git a/Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests-frameworks.sh b/Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests-frameworks.sh new file mode 100755 index 000000000..054141873 --- /dev/null +++ b/Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests-frameworks.sh @@ -0,0 +1,91 @@ +#!/bin/sh +set -e + +echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" +mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + +SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" + +install_framework() +{ + if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then + local source="${BUILT_PRODUCTS_DIR}/$1" + elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then + local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" + elif [ -r "$1" ]; then + local source="$1" + fi + + local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + + if [ -L "${source}" ]; then + echo "Symlinked..." + source="$(readlink "${source}")" + fi + + # use filter instead of exclude so missing patterns dont' throw errors + echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + + local basename + basename="$(basename -s .framework "$1")" + binary="${destination}/${basename}.framework/${basename}" + if ! [ -r "$binary" ]; then + binary="${destination}/${basename}" + fi + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then + strip_invalid_archs "$binary" + fi + + # Resign the code if required by the build settings to avoid unstable apps + code_sign_if_enabled "${destination}/$(basename "$1")" + + # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. + if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then + local swift_runtime_libs + swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) + for lib in $swift_runtime_libs; do + echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" + rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" + code_sign_if_enabled "${destination}/${lib}" + done + fi +} + +# Signs a framework with the provided identity +code_sign_if_enabled() { + if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then + # Use the current code_sign_identitiy + echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" + echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\"" + /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" + fi +} + +# Strip invalid architectures +strip_invalid_archs() { + binary="$1" + # Get architectures for current file + archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" + stripped="" + for arch in $archs; do + if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then + # Strip non-valid architectures in-place + lipo -remove "$arch" -output "$binary" "$binary" || exit 1 + stripped="$stripped $arch" + fi + done + if [[ "$stripped" ]]; then + echo "Stripped $binary of architectures:$stripped" + fi +} + + +if [[ "$CONFIGURATION" == "Debug" ]]; then + install_framework "Pods-SwiftGenKitTests/SwiftGenKit.framework" +fi +if [[ "$CONFIGURATION" == "Release" ]]; then + install_framework "Pods-SwiftGenKitTests/SwiftGenKit.framework" +fi diff --git a/Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests-resources.sh b/Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests-resources.sh new file mode 100755 index 000000000..16774fb46 --- /dev/null +++ b/Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests-resources.sh @@ -0,0 +1,95 @@ +#!/bin/sh +set -e + +mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + +RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt +> "$RESOURCES_TO_COPY" + +XCASSET_FILES=() + +realpath() { + DIRECTORY="$(cd "${1%/*}" && pwd)" + FILENAME="${1##*/}" + echo "$DIRECTORY/$FILENAME" +} + +install_resource() +{ + case $1 in + *.storyboard) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" + ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" + ;; + *.xib) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" + ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" + ;; + *.framework) + echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + ;; + *.xcdatamodel) + echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" + xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" + ;; + *.xcdatamodeld) + echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" + xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" + ;; + *.xcmappingmodel) + echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" + xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" + ;; + *.xcassets) + ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1") + XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") + ;; + /*) + echo "$1" + echo "$1" >> "$RESOURCES_TO_COPY" + ;; + *) + echo "${PODS_ROOT}/$1" + echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" + ;; + esac +} + +mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then + mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi +rm -f "$RESOURCES_TO_COPY" + +if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] +then + case "${TARGETED_DEVICE_FAMILY}" in + 1,2) + TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" + ;; + 1) + TARGET_DEVICE_ARGS="--target-device iphone" + ;; + 2) + TARGET_DEVICE_ARGS="--target-device ipad" + ;; + *) + TARGET_DEVICE_ARGS="--target-device mac" + ;; + esac + + # Find all other xcassets (this unfortunately includes those of path pods and other targets). + OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) + while read line; do + if [[ $line != "`realpath $PODS_ROOT`*" ]]; then + XCASSET_FILES+=("$line") + fi + done <<<"$OTHER_XCASSETS" + + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi diff --git a/Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests-umbrella.h b/Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests-umbrella.h new file mode 100644 index 000000000..f31a1dd13 --- /dev/null +++ b/Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests-umbrella.h @@ -0,0 +1,6 @@ +#import + + +FOUNDATION_EXPORT double Pods_SwiftGenKitTestsVersionNumber; +FOUNDATION_EXPORT const unsigned char Pods_SwiftGenKitTestsVersionString[]; + diff --git a/Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests.debug.xcconfig b/Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests.debug.xcconfig new file mode 100644 index 000000000..66129839d --- /dev/null +++ b/Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests.debug.xcconfig @@ -0,0 +1,9 @@ +CODE_SIGN_IDENTITY = +EMBEDDED_CONTENT_CONTAINS_SWIFT = YES +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/Frameworks' +OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/SwiftGenKit.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "SwiftGenKit" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-SwiftGenKitTests +PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests.modulemap b/Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests.modulemap new file mode 100644 index 000000000..c12dded7d --- /dev/null +++ b/Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests.modulemap @@ -0,0 +1,6 @@ +framework module Pods_SwiftGenKitTests { + umbrella header "Pods-SwiftGenKitTests-umbrella.h" + + export * + module * { export * } +} diff --git a/Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests.release.xcconfig b/Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests.release.xcconfig new file mode 100644 index 000000000..66129839d --- /dev/null +++ b/Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests.release.xcconfig @@ -0,0 +1,9 @@ +CODE_SIGN_IDENTITY = +EMBEDDED_CONTENT_CONTAINS_SWIFT = YES +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/Frameworks' +OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/SwiftGenKit.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "SwiftGenKit" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-SwiftGenKitTests +PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/Pods/Target Support Files/Pods-swiftgen/Info.plist b/Pods/Target Support Files/Pods-swiftgen/Info.plist new file mode 100644 index 000000000..697454258 --- /dev/null +++ b/Pods/Target Support Files/Pods-swiftgen/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + org.cocoapods.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen-acknowledgements.markdown b/Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen-acknowledgements.markdown new file mode 100644 index 000000000..8baa0815a --- /dev/null +++ b/Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen-acknowledgements.markdown @@ -0,0 +1,34 @@ +# Acknowledgements +This application makes use of the following third party libraries: + +## Commander + +Copyright (c) 2015, Kyle Fuller +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the {organization} nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Generated by CocoaPods - http://cocoapods.org diff --git a/Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen-acknowledgements.plist b/Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen-acknowledgements.plist new file mode 100644 index 000000000..696e8789b --- /dev/null +++ b/Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen-acknowledgements.plist @@ -0,0 +1,64 @@ + + + + + PreferenceSpecifiers + + + FooterText + This application makes use of the following third party libraries: + Title + Acknowledgements + Type + PSGroupSpecifier + + + FooterText + Copyright (c) 2015, Kyle Fuller +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the {organization} nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + Title + Commander + Type + PSGroupSpecifier + + + FooterText + Generated by CocoaPods - http://cocoapods.org + Title + + Type + PSGroupSpecifier + + + StringsTable + Acknowledgements + Title + Acknowledgements + + diff --git a/Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen-dummy.m b/Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen-dummy.m new file mode 100644 index 000000000..e8620f21b --- /dev/null +++ b/Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_swiftgen : NSObject +@end +@implementation PodsDummy_Pods_swiftgen +@end diff --git a/Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen-frameworks.sh b/Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen-frameworks.sh new file mode 100755 index 000000000..390c567c0 --- /dev/null +++ b/Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen-frameworks.sh @@ -0,0 +1,93 @@ +#!/bin/sh +set -e + +echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" +mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + +SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" + +install_framework() +{ + if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then + local source="${BUILT_PRODUCTS_DIR}/$1" + elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then + local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" + elif [ -r "$1" ]; then + local source="$1" + fi + + local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + + if [ -L "${source}" ]; then + echo "Symlinked..." + source="$(readlink "${source}")" + fi + + # use filter instead of exclude so missing patterns dont' throw errors + echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + + local basename + basename="$(basename -s .framework "$1")" + binary="${destination}/${basename}.framework/${basename}" + if ! [ -r "$binary" ]; then + binary="${destination}/${basename}" + fi + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then + strip_invalid_archs "$binary" + fi + + # Resign the code if required by the build settings to avoid unstable apps + code_sign_if_enabled "${destination}/$(basename "$1")" + + # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. + if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then + local swift_runtime_libs + swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) + for lib in $swift_runtime_libs; do + echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" + rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" + code_sign_if_enabled "${destination}/${lib}" + done + fi +} + +# Signs a framework with the provided identity +code_sign_if_enabled() { + if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then + # Use the current code_sign_identitiy + echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" + echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\"" + /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" + fi +} + +# Strip invalid architectures +strip_invalid_archs() { + binary="$1" + # Get architectures for current file + archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" + stripped="" + for arch in $archs; do + if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then + # Strip non-valid architectures in-place + lipo -remove "$arch" -output "$binary" "$binary" || exit 1 + stripped="$stripped $arch" + fi + done + if [[ "$stripped" ]]; then + echo "Stripped $binary of architectures:$stripped" + fi +} + + +if [[ "$CONFIGURATION" == "Debug" ]]; then + install_framework "Pods-swiftgen/Commander.framework" + install_framework "Pods-swiftgen/SwiftGenKit.framework" +fi +if [[ "$CONFIGURATION" == "Release" ]]; then + install_framework "Pods-swiftgen/Commander.framework" + install_framework "Pods-swiftgen/SwiftGenKit.framework" +fi diff --git a/Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen-resources.sh b/Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen-resources.sh new file mode 100755 index 000000000..16774fb46 --- /dev/null +++ b/Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen-resources.sh @@ -0,0 +1,95 @@ +#!/bin/sh +set -e + +mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + +RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt +> "$RESOURCES_TO_COPY" + +XCASSET_FILES=() + +realpath() { + DIRECTORY="$(cd "${1%/*}" && pwd)" + FILENAME="${1##*/}" + echo "$DIRECTORY/$FILENAME" +} + +install_resource() +{ + case $1 in + *.storyboard) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" + ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" + ;; + *.xib) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" + ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" + ;; + *.framework) + echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + ;; + *.xcdatamodel) + echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" + xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" + ;; + *.xcdatamodeld) + echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" + xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" + ;; + *.xcmappingmodel) + echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" + xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" + ;; + *.xcassets) + ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1") + XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") + ;; + /*) + echo "$1" + echo "$1" >> "$RESOURCES_TO_COPY" + ;; + *) + echo "${PODS_ROOT}/$1" + echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" + ;; + esac +} + +mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then + mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi +rm -f "$RESOURCES_TO_COPY" + +if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] +then + case "${TARGETED_DEVICE_FAMILY}" in + 1,2) + TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" + ;; + 1) + TARGET_DEVICE_ARGS="--target-device iphone" + ;; + 2) + TARGET_DEVICE_ARGS="--target-device ipad" + ;; + *) + TARGET_DEVICE_ARGS="--target-device mac" + ;; + esac + + # Find all other xcassets (this unfortunately includes those of path pods and other targets). + OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) + while read line; do + if [[ $line != "`realpath $PODS_ROOT`*" ]]; then + XCASSET_FILES+=("$line") + fi + done <<<"$OTHER_XCASSETS" + + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi diff --git a/Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen-umbrella.h b/Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen-umbrella.h new file mode 100644 index 000000000..1a5bde8f9 --- /dev/null +++ b/Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen-umbrella.h @@ -0,0 +1,6 @@ +#import + + +FOUNDATION_EXPORT double Pods_swiftgenVersionNumber; +FOUNDATION_EXPORT const unsigned char Pods_swiftgenVersionString[]; + diff --git a/Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen.debug.xcconfig b/Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen.debug.xcconfig new file mode 100644 index 000000000..e26a53e08 --- /dev/null +++ b/Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen.debug.xcconfig @@ -0,0 +1,9 @@ +CODE_SIGN_IDENTITY = +EMBEDDED_CONTENT_CONTAINS_SWIFT = YES +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/Frameworks' +OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/Commander.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/SwiftGenKit.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "Commander" -framework "SwiftGenKit" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-swiftgen +PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen.modulemap b/Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen.modulemap new file mode 100644 index 000000000..a23f31ae3 --- /dev/null +++ b/Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen.modulemap @@ -0,0 +1,6 @@ +framework module Pods_swiftgen { + umbrella header "Pods-swiftgen-umbrella.h" + + export * + module * { export * } +} diff --git a/Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen.release.xcconfig b/Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen.release.xcconfig new file mode 100644 index 000000000..e26a53e08 --- /dev/null +++ b/Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen.release.xcconfig @@ -0,0 +1,9 @@ +CODE_SIGN_IDENTITY = +EMBEDDED_CONTENT_CONTAINS_SWIFT = YES +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/Frameworks' +OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/Commander.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/SwiftGenKit.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "Commander" -framework "SwiftGenKit" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-swiftgen +PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/Pods/Target Support Files/SwiftGenKit/Info.plist b/Pods/Target Support Files/SwiftGenKit/Info.plist new file mode 100644 index 000000000..0786b4fe9 --- /dev/null +++ b/Pods/Target Support Files/SwiftGenKit/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + org.cocoapods.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 0.5.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Pods/Target Support Files/SwiftGenKit/SwiftGenKit-dummy.m b/Pods/Target Support Files/SwiftGenKit/SwiftGenKit-dummy.m new file mode 100644 index 000000000..165a1ec79 --- /dev/null +++ b/Pods/Target Support Files/SwiftGenKit/SwiftGenKit-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_SwiftGenKit : NSObject +@end +@implementation PodsDummy_SwiftGenKit +@end diff --git a/Pods/Target Support Files/SwiftGenKit/SwiftGenKit-prefix.pch b/Pods/Target Support Files/SwiftGenKit/SwiftGenKit-prefix.pch new file mode 100644 index 000000000..b9c163b49 --- /dev/null +++ b/Pods/Target Support Files/SwiftGenKit/SwiftGenKit-prefix.pch @@ -0,0 +1,4 @@ +#ifdef __OBJC__ +#import +#endif + diff --git a/Pods/Target Support Files/SwiftGenKit/SwiftGenKit-umbrella.h b/Pods/Target Support Files/SwiftGenKit/SwiftGenKit-umbrella.h new file mode 100644 index 000000000..b32ee3d9e --- /dev/null +++ b/Pods/Target Support Files/SwiftGenKit/SwiftGenKit-umbrella.h @@ -0,0 +1,6 @@ +#import + + +FOUNDATION_EXPORT double SwiftGenKitVersionNumber; +FOUNDATION_EXPORT const unsigned char SwiftGenKitVersionString[]; + diff --git a/Pods/Target Support Files/SwiftGenKit/SwiftGenKit.modulemap b/Pods/Target Support Files/SwiftGenKit/SwiftGenKit.modulemap new file mode 100644 index 000000000..be83cecdd --- /dev/null +++ b/Pods/Target Support Files/SwiftGenKit/SwiftGenKit.modulemap @@ -0,0 +1,6 @@ +framework module SwiftGenKit { + umbrella header "SwiftGenKit-umbrella.h" + + export * + module * { export * } +} diff --git a/Pods/Target Support Files/SwiftGenKit/SwiftGenKit.xcconfig b/Pods/Target Support Files/SwiftGenKit/SwiftGenKit.xcconfig new file mode 100644 index 000000000..f24f2413b --- /dev/null +++ b/Pods/Target Support Files/SwiftGenKit/SwiftGenKit.xcconfig @@ -0,0 +1,6 @@ +CODE_SIGN_IDENTITY = +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/SwiftGenKit" "${PODS_ROOT}/Headers/Public" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_ROOT = ${SRCROOT} +SKIP_INSTALL = YES \ No newline at end of file diff --git a/Rakefile b/Rakefile index 0b7158bcd..04ae68e7a 100644 --- a/Rakefile +++ b/Rakefile @@ -18,7 +18,8 @@ end ########################################################### desc "Build only the CLI binary" -task :cli do |_, args| +task :build do |_, args| + run %Q(mkdir -p bin) run %Q(#{dev_dir} xcrun -sdk macosx swiftc -O -o bin/swiftgen -F Rome -framework Commander -framework SwiftGenKit swiftgen-cli/*.swift) end @@ -47,7 +48,7 @@ task :clean do run %Q(rm -fr Rome bin) end -task :default => [:dependencies, :cli] +task :default => [:dependencies, :build] ########################################################### diff --git a/SwiftGen.xcodeproj/project.pbxproj b/SwiftGen.xcodeproj/project.pbxproj index efaa6c8eb..98efb3798 100644 --- a/SwiftGen.xcodeproj/project.pbxproj +++ b/SwiftGen.xcodeproj/project.pbxproj @@ -7,23 +7,73 @@ objects = { /* Begin PBXBuildFile section */ - 0901413D1BCC6464002E8617 /* OutputDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0901413C1BCC6464002E8617 /* OutputDestination.swift */; settings = {ASSET_TAGS = (); }; }; - 0901413F1BCC64C9002E8617 /* storyboards.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0901413E1BCC64C9002E8617 /* storyboards.swift */; settings = {ASSET_TAGS = (); }; }; - 090141411BCC64FE002E8617 /* assets.swift in Sources */ = {isa = PBXBuildFile; fileRef = 090141401BCC64FE002E8617 /* assets.swift */; settings = {ASSET_TAGS = (); }; }; - 0901414E1BCC70D7002E8617 /* SwiftGenKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 0901414D1BCC70D7002E8617 /* SwiftGenKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 0901416A1BCC710B002E8617 /* AssetsEnumBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 090141631BCC710B002E8617 /* AssetsEnumBuilder.swift */; settings = {ASSET_TAGS = (); }; }; - 0901416B1BCC710B002E8617 /* ColorEnumBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 090141641BCC710B002E8617 /* ColorEnumBuilder.swift */; settings = {ASSET_TAGS = (); }; }; - 0901416C1BCC710B002E8617 /* L10nEnumBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 090141651BCC710B002E8617 /* L10nEnumBuilder.swift */; settings = {ASSET_TAGS = (); }; }; - 0901416D1BCC710B002E8617 /* StoryboardEnumBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 090141661BCC710B002E8617 /* StoryboardEnumBuilder.swift */; settings = {ASSET_TAGS = (); }; }; - 090141721BCC7298002E8617 /* Commander.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 090141421BCC6D47002E8617 /* Commander.framework */; }; - 090141741BCC77AF002E8617 /* SwiftGenKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 090141731BCC77AF002E8617 /* SwiftGenKit.framework */; }; - 090141781BCC890D002E8617 /* Indentation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 090141761BCC890D002E8617 /* Indentation.swift */; settings = {ASSET_TAGS = (); }; }; - 090141791BCC890D002E8617 /* SwiftIdentifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 090141771BCC890D002E8617 /* SwiftIdentifier.swift */; settings = {ASSET_TAGS = (); }; }; - 09C7B2D41BCC382800D7F488 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09C7B2D31BCC382800D7F488 /* main.swift */; }; + 09A87B481BCC9BAD00D9B9F5 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09C7B2D31BCC382800D7F488 /* main.swift */; settings = {ASSET_TAGS = (); }; }; + 09A87B491BCC9BB200D9B9F5 /* OutputDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0901413C1BCC6464002E8617 /* OutputDestination.swift */; settings = {ASSET_TAGS = (); }; }; + 09A87B4A1BCC9BB200D9B9F5 /* storyboards.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0901413E1BCC64C9002E8617 /* storyboards.swift */; settings = {ASSET_TAGS = (); }; }; + 09A87B4B1BCC9BB200D9B9F5 /* assets.swift in Sources */ = {isa = PBXBuildFile; fileRef = 090141401BCC64FE002E8617 /* assets.swift */; settings = {ASSET_TAGS = (); }; }; + 09A87B581BCCA2CF00D9B9F5 /* TestsHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09030C171B6D43D400275BF5 /* TestsHelper.swift */; settings = {ASSET_TAGS = (); }; }; + 09A87B591BCCA2CF00D9B9F5 /* SwiftIdentifierTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09E714711B6D711A007FF3CF /* SwiftIdentifierTests.swift */; settings = {ASSET_TAGS = (); }; }; + 09A87B5A1BCCA37200D9B9F5 /* StoryboardTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09030BC91B6D2BB700275BF5 /* StoryboardTests.swift */; settings = {ASSET_TAGS = (); }; }; + 09A87B5B1BCCA37800D9B9F5 /* AssetsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09030BD11B6D2E3900275BF5 /* AssetsTests.swift */; settings = {ASSET_TAGS = (); }; }; + 09A87B5C1BCCA37F00D9B9F5 /* ColorsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09030BD81B6D2E5900275BF5 /* ColorsTests.swift */; settings = {ASSET_TAGS = (); }; }; + 09A87B5D1BCCA38400D9B9F5 /* L10nTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09030BD51B6D2E3900275BF5 /* L10nTests.swift */; settings = {ASSET_TAGS = (); }; }; + 09A87B5E1BCCA4D100D9B9F5 /* Message.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 09030C0B1B6D30E800275BF5 /* Message.storyboard */; settings = {ASSET_TAGS = (); }; }; + 09A87B5F1BCCA4D100D9B9F5 /* Wizard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 09030C0C1B6D30E800275BF5 /* Wizard.storyboard */; settings = {ASSET_TAGS = (); }; }; + 09A87B601BCCA4D100D9B9F5 /* MessageWithDefaults.swift.out in Resources */ = {isa = PBXBuildFile; fileRef = 09030C091B6D30DB00275BF5 /* MessageWithDefaults.swift.out */; settings = {ASSET_TAGS = (); }; }; + 09A87B611BCCA4D100D9B9F5 /* AllWithDefaults.swift.out in Resources */ = {isa = PBXBuildFile; fileRef = 09030C0F1B6D315C00275BF5 /* AllWithDefaults.swift.out */; settings = {ASSET_TAGS = (); }; }; + 09A87B621BCCA4D100D9B9F5 /* MessageWithCustomNames.swift.out in Resources */ = {isa = PBXBuildFile; fileRef = 09030C131B6D3D5600275BF5 /* MessageWithCustomNames.swift.out */; settings = {ASSET_TAGS = (); }; }; + 09A87B631BCCA4D100D9B9F5 /* MessageWithCustomIndentation.swift.out in Resources */ = {isa = PBXBuildFile; fileRef = 09030C151B6D414800275BF5 /* MessageWithCustomIndentation.swift.out */; settings = {ASSET_TAGS = (); }; }; + 09A87B641BCCA4DC00D9B9F5 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 09030C2F1B6D4F8500275BF5 /* Images.xcassets */; settings = {ASSET_TAGS = (); }; }; + 09A87B651BCCA4DC00D9B9F5 /* AssetsFileDefaults.swift.out in Resources */ = {isa = PBXBuildFile; fileRef = 09030C311B6D504100275BF5 /* AssetsFileDefaults.swift.out */; settings = {ASSET_TAGS = (); }; }; + 09A87B661BCCA4DC00D9B9F5 /* AssetsEntriesDefaults.swift.out in Resources */ = {isa = PBXBuildFile; fileRef = 09E7146F1B6D707E007FF3CF /* AssetsEntriesDefaults.swift.out */; settings = {ASSET_TAGS = (); }; }; + 09A87B671BCCA4E600D9B9F5 /* colors.txt in Resources */ = {isa = PBXBuildFile; fileRef = 09030C1D1B6D473E00275BF5 /* colors.txt */; settings = {ASSET_TAGS = (); }; }; + 09A87B681BCCA4E600D9B9F5 /* ListDefaults.swift.out in Resources */ = {isa = PBXBuildFile; fileRef = 09030C201B6D474C00275BF5 /* ListDefaults.swift.out */; settings = {ASSET_TAGS = (); }; }; + 09A87B691BCCA4E600D9B9F5 /* FileDefaults.swift.out in Resources */ = {isa = PBXBuildFile; fileRef = 09030C301B6D4FD200275BF5 /* FileDefaults.swift.out */; settings = {ASSET_TAGS = (); }; }; + 09A87B6C1BCCA5F600D9B9F5 /* EntriesWithDefaults.swift.out in Resources */ = {isa = PBXBuildFile; fileRef = 09030C261B6D492E00275BF5 /* EntriesWithDefaults.swift.out */; settings = {ASSET_TAGS = (); }; }; + 09A87B6D1BCCA5F600D9B9F5 /* FileWithDefaults.swift.out in Resources */ = {isa = PBXBuildFile; fileRef = 09030C2A1B6D4D9A00275BF5 /* FileWithDefaults.swift.out */; settings = {ASSET_TAGS = (); }; }; + 09A87B6E1BCCA5F600D9B9F5 /* FileWithCustomName.swift.out in Resources */ = {isa = PBXBuildFile; fileRef = 095685EB1B6DA16200BF300C /* FileWithCustomName.swift.out */; settings = {ASSET_TAGS = (); }; }; + 09A87B6F1BCCA5F600D9B9F5 /* FileWithCustomIndentation.swift.out in Resources */ = {isa = PBXBuildFile; fileRef = 095685ED1B6DA17300BF300C /* FileWithCustomIndentation.swift.out */; settings = {ASSET_TAGS = (); }; }; + 09A87B701BCCA5F600D9B9F5 /* LinesWithDefaults.swift.out in Resources */ = {isa = PBXBuildFile; fileRef = 095685EF1B6DA32800BF300C /* LinesWithDefaults.swift.out */; settings = {ASSET_TAGS = (); }; }; + 09A87B711BCCA5FC00D9B9F5 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 09030C241B6D48FC00275BF5 /* Localizable.strings */; settings = {ASSET_TAGS = (); }; }; + 7208A517F3AD3AE509D4A6A1 /* Pods_SwiftGenKitTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B85742845DA08FA0DD5D741C /* Pods_SwiftGenKitTests.framework */; }; + 853259B663FD574B7510C7D3 /* Pods_swiftgen.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E8A3B4DE5528DD17EC369AA3 /* Pods_swiftgen.framework */; }; /* End PBXBuildFile section */ +/* Begin PBXBuildRule section */ + 09A87B6A1BCCA50000D9B9F5 /* PBXBuildRule */ = { + isa = PBXBuildRule; + compilerSpec = com.apple.compilers.pbxcp; + filePatterns = "*.storyboard"; + fileType = pattern.proxy; + isEditable = 1; + outputFiles = ( + ); + script = ""; + }; + 09A87B6B1BCCA52400D9B9F5 /* PBXBuildRule */ = { + isa = PBXBuildRule; + compilerSpec = com.apple.compilers.pbxcp; + filePatterns = "*.xcassets"; + fileType = pattern.proxy; + isEditable = 1; + outputFiles = ( + ); + script = ""; + }; + 09A87B721BCCA60900D9B9F5 /* PBXBuildRule */ = { + isa = PBXBuildRule; + compilerSpec = com.apple.compilers.pbxcp; + filePatterns = Localizable.strings; + fileType = pattern.proxy; + isEditable = 1; + outputFiles = ( + ); + script = ""; + }; +/* End PBXBuildRule section */ + /* Begin PBXCopyFilesBuildPhase section */ - 09C7B2CF1BCC382800D7F488 /* CopyFiles */ = { + 09A87B3F1BCC9B8000D9B9F5 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = /usr/share/man/man1/; @@ -35,21 +85,11 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 090141241BCC4464002E8617 /* UnitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = UnitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 0901413C1BCC6464002E8617 /* OutputDestination.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OutputDestination.swift; sourceTree = ""; }; 0901413E1BCC64C9002E8617 /* storyboards.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = storyboards.swift; sourceTree = ""; }; 090141401BCC64FE002E8617 /* assets.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = assets.swift; sourceTree = ""; }; 090141421BCC6D47002E8617 /* Commander.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Commander.framework; path = Rome/Commander.framework; sourceTree = ""; }; - 0901414B1BCC70D6002E8617 /* SwiftGenKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftGenKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 0901414D1BCC70D7002E8617 /* SwiftGenKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SwiftGenKit.h; sourceTree = ""; }; - 0901414F1BCC70D7002E8617 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 090141631BCC710B002E8617 /* AssetsEnumBuilder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssetsEnumBuilder.swift; sourceTree = ""; }; - 090141641BCC710B002E8617 /* ColorEnumBuilder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ColorEnumBuilder.swift; sourceTree = ""; }; - 090141651BCC710B002E8617 /* L10nEnumBuilder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = L10nEnumBuilder.swift; sourceTree = ""; }; - 090141661BCC710B002E8617 /* StoryboardEnumBuilder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoryboardEnumBuilder.swift; sourceTree = ""; }; 090141731BCC77AF002E8617 /* SwiftGenKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftGenKit.framework; path = Rome/SwiftGenKit.framework; sourceTree = ""; }; - 090141761BCC890D002E8617 /* Indentation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Indentation.swift; sourceTree = ""; }; - 090141771BCC890D002E8617 /* SwiftIdentifier.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftIdentifier.swift; sourceTree = ""; }; 09030BC01B6D2A8F00275BF5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 09030BC91B6D2BB700275BF5 /* StoryboardTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoryboardTests.swift; sourceTree = ""; }; 09030BD11B6D2E3900275BF5 /* AssetsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssetsTests.swift; sourceTree = ""; }; @@ -69,78 +109,53 @@ 09030C2A1B6D4D9A00275BF5 /* FileWithDefaults.swift.out */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FileWithDefaults.swift.out; sourceTree = ""; }; 09030C2F1B6D4F8500275BF5 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 09030C301B6D4FD200275BF5 /* FileDefaults.swift.out */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FileDefaults.swift.out; sourceTree = ""; }; - 09030C311B6D504100275BF5 /* FileDefaults.swift.out */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FileDefaults.swift.out; sourceTree = ""; }; + 09030C311B6D504100275BF5 /* AssetsFileDefaults.swift.out */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AssetsFileDefaults.swift.out; sourceTree = ""; }; 095685EB1B6DA16200BF300C /* FileWithCustomName.swift.out */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FileWithCustomName.swift.out; sourceTree = ""; }; 095685ED1B6DA17300BF300C /* FileWithCustomIndentation.swift.out */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FileWithCustomIndentation.swift.out; sourceTree = ""; }; 095685EF1B6DA32800BF300C /* LinesWithDefaults.swift.out */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LinesWithDefaults.swift.out; sourceTree = ""; }; + 09A87B411BCC9B8000D9B9F5 /* swiftgen */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = swiftgen; sourceTree = BUILT_PRODUCTS_DIR; }; + 09A87B501BCCA2C600D9B9F5 /* UnitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = UnitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 09AA16BD1B9F707200EC253A /* CHANGELOG.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = CHANGELOG.md; sourceTree = ""; }; 09AA16BE1B9F707200EC253A /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; - 09C7B2D11BCC382800D7F488 /* swiftgen-cli */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "swiftgen-cli"; sourceTree = BUILT_PRODUCTS_DIR; }; 09C7B2D31BCC382800D7F488 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; 09E7146D1B6D55B4007FF3CF /* SwiftGen.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = SwiftGen.playground; sourceTree = ""; }; 09E7146E1B6D5946007FF3CF /* Rakefile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; path = Rakefile; sourceTree = ""; }; - 09E7146F1B6D707E007FF3CF /* EntriesDefaults.swift.out */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = EntriesDefaults.swift.out; sourceTree = ""; }; + 09E7146F1B6D707E007FF3CF /* AssetsEntriesDefaults.swift.out */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AssetsEntriesDefaults.swift.out; sourceTree = ""; }; 09E714711B6D711A007FF3CF /* SwiftIdentifierTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftIdentifierTests.swift; sourceTree = ""; }; + 0BC91403FC76BF1B1A22D2D0 /* Pods-swiftgen.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-swiftgen.release.xcconfig"; path = "Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen.release.xcconfig"; sourceTree = ""; }; + 2A75CCA5AAE5CADEF926D27A /* Pods-UnitTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-UnitTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-UnitTests/Pods-UnitTests.release.xcconfig"; sourceTree = ""; }; + 474390272C04EB626B2226A1 /* Pods-UnitTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-UnitTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-UnitTests/Pods-UnitTests.debug.xcconfig"; sourceTree = ""; }; + 535AAB2A26F1CF0DC6707E11 /* Pods-swiftgen-cli.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-swiftgen-cli.release.xcconfig"; path = "Pods/Target Support Files/Pods-swiftgen-cli/Pods-swiftgen-cli.release.xcconfig"; sourceTree = ""; }; + 682F146ADE25633DEBA0841F /* Pods_swiftgen_cli.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_swiftgen_cli.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 6BC594142755735441909456 /* Pods-SwiftGenKitTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftGenKitTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests.release.xcconfig"; sourceTree = ""; }; + 750A1F74C9F8434B7CBA32E7 /* Pods-swiftgen.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-swiftgen.debug.xcconfig"; path = "Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen.debug.xcconfig"; sourceTree = ""; }; + 80E3795D317E585FB315C2FC /* Pods-swiftgen-cli.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-swiftgen-cli.debug.xcconfig"; path = "Pods/Target Support Files/Pods-swiftgen-cli/Pods-swiftgen-cli.debug.xcconfig"; sourceTree = ""; }; + B594462FF573E83D0DEF1C64 /* Pods_UnitTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_UnitTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + B85742845DA08FA0DD5D741C /* Pods_SwiftGenKitTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwiftGenKitTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + C0D87FD49BE31CBC79376DA8 /* Pods-SwiftGenKitTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftGenKitTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests.debug.xcconfig"; sourceTree = ""; }; + E8A3B4DE5528DD17EC369AA3 /* Pods_swiftgen.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_swiftgen.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 090141211BCC4464002E8617 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 090141471BCC70D6002E8617 /* Frameworks */ = { + 09A87B3E1BCC9B8000D9B9F5 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 853259B663FD574B7510C7D3 /* Pods_swiftgen.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - 09C7B2CE1BCC382800D7F488 /* Frameworks */ = { + 09A87B4D1BCCA2C600D9B9F5 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 090141741BCC77AF002E8617 /* SwiftGenKit.framework in Frameworks */, - 090141721BCC7298002E8617 /* Commander.framework in Frameworks */, + 7208A517F3AD3AE509D4A6A1 /* Pods_SwiftGenKitTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 0901414C1BCC70D7002E8617 /* SwiftGenKit */ = { - isa = PBXGroup; - children = ( - 090141751BCC890D002E8617 /* Core */, - 090141621BCC710B002E8617 /* EnumBuilders */, - 0901414D1BCC70D7002E8617 /* SwiftGenKit.h */, - 0901414F1BCC70D7002E8617 /* Info.plist */, - ); - path = SwiftGenKit; - sourceTree = ""; - }; - 090141621BCC710B002E8617 /* EnumBuilders */ = { - isa = PBXGroup; - children = ( - 090141631BCC710B002E8617 /* AssetsEnumBuilder.swift */, - 090141641BCC710B002E8617 /* ColorEnumBuilder.swift */, - 090141651BCC710B002E8617 /* L10nEnumBuilder.swift */, - 090141661BCC710B002E8617 /* StoryboardEnumBuilder.swift */, - ); - path = EnumBuilders; - sourceTree = ""; - }; - 090141751BCC890D002E8617 /* Core */ = { - isa = PBXGroup; - children = ( - 090141761BCC890D002E8617 /* Indentation.swift */, - 090141771BCC890D002E8617 /* SwiftIdentifier.swift */, - ); - path = Core; - sourceTree = ""; - }; 09030B621B6D254200275BF5 = { isa = PBXGroup; children = ( @@ -148,20 +163,19 @@ 09AA16BD1B9F707200EC253A /* CHANGELOG.md */, 09AA16BE1B9F707200EC253A /* README.md */, 09C7B2D21BCC382800D7F488 /* swiftgen-cli */, - 0901414C1BCC70D7002E8617 /* SwiftGenKit */, 09030BB51B6D286800275BF5 /* UnitTests */, 09E7146D1B6D55B4007FF3CF /* SwiftGen.playground */, 09030B6C1B6D254200275BF5 /* Products */, C7CAE7DEC00A13462ED83105 /* Frameworks */, + 77F8AFEFEF2F7AE7FEC5293A /* Pods */, ); sourceTree = ""; }; 09030B6C1B6D254200275BF5 /* Products */ = { isa = PBXGroup; children = ( - 09C7B2D11BCC382800D7F488 /* swiftgen-cli */, - 090141241BCC4464002E8617 /* UnitTests.xctest */, - 0901414B1BCC70D6002E8617 /* SwiftGenKit.framework */, + 09A87B411BCC9B8000D9B9F5 /* swiftgen */, + 09A87B501BCCA2C600D9B9F5 /* UnitTests.xctest */, ); name = Products; sourceTree = ""; @@ -280,8 +294,8 @@ 09030C2D1B6D4F6600275BF5 /* expected */ = { isa = PBXGroup; children = ( - 09030C311B6D504100275BF5 /* FileDefaults.swift.out */, - 09E7146F1B6D707E007FF3CF /* EntriesDefaults.swift.out */, + 09030C311B6D504100275BF5 /* AssetsFileDefaults.swift.out */, + 09E7146F1B6D707E007FF3CF /* AssetsEntriesDefaults.swift.out */, ); path = expected; sourceTree = ""; @@ -305,80 +319,78 @@ path = "swiftgen-cli"; sourceTree = ""; }; + 77F8AFEFEF2F7AE7FEC5293A /* Pods */ = { + isa = PBXGroup; + children = ( + 80E3795D317E585FB315C2FC /* Pods-swiftgen-cli.debug.xcconfig */, + 535AAB2A26F1CF0DC6707E11 /* Pods-swiftgen-cli.release.xcconfig */, + 750A1F74C9F8434B7CBA32E7 /* Pods-swiftgen.debug.xcconfig */, + 0BC91403FC76BF1B1A22D2D0 /* Pods-swiftgen.release.xcconfig */, + 474390272C04EB626B2226A1 /* Pods-UnitTests.debug.xcconfig */, + 2A75CCA5AAE5CADEF926D27A /* Pods-UnitTests.release.xcconfig */, + C0D87FD49BE31CBC79376DA8 /* Pods-SwiftGenKitTests.debug.xcconfig */, + 6BC594142755735441909456 /* Pods-SwiftGenKitTests.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; C7CAE7DEC00A13462ED83105 /* Frameworks */ = { isa = PBXGroup; children = ( 090141731BCC77AF002E8617 /* SwiftGenKit.framework */, 090141421BCC6D47002E8617 /* Commander.framework */, + 682F146ADE25633DEBA0841F /* Pods_swiftgen_cli.framework */, + E8A3B4DE5528DD17EC369AA3 /* Pods_swiftgen.framework */, + B594462FF573E83D0DEF1C64 /* Pods_UnitTests.framework */, + B85742845DA08FA0DD5D741C /* Pods_SwiftGenKitTests.framework */, ); name = Frameworks; sourceTree = ""; }; /* End PBXGroup section */ -/* Begin PBXHeadersBuildPhase section */ - 090141481BCC70D6002E8617 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 0901414E1BCC70D7002E8617 /* SwiftGenKit.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - /* Begin PBXNativeTarget section */ - 090141231BCC4464002E8617 /* UnitTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 090141311BCC4464002E8617 /* Build configuration list for PBXNativeTarget "UnitTests" */; - buildPhases = ( - 090141201BCC4464002E8617 /* Sources */, - 090141211BCC4464002E8617 /* Frameworks */, - 090141221BCC4464002E8617 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = UnitTests; - productName = SwiftGenTests; - productReference = 090141241BCC4464002E8617 /* UnitTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - 0901414A1BCC70D6002E8617 /* SwiftGenKit */ = { + 09A87B401BCC9B8000D9B9F5 /* swiftgen */ = { isa = PBXNativeTarget; - buildConfigurationList = 0901415C1BCC70D7002E8617 /* Build configuration list for PBXNativeTarget "SwiftGenKit" */; + buildConfigurationList = 09A87B451BCC9B8000D9B9F5 /* Build configuration list for PBXNativeTarget "swiftgen" */; buildPhases = ( - 090141461BCC70D6002E8617 /* Sources */, - 090141471BCC70D6002E8617 /* Frameworks */, - 090141481BCC70D6002E8617 /* Headers */, - 090141491BCC70D6002E8617 /* Resources */, + DB9D31DF2217FF2BD5D7CD83 /* Check Pods Manifest.lock */, + 09A87B3D1BCC9B8000D9B9F5 /* Sources */, + 09A87B3E1BCC9B8000D9B9F5 /* Frameworks */, + 09A87B3F1BCC9B8000D9B9F5 /* CopyFiles */, + 1B796448B0837DA367438799 /* Copy Pods Resources */, ); buildRules = ( ); dependencies = ( ); - name = SwiftGenKit; - productName = SwiftGenKit; - productReference = 0901414B1BCC70D6002E8617 /* SwiftGenKit.framework */; - productType = "com.apple.product-type.framework"; + name = swiftgen; + productName = swiftgen; + productReference = 09A87B411BCC9B8000D9B9F5 /* swiftgen */; + productType = "com.apple.product-type.tool"; }; - 09C7B2D01BCC382800D7F488 /* swiftgen-cli */ = { + 09A87B4F1BCCA2C600D9B9F5 /* UnitTests */ = { isa = PBXNativeTarget; - buildConfigurationList = 09C7B2D71BCC382800D7F488 /* Build configuration list for PBXNativeTarget "swiftgen-cli" */; + buildConfigurationList = 09A87B551BCCA2C600D9B9F5 /* Build configuration list for PBXNativeTarget "UnitTests" */; buildPhases = ( - 09C7B2CD1BCC382800D7F488 /* Sources */, - 09C7B2CE1BCC382800D7F488 /* Frameworks */, - 09C7B2CF1BCC382800D7F488 /* CopyFiles */, + B84C81A87A5797C0960C5265 /* Check Pods Manifest.lock */, + 09A87B4C1BCCA2C600D9B9F5 /* Sources */, + 09A87B4D1BCCA2C600D9B9F5 /* Frameworks */, + 09A87B4E1BCCA2C600D9B9F5 /* Resources */, + 0DD5F754439C27D8347C15AB /* Embed Pods Frameworks */, + 2E4391D5D5B0C20D0DCE260A /* Copy Pods Resources */, ); buildRules = ( + 09A87B721BCCA60900D9B9F5 /* PBXBuildRule */, + 09A87B6B1BCCA52400D9B9F5 /* PBXBuildRule */, + 09A87B6A1BCCA50000D9B9F5 /* PBXBuildRule */, ); dependencies = ( ); - name = "swiftgen-cli"; - productName = swiftgen; - productReference = 09C7B2D11BCC382800D7F488 /* swiftgen-cli */; - productType = "com.apple.product-type.tool"; + name = UnitTests; + productName = SwiftGenKitTests; + productReference = 09A87B501BCCA2C600D9B9F5 /* UnitTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; }; /* End PBXNativeTarget section */ @@ -390,13 +402,10 @@ LastUpgradeCheck = 0700; ORGANIZATIONNAME = AliSoftware; TargetAttributes = { - 090141231BCC4464002E8617 = { - CreatedOnToolsVersion = 7.0.1; - }; - 0901414A1BCC70D6002E8617 = { + 09A87B401BCC9B8000D9B9F5 = { CreatedOnToolsVersion = 7.0.1; }; - 09C7B2D01BCC382800D7F488 = { + 09A87B4F1BCCA2C600D9B9F5 = { CreatedOnToolsVersion = 7.0.1; }; }; @@ -413,136 +422,146 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 09C7B2D01BCC382800D7F488 /* swiftgen-cli */, - 0901414A1BCC70D6002E8617 /* SwiftGenKit */, - 090141231BCC4464002E8617 /* UnitTests */, + 09A87B401BCC9B8000D9B9F5 /* swiftgen */, + 09A87B4F1BCCA2C600D9B9F5 /* UnitTests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 090141221BCC4464002E8617 /* Resources */ = { + 09A87B4E1BCCA2C600D9B9F5 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 09A87B671BCCA4E600D9B9F5 /* colors.txt in Resources */, + 09A87B681BCCA4E600D9B9F5 /* ListDefaults.swift.out in Resources */, + 09A87B601BCCA4D100D9B9F5 /* MessageWithDefaults.swift.out in Resources */, + 09A87B701BCCA5F600D9B9F5 /* LinesWithDefaults.swift.out in Resources */, + 09A87B5E1BCCA4D100D9B9F5 /* Message.storyboard in Resources */, + 09A87B641BCCA4DC00D9B9F5 /* Images.xcassets in Resources */, + 09A87B621BCCA4D100D9B9F5 /* MessageWithCustomNames.swift.out in Resources */, + 09A87B5F1BCCA4D100D9B9F5 /* Wizard.storyboard in Resources */, + 09A87B6C1BCCA5F600D9B9F5 /* EntriesWithDefaults.swift.out in Resources */, + 09A87B6F1BCCA5F600D9B9F5 /* FileWithCustomIndentation.swift.out in Resources */, + 09A87B691BCCA4E600D9B9F5 /* FileDefaults.swift.out in Resources */, + 09A87B6D1BCCA5F600D9B9F5 /* FileWithDefaults.swift.out in Resources */, + 09A87B6E1BCCA5F600D9B9F5 /* FileWithCustomName.swift.out in Resources */, + 09A87B711BCCA5FC00D9B9F5 /* Localizable.strings in Resources */, + 09A87B631BCCA4D100D9B9F5 /* MessageWithCustomIndentation.swift.out in Resources */, + 09A87B661BCCA4DC00D9B9F5 /* AssetsEntriesDefaults.swift.out in Resources */, + 09A87B611BCCA4D100D9B9F5 /* AllWithDefaults.swift.out in Resources */, + 09A87B651BCCA4DC00D9B9F5 /* AssetsFileDefaults.swift.out in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; - 090141491BCC70D6002E8617 /* Resources */ = { - isa = PBXResourcesBuildPhase; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 0DD5F754439C27D8347C15AB /* Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); + inputPaths = ( + ); + name = "Embed Pods Frameworks"; + outputPaths = ( + ); runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests-frameworks.sh\"\n"; + showEnvVarsInLog = 0; }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 090141201BCC4464002E8617 /* Sources */ = { - isa = PBXSourcesBuildPhase; + 1B796448B0837DA367438799 /* Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); + inputPaths = ( + ); + name = "Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-swiftgen/Pods-swiftgen-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + 2E4391D5D5B0C20D0DCE260A /* Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy Pods Resources"; + outputPaths = ( + ); runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwiftGenKitTests/Pods-SwiftGenKitTests-resources.sh\"\n"; + showEnvVarsInLog = 0; }; - 090141461BCC70D6002E8617 /* Sources */ = { + B84C81A87A5797C0960C5265 /* Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + DB9D31DF2217FF2BD5D7CD83 /* Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 09A87B3D1BCC9B8000D9B9F5 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 090141791BCC890D002E8617 /* SwiftIdentifier.swift in Sources */, - 0901416C1BCC710B002E8617 /* L10nEnumBuilder.swift in Sources */, - 0901416B1BCC710B002E8617 /* ColorEnumBuilder.swift in Sources */, - 0901416A1BCC710B002E8617 /* AssetsEnumBuilder.swift in Sources */, - 0901416D1BCC710B002E8617 /* StoryboardEnumBuilder.swift in Sources */, - 090141781BCC890D002E8617 /* Indentation.swift in Sources */, + 09A87B4A1BCC9BB200D9B9F5 /* storyboards.swift in Sources */, + 09A87B491BCC9BB200D9B9F5 /* OutputDestination.swift in Sources */, + 09A87B481BCC9BAD00D9B9F5 /* main.swift in Sources */, + 09A87B4B1BCC9BB200D9B9F5 /* assets.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - 09C7B2CD1BCC382800D7F488 /* Sources */ = { + 09A87B4C1BCCA2C600D9B9F5 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 09C7B2D41BCC382800D7F488 /* main.swift in Sources */, - 0901413F1BCC64C9002E8617 /* storyboards.swift in Sources */, - 090141411BCC64FE002E8617 /* assets.swift in Sources */, - 0901413D1BCC6464002E8617 /* OutputDestination.swift in Sources */, + 09A87B5B1BCCA37800D9B9F5 /* AssetsTests.swift in Sources */, + 09A87B5A1BCCA37200D9B9F5 /* StoryboardTests.swift in Sources */, + 09A87B5D1BCCA38400D9B9F5 /* L10nTests.swift in Sources */, + 09A87B591BCCA2CF00D9B9F5 /* SwiftIdentifierTests.swift in Sources */, + 09A87B581BCCA2CF00D9B9F5 /* TestsHelper.swift in Sources */, + 09A87B5C1BCCA37F00D9B9F5 /* ColorsTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin XCBuildConfiguration section */ - 0901412E1BCC4464002E8617 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = SwiftGenTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.11; - PRODUCT_BUNDLE_IDENTIFIER = com.alisoftware.SwiftGenTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 0901412F1BCC4464002E8617 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = SwiftGenTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.11; - PRODUCT_BUNDLE_IDENTIFIER = com.alisoftware.SwiftGenTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; - 0901415D1BCC70D7002E8617 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ENABLE_MODULES = YES; - COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_VERSION = A; - INFOPLIST_FILE = SwiftGenKit/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.11; - PRODUCT_BUNDLE_IDENTIFIER = com.alisoftware.SwiftGenKit; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - 0901415E1BCC70D7002E8617 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ENABLE_MODULES = YES; - COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_VERSION = A; - INFOPLIST_FILE = SwiftGenKit/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.11; - PRODUCT_BUNDLE_IDENTIFIER = com.alisoftware.SwiftGenKit; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; 09030B701B6D254200275BF5 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -621,65 +640,76 @@ }; name = Release; }; - 09C7B2D51BCC382800D7F488 /* Debug */ = { + 09A87B461BCC9B8000D9B9F5 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 750A1F74C9F8434B7CBA32E7 /* Pods-swiftgen.debug.xcconfig */; buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Rome", - ); MACOSX_DEPLOYMENT_TARGET = 10.11; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; }; - 09C7B2D61BCC382800D7F488 /* Release */ = { + 09A87B471BCC9B8000D9B9F5 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 0BC91403FC76BF1B1A22D2D0 /* Pods-swiftgen.release.xcconfig */; buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Rome", - ); MACOSX_DEPLOYMENT_TARGET = 10.11; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; }; + 09A87B561BCCA2C600D9B9F5 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C0D87FD49BE31CBC79376DA8 /* Pods-SwiftGenKitTests.debug.xcconfig */; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = UnitTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.11; + PRODUCT_BUNDLE_IDENTIFIER = com.alisoftware.SwiftGenKitTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 09A87B571BCCA2C600D9B9F5 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 6BC594142755735441909456 /* Pods-SwiftGenKitTests.release.xcconfig */; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = UnitTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.11; + PRODUCT_BUNDLE_IDENTIFIER = com.alisoftware.SwiftGenKitTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 090141311BCC4464002E8617 /* Build configuration list for PBXNativeTarget "UnitTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 0901412E1BCC4464002E8617 /* Debug */, - 0901412F1BCC4464002E8617 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 0901415C1BCC70D7002E8617 /* Build configuration list for PBXNativeTarget "SwiftGenKit" */ = { + 09030B661B6D254200275BF5 /* Build configuration list for PBXProject "SwiftGen" */ = { isa = XCConfigurationList; buildConfigurations = ( - 0901415D1BCC70D7002E8617 /* Debug */, - 0901415E1BCC70D7002E8617 /* Release */, + 09030B701B6D254200275BF5 /* Debug */, + 09030B711B6D254200275BF5 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 09030B661B6D254200275BF5 /* Build configuration list for PBXProject "SwiftGen" */ = { + 09A87B451BCC9B8000D9B9F5 /* Build configuration list for PBXNativeTarget "swiftgen" */ = { isa = XCConfigurationList; buildConfigurations = ( - 09030B701B6D254200275BF5 /* Debug */, - 09030B711B6D254200275BF5 /* Release */, + 09A87B461BCC9B8000D9B9F5 /* Debug */, + 09A87B471BCC9B8000D9B9F5 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 09C7B2D71BCC382800D7F488 /* Build configuration list for PBXNativeTarget "swiftgen-cli" */ = { + 09A87B551BCCA2C600D9B9F5 /* Build configuration list for PBXNativeTarget "UnitTests" */ = { isa = XCConfigurationList; buildConfigurations = ( - 09C7B2D51BCC382800D7F488 /* Debug */, - 09C7B2D61BCC382800D7F488 /* Release */, + 09A87B561BCCA2C600D9B9F5 /* Debug */, + 09A87B571BCCA2C600D9B9F5 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/SwiftGen.xcodeproj/xcshareddata/xcschemes/UnitTests.xcscheme b/SwiftGen.xcodeproj/xcshareddata/xcschemes/UnitTests.xcscheme new file mode 100644 index 000000000..35d8a4d6f --- /dev/null +++ b/SwiftGen.xcodeproj/xcshareddata/xcschemes/UnitTests.xcscheme @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SwiftGen.xcodeproj/xcshareddata/xcschemes/swiftgen-cli.xcscheme b/SwiftGen.xcodeproj/xcshareddata/xcschemes/swiftgen (CLI).xcscheme similarity index 67% rename from SwiftGen.xcodeproj/xcshareddata/xcschemes/swiftgen-cli.xcscheme rename to SwiftGen.xcodeproj/xcshareddata/xcschemes/swiftgen (CLI).xcscheme index 836773d89..1c2e1d9f4 100644 --- a/SwiftGen.xcodeproj/xcshareddata/xcschemes/swiftgen-cli.xcscheme +++ b/SwiftGen.xcodeproj/xcshareddata/xcschemes/swiftgen (CLI).xcscheme @@ -9,14 +9,14 @@ @@ -28,13 +28,23 @@ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> + + + + @@ -51,16 +61,15 @@ debugDocumentVersioning = "YES" debugServiceExtension = "internal" allowLocationSimulation = "YES"> - + - + @@ -70,16 +79,15 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES"> - + - + diff --git a/SwiftGen.xcworkspace/contents.xcworkspacedata b/SwiftGen.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..7678b6c34 --- /dev/null +++ b/SwiftGen.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/SwiftGenKit/EnumBuilders/L10nEnumBuilder.swift b/SwiftGenKit/EnumBuilders/L10nEnumBuilder.swift index 74c209616..7201f4d6d 100644 --- a/SwiftGenKit/EnumBuilders/L10nEnumBuilder.swift +++ b/SwiftGenKit/EnumBuilders/L10nEnumBuilder.swift @@ -124,12 +124,12 @@ public final class L10nEnumBuilder { let key: String let types: [PlaceholderType] - init(key: String, types: [PlaceholderType]) { + public init(key: String, types: [PlaceholderType]) { self.key = key self.types = types } - init(key: String, types: PlaceholderType...) { + public init(key: String, types: PlaceholderType...) { self.key = key self.types = types } @@ -138,7 +138,7 @@ public final class L10nEnumBuilder { return try! NSRegularExpression(pattern: "^\"([^\"]+)\"[ \t]*=[ \t]*\"(.*)\"[ \t]*;", options: []) }() - init?(line: String) { + public init?(line: String) { let range = NSRange(location: 0, length: (line as NSString).length) if let match = Entry.lineRegEx.firstMatchInString(line, options: [], range: range) { let key = (line as NSString).substringWithRange(match.rangeAtIndex(1)) diff --git a/UnitTests/Assets/AssetsTests.swift b/UnitTests/Assets/AssetsTests.swift index 1d5678436..ac7d09434 100644 --- a/UnitTests/Assets/AssetsTests.swift +++ b/UnitTests/Assets/AssetsTests.swift @@ -7,6 +7,7 @@ // import XCTest +import SwiftGenKit /** * Important: In order for the "*.xcassets" files in fixtures/ to be copied as-is in the test bundle @@ -17,22 +18,22 @@ import XCTest class AssetsTests: XCTestCase { func testEntriesWithDefaults() { - let enumBuilder = SwiftGenAssetsEnumBuilder() + let enumBuilder = AssetsEnumBuilder() enumBuilder.addAssetName("Green-Apple") enumBuilder.addAssetName("Red Apple") enumBuilder.addAssetName("2-pears") let result = enumBuilder.build() - let expected = self.fixtureString("EntriesDefaults.swift.out") + let expected = self.fixtureString("AssetsEntriesDefaults.swift.out") XCTDiffStrings(result, expected) } func testFileWithDefaults() { - let enumBuilder = SwiftGenAssetsEnumBuilder() + let enumBuilder = AssetsEnumBuilder() enumBuilder.parseDirectory(fixturePath("Images.xcassets")) let result = enumBuilder.build() - let expected = self.fixtureString("FileDefaults.swift.out") + let expected = self.fixtureString("AssetsFileDefaults.swift.out") XCTDiffStrings(result, expected) } diff --git a/UnitTests/Assets/expected/EntriesDefaults.swift.out b/UnitTests/Assets/expected/AssetsEntriesDefaults.swift.out similarity index 100% rename from UnitTests/Assets/expected/EntriesDefaults.swift.out rename to UnitTests/Assets/expected/AssetsEntriesDefaults.swift.out diff --git a/UnitTests/Assets/expected/FileDefaults.swift.out b/UnitTests/Assets/expected/AssetsFileDefaults.swift.out similarity index 100% rename from UnitTests/Assets/expected/FileDefaults.swift.out rename to UnitTests/Assets/expected/AssetsFileDefaults.swift.out diff --git a/UnitTests/Colors/ColorsTests.swift b/UnitTests/Colors/ColorsTests.swift index 3af326c85..6d5ac8360 100644 --- a/UnitTests/Colors/ColorsTests.swift +++ b/UnitTests/Colors/ColorsTests.swift @@ -7,6 +7,7 @@ // import XCTest +import SwiftGenKit class ColorsTests: XCTestCase { diff --git a/UnitTests/L10n/L10nTests.swift b/UnitTests/L10n/L10nTests.swift index e5ea3c1c1..eeffc4494 100644 --- a/UnitTests/L10n/L10nTests.swift +++ b/UnitTests/L10n/L10nTests.swift @@ -7,13 +7,14 @@ // import XCTest +import SwiftGenKit class L10nTests: XCTestCase { func testEntriesWithDefaults() { - let enumBuilder = SwiftGenL10nEnumBuilder() - enumBuilder.addEntry(SwiftGenL10nEnumBuilder.Entry(key: "Title")) - enumBuilder.addEntry(SwiftGenL10nEnumBuilder.Entry(key: "Greetings", types: .Object, .Int)) + let enumBuilder = L10nEnumBuilder() + enumBuilder.addEntry(L10nEnumBuilder.Entry(key: "Title")) + enumBuilder.addEntry(L10nEnumBuilder.Entry(key: "Greetings", types: .Object, .Int)) let result = enumBuilder.build() let expected = self.fixtureString("EntriesWithDefaults.swift.out") @@ -21,11 +22,11 @@ class L10nTests: XCTestCase { } func testLinesWithDefaults() { - let enumBuilder = SwiftGenL10nEnumBuilder() - if let e = SwiftGenL10nEnumBuilder.Entry(line: "\"AppTitle\" = \"My awesome title\" ; // Yeah") { + let enumBuilder = L10nEnumBuilder() + if let e = L10nEnumBuilder.Entry(line: "\"AppTitle\" = \"My awesome title\" ; // Yeah") { enumBuilder.addEntry(e) } - if let e = SwiftGenL10nEnumBuilder.Entry(line: "\"GreetingsAndAge\"=\"My name is %@, I am %d\";/* hello */") { + if let e = L10nEnumBuilder.Entry(line: "\"GreetingsAndAge\"=\"My name is %@, I am %d\";/* hello */") { enumBuilder.addEntry(e) } let result = enumBuilder.build() @@ -35,7 +36,7 @@ class L10nTests: XCTestCase { } func testFileWithDefaults() { - let enumBuilder = SwiftGenL10nEnumBuilder() + let enumBuilder = L10nEnumBuilder() try! enumBuilder.parseLocalizableStringsFile(fixturePath("Localizable.strings")) let result = enumBuilder.build() @@ -44,7 +45,7 @@ class L10nTests: XCTestCase { } func testFileWithCustomName() { - let enumBuilder = SwiftGenL10nEnumBuilder() + let enumBuilder = L10nEnumBuilder() try! enumBuilder.parseLocalizableStringsFile(fixturePath("Localizable.strings")) let result = enumBuilder.build(enumName: "XCTLoc") @@ -53,7 +54,7 @@ class L10nTests: XCTestCase { } func testFileWithCustomIndentation() { - let enumBuilder = SwiftGenL10nEnumBuilder() + let enumBuilder = L10nEnumBuilder() try! enumBuilder.parseLocalizableStringsFile(fixturePath("Localizable.strings")) let result = enumBuilder.build(indentation: .Spaces(3)) @@ -67,48 +68,48 @@ class L10nTests: XCTestCase { func testParseStringPlaceholder() { - let placeholders = SwiftGenL10nEnumBuilder.PlaceholderType.fromFormatString("%@") + let placeholders = L10nEnumBuilder.PlaceholderType.fromFormatString("%@") XCTAssertEqual(placeholders, [.Object]) } func testParseFloatPlaceholder() { - let placeholders = SwiftGenL10nEnumBuilder.PlaceholderType.fromFormatString("%f") + let placeholders = L10nEnumBuilder.PlaceholderType.fromFormatString("%f") XCTAssertEqual(placeholders, [.Float]) } func testParseDoublePlaceholders() { - let placeholders = SwiftGenL10nEnumBuilder.PlaceholderType.fromFormatString("%g-%e") + let placeholders = L10nEnumBuilder.PlaceholderType.fromFormatString("%g-%e") XCTAssertEqual(placeholders, [.Float, .Float]) } func testParseFloatWithPrecisionPlaceholders() { - let placeholders = SwiftGenL10nEnumBuilder.PlaceholderType.fromFormatString("%1.2f : %.3f : %+3f : %-6.2f") + let placeholders = L10nEnumBuilder.PlaceholderType.fromFormatString("%1.2f : %.3f : %+3f : %-6.2f") XCTAssertEqual(placeholders, [.Float, .Float, .Float, .Float]) } func testParseIntPlaceholders() { - let placeholders = SwiftGenL10nEnumBuilder.PlaceholderType.fromFormatString("%d-%i-%o-%u-%x") + let placeholders = L10nEnumBuilder.PlaceholderType.fromFormatString("%d-%i-%o-%u-%x") XCTAssertEqual(placeholders, [.Int, .Int, .Int, .Int, .Int]) } func testParseCCharAndStringPlaceholders() { - let placeholders = SwiftGenL10nEnumBuilder.PlaceholderType.fromFormatString("%c-%s") + let placeholders = L10nEnumBuilder.PlaceholderType.fromFormatString("%c-%s") XCTAssertEqual(placeholders, [.Char, .CString]) } func testParsePositionalPlaceholders() { - let placeholders = SwiftGenL10nEnumBuilder.PlaceholderType.fromFormatString("%2$d-%4$f-%3$@-%c") + let placeholders = L10nEnumBuilder.PlaceholderType.fromFormatString("%2$d-%4$f-%3$@-%c") XCTAssertEqual(placeholders, [.Char, .Int, .Object, .Float]) } func testParseComplexFormatPlaceholders() { - let placeholders = SwiftGenL10nEnumBuilder.PlaceholderType.fromFormatString("%2$1.3d - %4$-.7f - %3$@ - %% - %5$+3c - %%") + let placeholders = L10nEnumBuilder.PlaceholderType.fromFormatString("%2$1.3d - %4$-.7f - %3$@ - %% - %5$+3c - %%") // positions 2, 4, 3, 5 set to Int, Float, Object, Char, and position 1 not matched, defaulting to Unknown XCTAssertEqual(placeholders, [.Unknown, .Int, .Object, .Float, .Char]) } func testParseEscapePercentSign() { - let placeholders = SwiftGenL10nEnumBuilder.PlaceholderType.fromFormatString("%%foo") + let placeholders = L10nEnumBuilder.PlaceholderType.fromFormatString("%%foo") // Must NOT map to [.Float] XCTAssertEqual(placeholders, []) } diff --git a/UnitTests/Storyboard/StoryboardTests.swift b/UnitTests/Storyboard/StoryboardTests.swift index 12debe9c4..7626f73dc 100644 --- a/UnitTests/Storyboard/StoryboardTests.swift +++ b/UnitTests/Storyboard/StoryboardTests.swift @@ -7,6 +7,7 @@ // import XCTest +import SwiftGenKit /** * Important: In order for the "*.storyboard" files in fixtures/ to be copied as-is in the test bundle @@ -17,7 +18,7 @@ import XCTest class StoryboardTests: XCTestCase { func testMessageWithDefaults() { - let enumBuilder = SwiftGenStoryboardEnumBuilder() + let enumBuilder = StoryboardEnumBuilder() enumBuilder.addStoryboardAtPath(self.fixturePath("Message.storyboard")) let result = enumBuilder.build() @@ -26,7 +27,7 @@ class StoryboardTests: XCTestCase { } func testAllWithDefaults() { - let enumBuilder = SwiftGenStoryboardEnumBuilder() + let enumBuilder = StoryboardEnumBuilder() enumBuilder.parseDirectory(self.fixturesDir) let result = enumBuilder.build() @@ -35,7 +36,7 @@ class StoryboardTests: XCTestCase { } func testMessageWithCustomNames() { - let enumBuilder = SwiftGenStoryboardEnumBuilder() + let enumBuilder = StoryboardEnumBuilder() enumBuilder.addStoryboardAtPath(self.fixturePath("Message.storyboard")) let result = enumBuilder.build(scenesStructName: "XCTAllScenes", seguesStructName: "XCTAllSegues") @@ -44,7 +45,7 @@ class StoryboardTests: XCTestCase { } func testMessageWithCustomIndentation() { - let enumBuilder = SwiftGenStoryboardEnumBuilder() + let enumBuilder = StoryboardEnumBuilder() enumBuilder.addStoryboardAtPath(self.fixturePath("Message.storyboard")) let result = enumBuilder.build(indentation: .Spaces(3)) diff --git a/UnitTests/Storyboard/fixtures/Message.storyboard b/UnitTests/Storyboard/fixtures/Message.storyboard index 3046efdf5..b93ea014d 100644 --- a/UnitTests/Storyboard/fixtures/Message.storyboard +++ b/UnitTests/Storyboard/fixtures/Message.storyboard @@ -1,5 +1,5 @@ - + @@ -15,6 +15,7 @@ + @@ -39,6 +40,7 @@ + Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. @@ -49,12 +51,14 @@ + @@ -73,6 +77,7 @@ + @@ -94,6 +99,7 @@ + diff --git a/swiftgen-cli/main.swift b/swiftgen-cli/main.swift index f7721f1eb..64ad0132a 100644 --- a/swiftgen-cli/main.swift +++ b/swiftgen-cli/main.swift @@ -25,12 +25,6 @@ let outputOption = Option("output", OutputDestination.Console, description: "The // MARK: - Main Group { - $0.command("version") { _ in - print(SwiftGenKitVersionNumber) - } - $0.addCommand("storyboards", storyboards) $0.addCommand("assets", assets) -}.run() - - +}.run("v\(SwiftGenKitVersionNumber)")