Skip to content

Commit 09e8191

Browse files
Peter Graysonbbatsov
authored andcommitted
feat: add support for swift projects
Add support for swift projects using swift package manager (SPM). The 'swift-spm symbol is qualified to leave room for other flavors of swift project that are more Xcode oriented or use cocoapods.
1 parent 74165f7 commit 09e8191

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* [#1899](https://github.com/bbatsov/projectile/pull/1899): Add support for xmake build utility.
1515
* [#1895](https://github.com/bbatsov/projectile/pull/1895): Modify projectile-mode to add a hook to `buffer-list-update-hook` such that any change in the buffer list will update the selected project.
1616
* [#1918](https://github.com/bbatsov/projectile/pull/1895): Add Zig project discovery.
17+
* Add support for Swift project discovery.
1718

1819
### Bugs fixed
1920

doc/modules/ROOT/pages/projects.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,10 @@ are the configuration files of various build tools. Out of the box the following
269269
| Zig
270270
| `build.zig.zon`
271271
| Zig project file
272+
273+
| Swift
274+
| `Package.swift`
275+
| Swift package file
272276
|===
273277

274278
There's also Projectile's own `.projectile` which serves both as a project marker

projectile.el

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3633,6 +3633,13 @@ a manual COMMAND-TYPE command is created with
36333633
:test "zig build test"
36343634
:run "zig build run")
36353635

3636+
;; Swift
3637+
(projectile-register-project-type 'swift-spm '("Package.swift")
3638+
:project-file "Package.swift"
3639+
:compile "swift build"
3640+
:test "swift test"
3641+
:run "swift run")
3642+
36363643
(defvar-local projectile-project-type nil
36373644
"Buffer local var for overriding the auto-detected project type.
36383645
Normally you'd set this from .dir-locals.el.")

0 commit comments

Comments
 (0)