-
Notifications
You must be signed in to change notification settings - Fork 572
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
Extensions in xcode #468
Extensions in xcode #468
Conversation
Also I'd appreciate it if people take things a little easy on submitting C code for a couple of days, so I can get this conversion done and landed. It's hairy enough without a huge amount of rebasing! |
I'd also note that so far this isn't doing anything with init.lua's, they are still being copied around by build_extensions.sh. That will need to change, but shouldn't be too hard to push into an xcode build phase script. |
826a7a6
to
5c88e75
Compare
having problems compiling... First, it fails to compile from the command line using just "make" (I forget the exact error, but will post a copy in here later)... fine, still in testing, the real test is in Xcode. Within Xcode, I select Build from the Product menu (I've tried Scheme as both Build and Hammerspoon... no difference), and it gives out on target hammerspoon.h (
So... what step or setting am I missing to get this to compile? |
@asmagill try again with the latest code? If it still doesn't work, in the build log, could you right click and choose Expand All Transcripts and send me a dump of the failed bit? I think I've made it more robust since I last pushed, but I've lost track a bit! |
That did it... Oddly Smartgit tells me when a branch gets updated and allows me to pull it... not so for pull requests -- have to locally purge and repull them just to check... learn something new everyday... like, maybe I should breakdown and learn to use git from the terminal :-)
|
…rom the Makefile build process
our namespace. Revert a few libfoo symbols to foo_internal symbols. Add hs.application{,.watcher} to xcode building
…work to extensions that need it, so far
…loop over data, rather than lots of commands, and switch from .dylib to .so
…ode build scripts. Add support for Lua-only modules to the Xcode script for installing modules. Refactor build_extensions.sh to entirely skip migrated modules
…we define Crashlytics logging macros
@asmagill ok, assuming this passes Travis, we should be fully converted! Test away :) The last commit (GNU empty initializer extension removal) shouldn't really have snuck in here, but I forgot to make a child branch for cleaning up build warnings. |
I think I'm just going to land this, but I'm not decided yet, whether I should merge the history, or squash it into a single, hilariously inscrutable commit. |
Switch all extensions from using our scripted/hacky home grown build system, to being library targets in Hammerspoon.xcodeproj. Closes #34
What are the steps for adding a new extension to core to be included in this new process? |
@asmagil yeah sorry I haven't updated CONTRIBUTING yet :/ First, for either pure Lua modules, or hybrid modules, add the source as a folder in extensions/ as normal. Then in the Xcode project browser (cmd-1) expand the Hammerspoon project to find the yellow extensions folder, right click it and choose New Group and then give it the new name and move it to the right point in the list. Right click the new group and choose Add files, select the C/Lua source/header files from the new extension and make sure Copy Files If Needed is unticked. Then, for a pure Lua module, in the Xcode project browser column (left pane) choose the blue Hammerspoon project icon at the top, then choose the yellow Hammerspoon app target in the middle pane, go to Build Phases, expand Copy Extensions To Bundle and add the module name to HS_LUAONLY. Or, for a hybrid module, go to the blue Hammerspoon project icon, right click on the "alert" target, choose Duplicate. Rename the new "alert copy" target. Click on the Scheme chooser on the Xcode toolbar, choose Manage Schemes, rename "alert copy" and tick the Shared box. Then back in the target for the new module, go to its Build Phases section, expand Compile Sources, remove alert's internal.m, click + and add the C source file(s) for the module. Add any frameworks it needs, to the Link Extensions build phase (note that you should add Fabric.framework, with the Add Other button, if you include hammerspoon.h). From the scheme chooser, select the new extension and cmd-b to make sure it builds/links. Then in the yellow Hammerspoon target, add the new module target to the Target Dependencies build phase, then in the Copy Extensions To Bundle phase, add it to HS_MODULES. Simple! ;) |
This is my WIP PR for switching extensions over to building in Xcode. Closes #34
@asmagill definitely needs to look at this and comment :D
(the good news is that I'm not changing the structure of the app bundle at all. I gave up trying to make it work, and am just using a script to copy the dylibs into the old places, with the old names, just with a .dylib extension instead of a .so)