Skip to content
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

Build with swift instead of xcodebuild #21

Closed
wants to merge 1 commit into from

Conversation

StefMa
Copy link

@StefMa StefMa commented Jan 22, 2017

Change the build script to build with swift instead of xcodebuild.

This is part of #19. Currently aperture can't be build on linux (so maybe this is part of #7 as well 🤔 but haven't looked in detail inside the PR) which means it can't build in Docker as well.

swift is available on multiple operating systems (e.g. linux) but xcodebuild not.
So changing the build script to build with swift you only have to install swift on your given OS and you are fine to build aperture 🎉

Probably you want to modify the Package.swift to fits your needs. But I should that would be done later by you :)

@StefMa
Copy link
Author

StefMa commented Jan 22, 2017

😞 I found out that

you only have to install swift on your given OS and you are fine to build aperture
isn't true 😢

Because on Linux system (or Dockers) I got the message

aperture.js/swift/aperture/Recorder.swift:1:8: error: no such module 'AVFoundation'
Because AVFoundation isn't available on Linux 😞

@StefMa
Copy link
Author

StefMa commented Jan 22, 2017

Anyway. It would be great if we can merge it because it is one step closer to support other operating systems 👌

@matheuss
Copy link
Member

Wooo @StefMa, amazing! I tried that when I first started, but I never managed to get it working. Will test ASAP 🙌

@sindresorhus
Copy link
Contributor

I don't mind using swift directly to compile, but I don't understand the argument about Linux. The Swift code is highly coupled to macOS and will never run on Linux.

@StefMa
Copy link
Author

StefMa commented Jan 22, 2017

I thought when we compile with swift (because it is available for linux as well) instead of xcodebuild it will be possible to compile the code on linux environments.
But it can't build on linux because of the AVFoundation 😞

The idea behind this was to create a workaround for #19.
Because I don't found any information about building and distribute a binary via npm

@sindresorhus
Copy link
Contributor

The idea behind this was to create a workaround for #19.

@StefMa You're overthinking it. All that's needed for #19 is to switch the compilation from postinstall to prepublish.

@StefMa
Copy link
Author

StefMa commented Jan 22, 2017 via email

@sindresorhus
Copy link
Contributor

sindresorhus commented Jan 22, 2017

Actually, I don't see enough benefit in this change. It's safer to use xcodebuild as it follows the build settings in the Xcode project file. This change is also incorrect as the compiled binary needs to include Swift itself, as the Swift ABI is not stable. xcodebuild does this automatically.

@StefMa StefMa mentioned this pull request Jan 23, 2017
@StefMa
Copy link
Author

StefMa commented Jan 24, 2017

Closed because the PR make no sense 😹

@StefMa StefMa closed this Jan 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants