{"action":"created","issue":{"url":"https://api.github.com/repos/Quick/Nimble/issues/226","labels_url":"https://api.github.com/repos/Quick/Nimble/issues/226/labels{/name}","comments_url":"https://api.github.com/repos/Quick/Nimble/issues/226/comments","events_url":"https://api.github.com/repos/Quick/Nimble/issues/226/events","html_url":"https://github.com/Quick/Nimble/pull/226","id":122977581,"number":226,"title":"[WIP] Swift Package Manager and Linux support","user":{"login":"briancroom","id":1062518,"avatar_url":"https://avatars.githubusercontent.com/u/1062518?v=3","gravatar_id":"","url":"https://api.github.com/users/briancroom","html_url":"https://github.com/briancroom","followers_url":"https://api.github.com/users/briancroom/followers","following_url":"https://api.github.com/users/briancroom/following{/other_user}","gists_url":"https://api.github.com/users/briancroom/gists{/gist_id}","starred_url":"https://api.github.com/users/briancroom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/briancroom/subscriptions","organizations_url":"https://api.github.com/users/briancroom/orgs","repos_url":"https://api.github.com/users/briancroom/repos","events_url":"https://api.github.com/users/briancroom/events{/privacy}","received_events_url":"https://api.github.com/users/briancroom/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-12-18T16:17:47Z","updated_at":"2016-01-19T06:04:57Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Quick/Nimble/pulls/226","html_url":"https://github.com/Quick/Nimble/pull/226","diff_url":"https://github.com/Quick/Nimble/pull/226.diff","patch_url":"https://github.com/Quick/Nimble/pull/226.patch"},"body":"(See also https://github.com/Quick/Quick/pull/436 and https://github.com/Quick/Quick/pull/444)\r\n\r\nThis beast of a PR contains a first attempt at getting Nimble working on Linux using the [swift.org](https://swift.org) toolchain. At this point I would consider it effectively a proof of concept and not mergeable until the tools have a bit more time to bake and some of the workarounds can be removed.\r\n\r\nI took pains to make focused commits for easier review, but to summarize, the work consists of three main components:\r\n\r\n- [x] Support being built by the Swift Package Manager. This involved adding a `Package.swift` and adjusting the directory structure a little (note that this doesn't work on Mac right now because it's not possible to `import XCTest` when being compiled  by the SPM)\r\n- [x] Remove/conditionalize classes and concepts that only work or make sense in an Objective-C context (e.g. the ObjC matchers, and the `raiseException` matcher)\r\n- [x] Add fixes/workarounds for a variety of compiler and framework issues that (currently?) prevent 100% source compatibility. These include:\r\n\r\n  - [x] Missing `NSString(format:, ...)`\r\n  - [ ] Missing `NSHashTable` and `NSMapTable`\r\n  - [ ] Can't use `@objc` anywhere because the types provided by SwiftFoundation aren't considered ObjC. This ends up requiring a bunch of annoying duplication in `MatcherProtocols.swift`\r\n  - [x] SwiftFoundation's `NSNumber` doesn't have `compare` yet (Fixed!)\r\n  - [x] SwiftFoundation's `NSString` doesn't have the overlays that make `rangeOfString` work with `Range<Index>`\r\n  - [ ] Can't coerce from `String` to `NSString` using the `as` operator ([SR-309](https://bugs.swift.org/browse/SR-309))\r\n  - [ ] SwiftXCTest's `XCTAssert` methods expect the `file:` parameter to be a `StaticString` instead of `String` ([SR-308](https://bugs.swift.org/browse/SR-308))\r\n  - [x] Linking fails when declaring `NSObject` subclasses ([SR-272](https://bugs.swift.org/browse/SR-272))\r\n  - [x] `NSString.stringByTrimmingCharactersInSet` is horribly broken in the current toolchain snapshot (https://github.com/apple/swift-corelibs-foundation/pull/160) (Fixed!)\r\n\r\nSome pieces that are missing altogether but can hopefully be reintroduced are:\r\n\r\n- [ ] The `beAKindOf` matcher, because there is no replacement for `NSObject.isKindOfClass` in Swift right now\r\n- [ ] Everything related to async/polling/waiting, at least until `swift-corelibs-libdispatch` starts to be usable on Linux\r\n\r\nAt the tip of this branch, all the tests are passing on Mac through Xcode, and Nimble can be used as a dependency in SPM-based packages on Linux. There is no attempt at creating a test suite for Nimble on Linux yet.\r\n\r\nFeedback please :smile: @jeffh @modocache "},"comment":{"url":"https://api.github.com/repos/Quick/Nimble/issues/comments/172750297","html_url":"https://github.com/Quick/Nimble/pull/226#issuecomment-172750297","issue_url":"https://api.github.com/repos/Quick/Nimble/issues/226","id":172750297,"user":{"login":"briancroom","id":1062518,"avatar_url":"https://avatars.githubusercontent.com/u/1062518?v=3","gravatar_id":"","url":"https://api.github.com/users/briancroom","html_url":"https://github.com/briancroom","followers_url":"https://api.github.com/users/briancroom/followers","following_url":"https://api.github.com/users/briancroom/following{/other_user}","gists_url":"https://api.github.com/users/briancroom/gists{/gist_id}","starred_url":"https://api.github.com/users/briancroom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/briancroom/subscriptions","organizations_url":"https://api.github.com/users/briancroom/orgs","repos_url":"https://api.github.com/users/briancroom/repos","events_url":"https://api.github.com/users/briancroom/events{/privacy}","received_events_url":"https://api.github.com/users/briancroom/received_events","type":"User","site_admin":false},"created_at":"2016-01-19T06:04:56Z","updated_at":"2016-01-19T06:04:56Z","body":"I'll take a look at getting everything rebased and PRd over the next few days. I tried to be diligent about keeping the commit history clean and focused while working on this so I don't anticipate any major issues. \r\n\r\nCompletely agree about Travis. I got it working nicely for Quick, we should do the same here once the entire suite gets to a passing state. "}}