Template Project for using Swift/Win32

Overview

Windows Empty Swift Application Template

This provides a template project to build a Swift application on Windows using Swift/Win32.

Build Requirements

  • Swift 5.4 or newer
  • Windows SDK 10.0.10773 or newer
  • Swift/Win32 development

Building

The project can be built using Swift Package Manager's build command. Additionaly, the application needs to have a manifest integrated into the binary. This requires additional operations which cannot be automated with Swift Package Manager currently. Additionally, some files need to be deployed manually as they need to be placed in a specific layout.

Currently, the LLVM manifest tool (llvm-mt) is unable to perform the operation and thus this must be done with the MSVC toolset.

swift build
mt -nologo -manifest Sources\Application\Application.exe.manifest -outputresource:.build\x86_64-unknown-windows-msvc\debug\Application.exe
copy Sources\Application\Info.plist .build\x86_64-unknown-windows-msvc\debug\

Testing

The project uses XCTest to add unit tests. You can run the unit test suite using Swift Package Manager's test command.

swift test

Debugging

In order to debug the package, there are two options. In order to debug with LLDB, which is required for debugging Swift code, the linker needs to preserve the debug information. This is accomplished by passing an additional flag during the build.

swift build -Xlinker -debug:dwarf

When trying to debug the interactions with the system, it is convenient to use the Windows tooling for debugging (e.g. WinDBG). In such a case, the debug information needs to be emitted for Windows. This requires passing additonal flags to Swift Package Manager.

swift build -Xswiftc -g -Xswiftc -debug-info-format=codeview -Xlinker -debug
Issues
  • changed SPM dependency declaration to work w/ Swift 5.4

    changed SPM dependency declaration to work w/ Swift 5.4

    While the current way of declaring SwiftWin32 as dependency, with .product(name: "SwiftWin32", package: "swift-win32"), works for Swift 5.5-dev. This PR changes the project and target dependency declarations so they work with the current stable version of Swift 5.4, It compiled on both .0 and .1 releases of 5.4, and on 5.5-dev.

    opened by h4cky 1
Owner
Saleem Abdulrasool
Saleem Abdulrasool
A template for new Swift iOS / macOS / tvOS / watchOS Framework project ready with travis-ci, cocoapods, Carthage, SwiftPM and a Readme file

Swift Framework Template A template for new Swift Framework. What's in the template? Deployment Targets - iOS 9.0 / Mac OS X 10.10 / tvOS 9.0 / watchO

Rahul Katariya 527 Nov 17, 2021
A Swift command line tool for generating your Xcode project

XcodeGen XcodeGen is a command line tool written in Swift that generates your Xcode project using your folder structure and a project spec. The projec

Yonas Kolb 4.9k Nov 23, 2021
:chart_with_upwards_trend: CLI to profile compilation time of Swift project

xcprofiler Command line utility to profile compilation time of Swift project. This tool is developed in working time for Cookpad. Installation gem ins

Kohki Miki 317 Oct 12, 2021
SBConstants - Generate a constants file by grabbing identifiers from storyboards in a project.

sbconstants Generate a constants file by grabbing identifiers from storyboards in a project. Installation $ gem install sbconstants Usage For automate

paul.s 309 Sep 24, 2021
automatically delete the current project's DerivedData directories

Feature automatically delete the current project's DerivedData directories Usage It will be automatically deleted DerivedData when you run the clean I

Toshihiro Morimoto 248 Aug 12, 2021
An executable that can be called from a Run Script Build Phase that makes comments such as // TODO: or // SERIOUS: appear in Xcode's Issue Navigator giving them project-wide visibility.

XcodeIssueGenerator An executable that can be called from a Run Script Build Phase that makes comments such as // TODO: or // SERIOUS: appear in Xcode

Wunderman Thompson Apps 144 Sep 10, 2021
Script to support easily using Xcode Asset Catalog in Swift.

Misen Misen is a script to support using Xcode Asset Catalog in Swift. Features Misen scans sub-directories in the specified Asset Catalog and creates

Kazunobu Tasaka 124 Jun 3, 2021
An Xcode plug-in to format your code using SwiftLint.

SwiftLintXcode An Xcode plug-in to format your code using SwiftLint. Runs swiftlint autocorrect --path CURRENT_FILE before *.swift file is saved. IMPO

Yuya Tanaka 339 Oct 19, 2021
A tool for defining design systems and using them to generate cross-platform UI code, Sketch files, and other artifacts.

Lona (Developer Preview) This project is in an early stage and lacks documentation – however, with some effort, it can be used very effectively. If yo

Airbnb 7.5k Nov 24, 2021
The Swift Package Index is the place to find Swift packages!

The Swift Package Index Find the best Swift libraries and frameworks that support the Swift Package Manager. Reconciliation, Ingestion, and Analysis T

Swift Package Index 290 Nov 18, 2021
Swift CLI for strong-typing images, colors, fonts and localizations

Shark Shark is a Swift command line tool that generates type safe enums for your image assets, color assets, localizations and fonts. Because Shark re

Kaan Dedeoglu 373 Oct 14, 2021
Strong typed, autocompleted resources like images, fonts and segues in Swift projects

R.swift Get strong typed, autocompleted resources like images, fonts and segues in Swift projects Why use this? It makes your code that uses resources

Mathijs Kadijk 8.4k Nov 16, 2021
The Swift code generator for your assets, storyboards, Localizable.strings, … — Get rid of all String-based APIs!

SwiftGen SwiftGen is a tool to automatically generate Swift code for resources of your projects (like images, localised strings, etc), to make them ty

null 7.5k Nov 19, 2021
Soulful docs for Swift & Objective-C

jazzy is a command-line utility that generates documentation for Swift or Objective-C About Both Swift and Objective-C projects are supported. Instead

Realm 7.1k Nov 25, 2021
Laurine - Localization code generator written in Swift. Sweet!

Author's note: Thanks everyone for making Laurine the TOP trending Swift repository in the world - this is amazing and very heart-warming! But this is

Jiri Trecak 1.3k Nov 25, 2021
Swift Version Manager

Swift Version Manager swiftenv allows you to easily install, and switch between multiple versions of Swift. This project was heavily inspired by pyenv

Kyle Fuller 1.9k Nov 24, 2021
An Xcode Plugin to convert Objective-C to Swift

XCSwiftr Convert Objective-C code into Swift from within Xcode. This plugin uses the Java applet of objc2swift to do the conversion. Noticed that the

Ignacio Romero Zurbuchen 341 Aug 20, 2021
Swift autocompleter for Sublime Text, via the adorable SourceKitten framework

SwiftKitten SwiftKitten is a Swift autocompleter for Sublime Text, via the adorable SourceKitten framework. Faster than XCode ! This package is new an

John Snyder 145 Nov 8, 2021
Generate automated reports for slow Swift compilation paths in specific targets

SwiftCompilationPerformanceReporter Inspired by Brian and Bryan's prior work, we've decided to develop a Swift Package and script to generate automate

TumblrArchive 146 Jun 19, 2020