{"action":"created","comment":{"url":"https://api.github.com/repos/Carthage/Carthage/pulls/comments/49926075","id":49926075,"diff_hunk":"@@ -14,34 +14,67 @@ import ReactiveCocoa\n \n public struct ArchiveCommand: CommandType {\n \tpublic struct Options: OptionsType {\n-\t\tpublic let frameworkName: String\n \t\tpublic let outputPath: String\n+\t\tpublic let directoryPath: String\n \t\tpublic let colorOptions: ColorOptions\n+\t\tpublic let frameworkNames: [String]\n \n-\t\tstatic func create(outputPath: String) -> ColorOptions -> String -> Options {\n-\t\t\treturn { colorOptions in { frameworkName in\n-\t\t\t\treturn self.init(frameworkName: frameworkName, outputPath: outputPath, colorOptions: colorOptions)\n-\t\t\t} }\n+\t\tstatic func create(outputPath: String) -> String -> ColorOptions -> [String] -> Options {\n+\t\t\treturn { directoryPath in { colorOptions in { frameworkNames in\n+\t\t\t\treturn self.init(outputPath: outputPath, directoryPath: directoryPath, colorOptions: colorOptions, frameworkNames: frameworkNames)\n+\t\t\t} } }\n \t\t}\n \n \t\tpublic static func evaluate(m: CommandMode) -> Result<Options, CommandantError<CarthageError>> {\n \t\t\treturn create\n-\t\t\t\t<*> m <| Option(key: \"output\", defaultValue: \"\", usage: \"the path at which to create the zip file (or blank to infer it from the framework name)\")\n+\t\t\t\t<*> m <| Option(key: \"output\", defaultValue: \"\", usage: \"the path at which to create the zip file (or blank to infer it from the first one of the framework names)\")\n+\t\t\t\t<*> m <| Option(key: \"project-directory\", defaultValue: NSFileManager.defaultManager().currentDirectoryPath, usage: \"the directory containing the Carthage project\")\n \t\t\t\t<*> ColorOptions.evaluate(m)\n-\t\t\t\t<*> m <| Argument(usage: \"the name of the built framework to archive (without any extension)\")\n+\t\t\t\t<*> m <| Argument(defaultValue: [], usage: \"the names of the built frameworks to archive without any extension (or blank to pick up the frameworks in the current project built by `--no-skip-current`)\")\n \t\t}\n \t}\n \t\n \tpublic let verb = \"archive\"\n-\tpublic let function = \"Archives a built framework into a zip that Carthage can use\"\n+\tpublic let function = \"Archives built frameworks into a zip that Carthage can use\"\n \n \tpublic func run(options: Options) -> Result<(), CarthageError> {\n \t\tlet formatting = options.colorOptions.formatting\n \n+\t\tlet frameworks: [String]\n+\t\tif !options.frameworkNames.isEmpty {\n+\t\t\tframeworks = options.frameworkNames.map {\n+\t\t\t\treturn ($0 as NSString).stringByAppendingPathExtension(\"framework\")!\n+\t\t\t}\n+\t\t} else {\n+\t\t\tlet directoryURL = NSURL.fileURLWithPath(options.directoryPath, isDirectory: true)\n+\t\t\tframeworks = locateProjectsInDirectory(directoryURL)\n+\t\t\t\t.flatMap(.Concat) { project in\n+\t\t\t\t\treturn schemesInProject(project)\n+\t\t\t\t\t\t.flatMapError { error in\n+\t\t\t\t\t\t\tif case .NoSharedSchemes = error {\n+\t\t\t\t\t\t\t\treturn .empty\n+\t\t\t\t\t\t\t} else {\n+\t\t\t\t\t\t\t\treturn .init(error: error)\n+\t\t\t\t\t\t\t}\n+\t\t\t\t\t\t}\n+\t\t\t\t\t\t.flatMap(.Merge) { scheme -> SignalProducer<String, CarthageError> in\n+\t\t\t\t\t\t\tlet buildArguments = BuildArguments(project: project, scheme: scheme, configuration: \"Release\")\n+\t\t\t\t\t\t\treturn BuildSettings.loadWithArguments(buildArguments)\n+\t\t\t\t\t\t\t\t.map { $0.wrapperName.value }\n+\t\t\t\t\t\t\t\t.ignoreNil()","path":"Source/carthage/Archive.swift","position":null,"original_position":59,"commit_id":"07cb80a291de247afe73bc2e0d4b05bb3d218c4e","original_commit_id":"8fcdd1f325dd0799414c7b3f2dbf74b9cf53e178","user":{"login":"ikesyo","id":909674,"avatar_url":"https://avatars.githubusercontent.com/u/909674?v=3","gravatar_id":"","url":"https://api.github.com/users/ikesyo","html_url":"https://github.com/ikesyo","followers_url":"https://api.github.com/users/ikesyo/followers","following_url":"https://api.github.com/users/ikesyo/following{/other_user}","gists_url":"https://api.github.com/users/ikesyo/gists{/gist_id}","starred_url":"https://api.github.com/users/ikesyo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ikesyo/subscriptions","organizations_url":"https://api.github.com/users/ikesyo/orgs","repos_url":"https://api.github.com/users/ikesyo/repos","events_url":"https://api.github.com/users/ikesyo/events{/privacy}","received_events_url":"https://api.github.com/users/ikesyo/received_events","type":"User","site_admin":false},"body":"I replaced it with `flatMap`: 07cb80a","created_at":"2016-01-16T02:54:34Z","updated_at":"2016-01-16T02:54:34Z","html_url":"https://github.com/Carthage/Carthage/pull/1005#discussion_r49926075","pull_request_url":"https://api.github.com/repos/Carthage/Carthage/pulls/1005","_links":{"self":{"href":"https://api.github.com/repos/Carthage/Carthage/pulls/comments/49926075"},"html":{"href":"https://github.com/Carthage/Carthage/pull/1005#discussion_r49926075"},"pull_request":{"href":"https://api.github.com/repos/Carthage/Carthage/pulls/1005"}}},"pull_request":{"url":"https://api.github.com/repos/Carthage/Carthage/pulls/1005","id":54063259,"html_url":"https://github.com/Carthage/Carthage/pull/1005","diff_url":"https://github.com/Carthage/Carthage/pull/1005.diff","patch_url":"https://github.com/Carthage/Carthage/pull/1005.patch","issue_url":"https://api.github.com/repos/Carthage/Carthage/issues/1005","number":1005,"state":"open","locked":false,"title":"Support multiple frameworks in `archive` command","user":{"login":"ikesyo","id":909674,"avatar_url":"https://avatars.githubusercontent.com/u/909674?v=3","gravatar_id":"","url":"https://api.github.com/users/ikesyo","html_url":"https://github.com/ikesyo","followers_url":"https://api.github.com/users/ikesyo/followers","following_url":"https://api.github.com/users/ikesyo/following{/other_user}","gists_url":"https://api.github.com/users/ikesyo/gists{/gist_id}","starred_url":"https://api.github.com/users/ikesyo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ikesyo/subscriptions","organizations_url":"https://api.github.com/users/ikesyo/orgs","repos_url":"https://api.github.com/users/ikesyo/repos","events_url":"https://api.github.com/users/ikesyo/events{/privacy}","received_events_url":"https://api.github.com/users/ikesyo/received_events","type":"User","site_admin":false},"body":"This would be useful for some libraries, for example, which have a Objective-C framework and the corresponding Swift one (e.g. https://github.com/CocoaLumberjack/CocoaLumberjack).\r\n\r\n```bash\r\ncarthage archive CocoaLumberjack CocoaLumberjackSwift\r\n```","created_at":"2015-12-18T04:10:49Z","updated_at":"2016-01-16T02:54:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"63f3cc29b487675185f0d0b77e0b2a0d65beed33","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Carthage/Carthage/pulls/1005/commits","review_comments_url":"https://api.github.com/repos/Carthage/Carthage/pulls/1005/comments","review_comment_url":"https://api.github.com/repos/Carthage/Carthage/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Carthage/Carthage/issues/1005/comments","statuses_url":"https://api.github.com/repos/Carthage/Carthage/statuses/07cb80a291de247afe73bc2e0d4b05bb3d218c4e","head":{"label":"Carthage:archive-multiple-frameworks","ref":"archive-multiple-frameworks","sha":"07cb80a291de247afe73bc2e0d4b05bb3d218c4e","user":{"login":"Carthage","id":9146792,"avatar_url":"https://avatars.githubusercontent.com/u/9146792?v=3","gravatar_id":"","url":"https://api.github.com/users/Carthage","html_url":"https://github.com/Carthage","followers_url":"https://api.github.com/users/Carthage/followers","following_url":"https://api.github.com/users/Carthage/following{/other_user}","gists_url":"https://api.github.com/users/Carthage/gists{/gist_id}","starred_url":"https://api.github.com/users/Carthage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Carthage/subscriptions","organizations_url":"https://api.github.com/users/Carthage/orgs","repos_url":"https://api.github.com/users/Carthage/repos","events_url":"https://api.github.com/users/Carthage/events{/privacy}","received_events_url":"https://api.github.com/users/Carthage/received_events","type":"Organization","site_admin":false},"repo":{"id":25050844,"name":"Carthage","full_name":"Carthage/Carthage","owner":{"login":"Carthage","id":9146792,"avatar_url":"https://avatars.githubusercontent.com/u/9146792?v=3","gravatar_id":"","url":"https://api.github.com/users/Carthage","html_url":"https://github.com/Carthage","followers_url":"https://api.github.com/users/Carthage/followers","following_url":"https://api.github.com/users/Carthage/following{/other_user}","gists_url":"https://api.github.com/users/Carthage/gists{/gist_id}","starred_url":"https://api.github.com/users/Carthage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Carthage/subscriptions","organizations_url":"https://api.github.com/users/Carthage/orgs","repos_url":"https://api.github.com/users/Carthage/repos","events_url":"https://api.github.com/users/Carthage/events{/privacy}","received_events_url":"https://api.github.com/users/Carthage/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Carthage/Carthage","description":"A simple, decentralized dependency manager for Cocoa","fork":false,"url":"https://api.github.com/repos/Carthage/Carthage","forks_url":"https://api.github.com/repos/Carthage/Carthage/forks","keys_url":"https://api.github.com/repos/Carthage/Carthage/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Carthage/Carthage/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Carthage/Carthage/teams","hooks_url":"https://api.github.com/repos/Carthage/Carthage/hooks","issue_events_url":"https://api.github.com/repos/Carthage/Carthage/issues/events{/number}","events_url":"https://api.github.com/repos/Carthage/Carthage/events","assignees_url":"https://api.github.com/repos/Carthage/Carthage/assignees{/user}","branches_url":"https://api.github.com/repos/Carthage/Carthage/branches{/branch}","tags_url":"https://api.github.com/repos/Carthage/Carthage/tags","blobs_url":"https://api.github.com/repos/Carthage/Carthage/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Carthage/Carthage/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Carthage/Carthage/git/refs{/sha}","trees_url":"https://api.github.com/repos/Carthage/Carthage/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Carthage/Carthage/statuses/{sha}","languages_url":"https://api.github.com/repos/Carthage/Carthage/languages","stargazers_url":"https://api.github.com/repos/Carthage/Carthage/stargazers","contributors_url":"https://api.github.com/repos/Carthage/Carthage/contributors","subscribers_url":"https://api.github.com/repos/Carthage/Carthage/subscribers","subscription_url":"https://api.github.com/repos/Carthage/Carthage/subscription","commits_url":"https://api.github.com/repos/Carthage/Carthage/commits{/sha}","git_commits_url":"https://api.github.com/repos/Carthage/Carthage/git/commits{/sha}","comments_url":"https://api.github.com/repos/Carthage/Carthage/comments{/number}","issue_comment_url":"https://api.github.com/repos/Carthage/Carthage/issues/comments{/number}","contents_url":"https://api.github.com/repos/Carthage/Carthage/contents/{+path}","compare_url":"https://api.github.com/repos/Carthage/Carthage/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Carthage/Carthage/merges","archive_url":"https://api.github.com/repos/Carthage/Carthage/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Carthage/Carthage/downloads","issues_url":"https://api.github.com/repos/Carthage/Carthage/issues{/number}","pulls_url":"https://api.github.com/repos/Carthage/Carthage/pulls{/number}","milestones_url":"https://api.github.com/repos/Carthage/Carthage/milestones{/number}","notifications_url":"https://api.github.com/repos/Carthage/Carthage/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Carthage/Carthage/labels{/name}","releases_url":"https://api.github.com/repos/Carthage/Carthage/releases{/id}","created_at":"2014-10-10T19:54:55Z","updated_at":"2016-01-16T02:25:15Z","pushed_at":"2016-01-16T02:53:06Z","git_url":"git://github.com/Carthage/Carthage.git","ssh_url":"git@github.com:Carthage/Carthage.git","clone_url":"https://github.com/Carthage/Carthage.git","svn_url":"https://github.com/Carthage/Carthage","homepage":"","size":10834,"stargazers_count":5779,"watchers_count":5779,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":364,"mirror_url":null,"open_issues_count":141,"forks":364,"open_issues":141,"watchers":5779,"default_branch":"master"}},"base":{"label":"Carthage:master","ref":"master","sha":"e92c92f5db59be5b234c4c6c2d2b2f0527b57508","user":{"login":"Carthage","id":9146792,"avatar_url":"https://avatars.githubusercontent.com/u/9146792?v=3","gravatar_id":"","url":"https://api.github.com/users/Carthage","html_url":"https://github.com/Carthage","followers_url":"https://api.github.com/users/Carthage/followers","following_url":"https://api.github.com/users/Carthage/following{/other_user}","gists_url":"https://api.github.com/users/Carthage/gists{/gist_id}","starred_url":"https://api.github.com/users/Carthage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Carthage/subscriptions","organizations_url":"https://api.github.com/users/Carthage/orgs","repos_url":"https://api.github.com/users/Carthage/repos","events_url":"https://api.github.com/users/Carthage/events{/privacy}","received_events_url":"https://api.github.com/users/Carthage/received_events","type":"Organization","site_admin":false},"repo":{"id":25050844,"name":"Carthage","full_name":"Carthage/Carthage","owner":{"login":"Carthage","id":9146792,"avatar_url":"https://avatars.githubusercontent.com/u/9146792?v=3","gravatar_id":"","url":"https://api.github.com/users/Carthage","html_url":"https://github.com/Carthage","followers_url":"https://api.github.com/users/Carthage/followers","following_url":"https://api.github.com/users/Carthage/following{/other_user}","gists_url":"https://api.github.com/users/Carthage/gists{/gist_id}","starred_url":"https://api.github.com/users/Carthage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Carthage/subscriptions","organizations_url":"https://api.github.com/users/Carthage/orgs","repos_url":"https://api.github.com/users/Carthage/repos","events_url":"https://api.github.com/users/Carthage/events{/privacy}","received_events_url":"https://api.github.com/users/Carthage/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Carthage/Carthage","description":"A simple, decentralized dependency manager for Cocoa","fork":false,"url":"https://api.github.com/repos/Carthage/Carthage","forks_url":"https://api.github.com/repos/Carthage/Carthage/forks","keys_url":"https://api.github.com/repos/Carthage/Carthage/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Carthage/Carthage/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Carthage/Carthage/teams","hooks_url":"https://api.github.com/repos/Carthage/Carthage/hooks","issue_events_url":"https://api.github.com/repos/Carthage/Carthage/issues/events{/number}","events_url":"https://api.github.com/repos/Carthage/Carthage/events","assignees_url":"https://api.github.com/repos/Carthage/Carthage/assignees{/user}","branches_url":"https://api.github.com/repos/Carthage/Carthage/branches{/branch}","tags_url":"https://api.github.com/repos/Carthage/Carthage/tags","blobs_url":"https://api.github.com/repos/Carthage/Carthage/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Carthage/Carthage/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Carthage/Carthage/git/refs{/sha}","trees_url":"https://api.github.com/repos/Carthage/Carthage/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Carthage/Carthage/statuses/{sha}","languages_url":"https://api.github.com/repos/Carthage/Carthage/languages","stargazers_url":"https://api.github.com/repos/Carthage/Carthage/stargazers","contributors_url":"https://api.github.com/repos/Carthage/Carthage/contributors","subscribers_url":"https://api.github.com/repos/Carthage/Carthage/subscribers","subscription_url":"https://api.github.com/repos/Carthage/Carthage/subscription","commits_url":"https://api.github.com/repos/Carthage/Carthage/commits{/sha}","git_commits_url":"https://api.github.com/repos/Carthage/Carthage/git/commits{/sha}","comments_url":"https://api.github.com/repos/Carthage/Carthage/comments{/number}","issue_comment_url":"https://api.github.com/repos/Carthage/Carthage/issues/comments{/number}","contents_url":"https://api.github.com/repos/Carthage/Carthage/contents/{+path}","compare_url":"https://api.github.com/repos/Carthage/Carthage/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Carthage/Carthage/merges","archive_url":"https://api.github.com/repos/Carthage/Carthage/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Carthage/Carthage/downloads","issues_url":"https://api.github.com/repos/Carthage/Carthage/issues{/number}","pulls_url":"https://api.github.com/repos/Carthage/Carthage/pulls{/number}","milestones_url":"https://api.github.com/repos/Carthage/Carthage/milestones{/number}","notifications_url":"https://api.github.com/repos/Carthage/Carthage/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Carthage/Carthage/labels{/name}","releases_url":"https://api.github.com/repos/Carthage/Carthage/releases{/id}","created_at":"2014-10-10T19:54:55Z","updated_at":"2016-01-16T02:25:15Z","pushed_at":"2016-01-16T02:53:06Z","git_url":"git://github.com/Carthage/Carthage.git","ssh_url":"git@github.com:Carthage/Carthage.git","clone_url":"https://github.com/Carthage/Carthage.git","svn_url":"https://github.com/Carthage/Carthage","homepage":"","size":10834,"stargazers_count":5779,"watchers_count":5779,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":364,"mirror_url":null,"open_issues_count":141,"forks":364,"open_issues":141,"watchers":5779,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Carthage/Carthage/pulls/1005"},"html":{"href":"https://github.com/Carthage/Carthage/pull/1005"},"issue":{"href":"https://api.github.com/repos/Carthage/Carthage/issues/1005"},"comments":{"href":"https://api.github.com/repos/Carthage/Carthage/issues/1005/comments"},"review_comments":{"href":"https://api.github.com/repos/Carthage/Carthage/pulls/1005/comments"},"review_comment":{"href":"https://api.github.com/repos/Carthage/Carthage/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Carthage/Carthage/pulls/1005/commits"},"statuses":{"href":"https://api.github.com/repos/Carthage/Carthage/statuses/07cb80a291de247afe73bc2e0d4b05bb3d218c4e"}}}}