This type of question came up many years ago regarding Objective C development but I'm interested specifically in Swift.
Objectives:
Use VIM to write Swift source code (using the Swift syntax plug-in) and compile a native cocoa App (bundle) that is similar to creating a simple cocoa app from Xcode.
Motivation:
8GB downloads of the Xcode app over a fairly slow and sometimes unreliable internet connection, combined with the 'Xcode can not be open while being updated' messages means I have a few days to dedicate to an Xcode-free experience.
Secondary Motivation:
Sometimes Xcode seems to be performing hidden 'magic' under the hood and I always intended to do a deep dive on 'what is Xcode really doing' vs 'Just how much of the app is frameworks vs Xcode/Compiler magic'.
There are a number of sub-topics within this, for example: when I download an older sample projects from various sources and Xcode says - This project needs to be migrated to a newer version of Swift, using an older version of Xcode you no longer have to migrate it. Yet, these projects are primarily source code and resources and when I build an empty project and copy in the source and resources, they usually work fine (once a few syntax errors are fixed) which leaves me curious as to what these deal-breaking incompatibilities truly are.
I decided one way to investigate this is to:
- Use VIM to edit all required files
- Replace xib/nib files with programatically generated UI (I'm comfortable with this part)
- Use the Swift compiler to compile a cocoa app bundle and thus figure out:
- Which of the files created for an Xcode project relate to internal Xcode only activities vs which (and what) become compiler directives (and how).
Progress:
I created a default cocoa mac app that displays an empty window. This creates the following project files:
basicProject/basicProject/AppDelegate.swift
basicProject/basicProject/basicProject.entitlements
basicProject/basicProject/Info.plist
basicProject/basicProject/ViewController.swift
basicProject/basicProject/Assets.xcassets/Contents.json
basicProject/basicProject/Assets.xcassets/AppIcon.appiconset/Contents.json
basicProject/basicProject/Base.lproj/Main.storyboard
basicProject/basicProject.xcodeproj/project.pbxproj
basicProject/basicProject.xcodeproj/xcuserdata/username.xcuserdatad/xcschemes/xcschememanagement.plist
basicProject/basicProject.xcodeproj/project.xcworkspace/contents.xcworkspacedata
basicProject/basicProject.xcodeproj/project.xcworkspace/xcuserdata/username.xcuserdatad/UserInterfaceState.xcuserstate
basicProject/basicProject.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
In the build directory, at the top level, I have:
someXcodeWorkDirectory/scm.plist
someXcodeWorkDirectory/OpenQuickly-ReferencedFrameworks.index-v1
someXcodeWorkDirectory/Logs
someXcodeWorkDirectory/TextIndex
someXcodeWorkDirectory/Index
someXcodeWorkDirectory/Build
someXcodeWorkDirectory/info.plist
I didn't list them all because there are circa 1,800 files for this single empty window project.
A few examples are:
./Index/DataStore/v5/records/61/NSHTTPCookieStorage.h-SNU4K7QOIQ61
./Index/DataStore/v5/records/61/mach_voucher_types.h-ZENRRUWBXU61
./Index/DataStore/v5/records/XH/SCSITaskLib.h-2051VDYD45GXH
./Index/DataStore/v5/records/XH/SCSICmds_REPORT_LUNS_Definitions.h-2H7QJ9X9DMJXH
./Index/DataStore/v5/records/21/NSResponder.h-3G5XCM1YTXX21
./Index/DataStore/v5/records/4D/NSBezierPath.h-2W852T4P4GT4D
./Index/DataStore/v5/records/4D/IOHIDLibObsolete.h-38UUUALWPN94D
./Build/Intermediates.noindex/basicProject.build/Debug/basicProject.build/all-product-headers.yaml
./Build/Intermediates.noindex/basicProject.build/Debug/basicProject.build/basicProject-all-target-headers.hmap
./Build/Intermediates.noindex/basicProject.build/Debug/basicProject.build/basicProject.hmap
What I'm looking for:
- A general explanation of the role of these 1,800 files, such as are they Xcode generated or compiler/toolchain generated (eg: does the compiler generate these 1800 files, and, broadly speaking, why, SCSICmds?)
- Any Links to appropriate references
- Any Links to any similar endeavours
- Any guidance/wisdom/intuition on how to approach/complete the task.