Skip to content

Commit b8b561d

Browse files
Apply standard Swift package configuration (#920)
* Apply standard Swift package configuration * Update genesis template * Fix
1 parent f14528b commit b8b561d

File tree

5 files changed

+15
-59
lines changed

5 files changed

+15
-59
lines changed

.github/workflows/genesis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ jobs:
3535
- name: Generate Xcode project
3636
working-directory: ${{ steps.mktemp.outputs.directory }}
3737
run: xcodegen
38-
- name: Download swiftlint binary
38+
- name: Resolve package dependencies
3939
working-directory: ${{ steps.mktemp.outputs.directory }}
4040
run: swift package resolve
4141
- name: Lint
4242
working-directory: ${{ steps.mktemp.outputs.directory }}
4343
run: >
44-
"$(find ".build/artifacts/swiftlint" -path "*macos*" -type f -name swiftlint -perm +111 -print -quit)"
44+
swift package plugin --allow-writing-to-package-directory swiftlint --
4545
lint --strict --reporter github-actions-logging
4646
- name: Resolve package dependencies
4747
working-directory: ${{ steps.mktemp.outputs.directory }}

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ jobs:
1818
steps:
1919
- name: Checkout source
2020
uses: actions/checkout@v6
21-
- name: Download swiftlint binary
21+
- name: Resolve package dependencies
2222
run: swift package resolve
2323
- name: Lint
2424
run: >
25-
"$(find ".build/artifacts/swiftlint" -path "*macos*" -type f -name swiftlint -perm +111 -print -quit)"
25+
swift package plugin --allow-writing-to-package-directory swiftlint --
2626
lint --strict --reporter github-actions-logging

Package.resolved

Lines changed: 6 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ let package = Package(
5353
url: "https://github.com/uber/needle.git",
5454
exact: "0.25.1"),
5555
.package(
56-
url: "https://github.com/realm/SwiftLint.git",
56+
url: "https://github.com/SimplyDanny/SwiftLintPlugins.git",
5757
exact: "0.59.1"),
5858
.package(
5959
url: "https://github.com/Quick/Nimble.git",
@@ -127,6 +127,7 @@ package.targets.forEach { target in
127127
.regular,
128128
.test,
129129
.executable,
130+
.macro,
130131
]
131132

132133
guard types.contains(target.type)
@@ -143,7 +144,7 @@ package.targets.forEach { target in
143144

144145
if enableSwiftLintBuildToolPlugin {
145146
target.plugins = (target.plugins ?? []) + [
146-
.plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLint"),
147+
.plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLintPlugins"),
147148
]
148149
}
149150
}

genesis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ files:
899899
exact: "{{ nodes }}"),
900900
{% endif %}
901901
.package(
902-
url: "https://github.com/realm/SwiftLint.git",
902+
url: "https://github.com/SimplyDanny/SwiftLintPlugins.git",
903903
exact: "0.59.1"),
904904
]
905905
)
@@ -1135,7 +1135,7 @@ files:
11351135
# https://github.com/realm/SwiftLint/blob/0.52.4/Source/swiftlint/Commands/SwiftLint.swift#L8
11361136
unset BUILD_WORKSPACE_DIRECTORY
11371137
1138-
"$(find ".build/artifacts/swiftlint" -path "*macos*" -type f -name swiftlint -perm +111 -print -quit)"
1138+
swift package plugin --allow-writing-to-package-directory swiftlint
11391139
else
11401140
echo "SwiftLint is skipped in CI."
11411141
fi

0 commit comments

Comments
 (0)