Skip to content

Instantly share code, notes, and snippets.

@zachwaugh
Last active October 6, 2020 03:36
Show Gist options
  • Save zachwaugh/5b9b98a83bb108b9273ded5a2118dcec to your computer and use it in GitHub Desktop.
Save zachwaugh/5b9b98a83bb108b9273ded5a2118dcec to your computer and use it in GitHub Desktop.
Swift + Sublime Text 3

Work in progress of building Swift with Sublime Text 3

An attempt to use Sublime Text 3 for writing Swift instead of Xcode. Currently experimenting with a command-line app, but should be possible to create an Xcode build system too so it can run right in the simulator.

  • Install Swift + SwiftKitten packages in ST3
  • Add Makefile and update SOURCES with your Swift source files to build (space delimited)
  • Make is the default build system in Sublime Text, so command+b will build and show the output in the console with inline errors
# I rarely use make, probably a better way to do some/all of this?
SDK=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk
SOURCES=main.swift
EXECUTABLE=main
all:
swiftc -sdk $(SDK) $(SOURCES) -o $(EXECUTABLE)
clean:
rm $(EXECUTABLE)
@lf-araujo
Copy link

There is no need for a Makefile, I think all you want can be handled within a Package.swift file!

@nirmalksingh
Copy link

great work in progresss...looking forward to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment