-
-
Notifications
You must be signed in to change notification settings - Fork 643
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
[WIP] Migrate to Swift #391
Conversation
|
The offset fix for #376 now also applies to emojis (now / before) |
This is great work! |
There are LOTS of open PRs for the obj-C project... seems we need to make a decision about Swift vs Obj-C. @iosdeveloper, what do you think? |
@matryer Thanks! :) Made a quick summary of the open PRs.
Some of the PRs from @iosdeveloper above was merged into the Hope that helps. |
2 132 passing specs implemented. 2000 property based and 132 static. |
I just tried this and the on 10.12 and the application keeps quitting and falling our of the menubar. Has anyone else had this problem? |
@palmerj That's fixed in the latest, currently not deployed, but pushed, version. Stay tuned! |
Ok thanks. Any idea on when a new version will be release. If it's not planned soon, I will revert to the official bitbar for now. |
Any updates ? |
Long story short; I'm currently doing a bike tour since two months back from London to Iran. Don't have that much time any more to work on this. I do still work on it, but its going a bit to slow. The project has been stable a few times in the past since I made the fork, but since I didn't get any feedback I continued adding features - which made it unstable - and thats where we are right now. I see two options that doesn't involve throwing the project away.
I sincerely hope that my fork isn't thrown away and forgotten considering the 1000 of hours spent on it. Last time I checked in May I had 1200h (according to wakatime.com) - and thats only the editing part. I cant promise anything, but I probably gonna continue on this fork when I reach Iran as I use my version of BitBar every day. |
@oleander Congratulations on your bike tour, it sounds amazing. I use your version daily and also don't want to see it disappear. It has been updated more recently than than this version and does have many fixes and features that have helped me. I dont know enough swift to help out, but will continue to use and offer any feedback that I can. Keep up the good work and if nothing else I would appreciate a stable release that even if it doesnt get any enhancements just continues to work with the newer versions of macOS (since High Sierra is coming out in a couple weeks) I would be happy. |
Hi, just tried your version (from source and as dmg) - and the code seems to be not compatible anymore to latest Xcode versions - and it also aks for an upgrade to Swift4. The dmg then seems to refer to some dylibs from Xcode, which I think a casual user wouldn't have installed and also some symbols seem to have changed (maybe because of Swift4). I myself never did Swift, but I think if you'd make it compile again ans bundle a complete dmg with all dependencies, barrier for users would be lower to look into the code and fix what's broken (if anything is broken). |
If you’re interested in contributing, I think this branch needs some love. Maybe even a rewrite if the language has evolved far enough along.
Mat
… On 8 Feb 2018, at 12:15, unrzn0 ***@***.***> wrote:
Hi, just tried your version (from source and as dmg) - and the code seems to be not compatible anymore to latest Xcode versions - and it also aks for an upgrade to Swift4. The dmg then seems to refer to some dylibs from Xcode, which I think a casual user wouldn't have installed and also some symbols seem to have changed (maybe because of Swift4). I myself never did Swift, but I think if you'd make it compile again ans bundle a complete dmg with all dependencies, barrier for users would be lower to look into the code and fix what's broken (if anything is broken).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I’m still biking so won’t have time to work on the project as it is now. In Iran right now and is heading to New York so have a few years left on the road.
There are at least 40 previous versions that are stable and implements everything that’s in the objective-c version + bug fixes and tests. Which commit is stable I’m not sure as i haven’t worked on the project for half a year. Master currently implements an array of new features which isn’t in the objective-c version - some of them unstable which is why the application isn’t working atm. Never planed to stop working not the project cold turkey, hence the crashes.
Spent about a thousand hours on the project last year. If you have the time, feel free to do it again :) I would try to find a stable commit and work from there. That would take a fraction of the time it would to rewrite it - again. I especially recommend you (the reader) to look at the LL parser - the core of the application, as this is where the majority of the time was spent.
I might have time to work on the project for 10 ish hours when I get to the capital as I’m staying there for two weeks while the bike is being fixed. I can take a look at it then, if any of the admins are interested.
I’m waiting to hear from Mat.
// Linus
… 8 feb. 2018 kl. 15:47 skrev Mat Ryer ***@***.***>:
If you’re interested in contributing, I think this branch needs some love. Maybe even a rewrite if the language has evolved far enough along.
Mat
> On 8 Feb 2018, at 12:15, unrzn0 ***@***.***> wrote:
>
> Hi, just tried your version (from source and as dmg) - and the code seems to be not compatible anymore to latest Xcode versions - and it also aks for an upgrade to Swift4. The dmg then seems to refer to some dylibs from Xcode, which I think a casual user wouldn't have installed and also some symbols seem to have changed (maybe because of Swift4). I myself never did Swift, but I think if you'd make it compile again ans bundle a complete dmg with all dependencies, barrier for users would be lower to look into the code and fix what's broken (if anything is broken).
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub, or mute the thread.
>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@jannik-mohemian It's stalled at the moment. I'm in search of new maintainers. |
@oleander where are you right now? did you look at this recently? |
@mpicard let's assume nothing has changed since the comment above #391 (comment) Happy to help go through the commit logs and test builds to find the last stable release that was feature complete |
@gingerbeardman I'd love a little code walk through since I'm not familiar with Swift but since you seem to have fixed a lot of bugs and stuff I'd be really nice to merge this, pending @matryer approval as well. Let's schedule a Zoom soon so reach out at martin8768#gmail#com |
I hope it is possible to merge contributions of @oleander 🤞 . Best of luck in your journey. |
FTR, there is an alternative Swift-based project too BitBar, and seems to be actively maintained: https://github.com/swiftbar/SwiftBar |
SwiftBar (above) is currently 10.15+ only |
This pull request aims to add support for Swift 3. It's based up-on the beta branch and implements support for all parameters described in the README. The main goal has been to modernize the application stack by implementing a combinatory LL parser verified using property-based testing.
The parser
The parser, the piece of software responsible for processing script outputs, is implemented using the FootlessParser parser and is located in
App/BitBar/Parser/Parser.swift
. It's build up-on 50+ smaller parser (hence the name; parser combinator), such asLength.init <^> attribute("length") { digits() }
for parsing the length attribute (length=X
).The parser is context aware and will handle nested sub menus as well as invalid arguments, i.e
length=false
. One of the major benefits of using a parser like this ability to generate easy-to-understand error messages much similar to those generated by a compiler/transpiler. This makes implementing plugins easier as errors are caught and raised early. An example isExpected 'a number' on 3:12, but got 'false'
when passinglength=false
.Testing
The parser is verified using the SwiftCheck library, a property-based testing framework for generating test data. The current test suit is ran against 1400 random examples.
The rest of the implementation is partially tested (about 80 tests) using the Quick testing framework.
Run
make test
to run the suit once ormake watch
to runmake test
each time a file is changed. Don't forget to install the dependencies listed below.The application is ready for travis-ci and the latest builds can be found here.
Dependencies
I've tried to "out source" as much of the implementation as possible to external libraries using CocoaPods. There's currently 11 dependencies which can be found the in the
App/Podfile
file. They are automatically installed when runningmake deps
.How to use
gem install cocoapods xcpretty
make deps
to install the podsmake test
App/BitBar.xcworkspace
. This will use theApp/Scripts/sub.1m.sh
example script and output something likeWhat's next
href="..."
. Implementation is done but hasn't been tested using SwiftCheckFlow
This is the basic flow of data in the application. I tried to use the same naming convention as the existing application.
A summery
xcpretty
for output formatting andmake watch
as file watchermake fix
andmake lint
uses this)make ci
) (latest builds)Epilog
I might have gone a bit overboard with this pull request. The initial idea was to fix #379 but after spending hours with segmentation faults and other obscure errors, caused by my lack of understanding of the language, I decided to look for alternatives. After searching for "swift" in issue tracker I found a few comments from @matryer regarding migrating to Swift – so I decided to give it a go my self.
With that said I understand if this is "to much" and if you decide not to merge.
A side note; I might have removed files from the original project when simplifying the implementation a few weeks ago. If you find something that should be in the project but isn't, such as assets files, let me know and I'll add it.
~ L