-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Octokit build with Linux #69
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might also be worth adding linux to the CI too, to ensure forward compatibility - might only need to run swift build
@@ -9,6 +9,55 @@ public enum Openness: String, Codable { | |||
case All = "all" | |||
} | |||
|
|||
#if os(Linux) | |||
open class Issue: Codable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible that the if statements can just wrap the first line of the definition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Hey, thanks for the PR. I am also on the fence if removing the Maybe you can have a look at the |
@pietbrauer It took some attempts but now it is running the CI on Linux as well. Re: |
Hey @pietbrauer, did you have a think about this? |
Yeah, let's go for it. |
@pietbrauer It should be fine now :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one white space, everything else looks good.
OctoKit/User.swift
Outdated
open var numberOfPublicRepos: Int? | ||
open var numberOfPublicGists: Int? | ||
open var numberOfPrivateRepos: Int? | ||
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you remove the whitespace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 4ac9946
Nice work, thanks! |
* Remove not used Color extension * Duplicate Models to compile also with Linux * Added allTests property to make the tests executable also on Linux * Updated .travis.yml to use also Linux * Renamed travis scripts * Use the correct Script folder name * Updated permissions for travis scripts * Use swift version 4.2 on Linux * Added LinuxMain.swift * Try to make swift find LinuxMain file * Update LinuxMain permissions * Reverse 21892d6 * Updated macos install script * install bundler on macos * Use SPM default test location to make it find LinuxMain.swift * Fixed defaultTestSuite compilation issue for macOS and tvOS * Set correct path to the Tests info.plist * Don't use Bundle(for:) on Linux * Not use the Bundle at all on Linux * Make tests compile * Remove all the other Bundle(for:) calls on Linux * Fix: Use resourceName * Find files also on Fixtures folder * Remove objc compatibility * Remove spaces from User.swift file
I was trying to use
octokit.swift
as Github client on Danger-swift (PR danger/swift#95 )But i discovered that
octokit.swift
doesn't compile on the Linux environmenthttps://travis-ci.org/danger/swift/jobs/451464822
This PR solves the problem
https://travis-ci.org/danger/swift/jobs/451515014
To keep the objc compatibility i had to duplicate the models to be not
@objc
on Linux.Not sure this is the best possible approach, i would prefer to not have duplications obviously, i'm open to any suggestion or better ideas :)