Skip to content

Commit

Permalink
WIP - Set up SwiftFormat via local package and build phase — Fails
Browse files Browse the repository at this point in the history
  • Loading branch information
mokagio committed Sep 29, 2024
1 parent 4773af8 commit f25d82a
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
6 changes: 6 additions & 0 deletions 04-tdd-in-the-real-world/1-end/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ targets:
UIRequiredDeviceCapabilities: [armv7]
scheme:
testTargets: [AlbertosTests]
settings:
ENABLE_USER_SCRIPT_SANDBOXING: NO
preBuildScripts:
- name: Format
script: swift run -c release --package-path ../../BuildTools swiftformat "$SRCROOT"
basedOnDependencyAnalysis: false
AlbertosTests:
target: Albertos
type: bundle.unit-test
Expand Down
2 changes: 2 additions & 0 deletions BuildTools/Empty.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Required to satisfy SwiftPM requirements as of Xcode 11.4
// See https://github.com/nicklockwood/SwiftFormat#using-swift-package-manage
15 changes: 15 additions & 0 deletions BuildTools/Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"originHash" : "d07c3e2d919fdf70233890c1d8484e8bd766f9b04984fbecf723a5ca744d4dd5",
"pins" : [
{
"identity" : "swiftformat",
"kind" : "remoteSourceControl",
"location" : "https://github.com/nicklockwood/SwiftFormat",
"state" : {
"revision" : "ab6844edb79a7b88dc6320e6cee0a0db7674dac3",
"version" : "0.54.5"
}
}
],
"version" : 3
}
11 changes: 11 additions & 0 deletions BuildTools/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// swift-tools-version:6.0
import PackageDescription

let package = Package(
name: "BuildTools",
platforms: [.macOS(.v10_13)],
dependencies: [
.package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.54.5"),
],
targets: [.target(name: "BuildTools", path: "")]
)

0 comments on commit f25d82a

Please sign in to comment.