Skip to content

Commit c1c342f

Browse files
Apply standard Swift package configuration (#7)
* Apply standard Swift package configuration * Fix Xcode version
1 parent 6cf1c7d commit c1c342f

File tree

7 files changed

+23
-15
lines changed

7 files changed

+23
-15
lines changed

.github/workflows/artifactory.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
tags: ['[0-9]+.[0-9]+.[0-9]+']
66

77
env:
8-
DEVELOPER_DIR: /Applications/Xcode_14.3.app/Contents/Developer
8+
DEVELOPER_DIR: /Applications/Xcode_15.0.app/Contents/Developer
99

1010
jobs:
1111
artifactory:

.github/workflows/bazel.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches: [ main ]
88

99
env:
10-
DEVELOPER_DIR: /Applications/Xcode_14.3.app/Contents/Developer
10+
DEVELOPER_DIR: /Applications/Xcode_15.0.app/Contents/Developer
1111

1212
jobs:
1313
bazel:

.github/workflows/swift.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches: [ main ]
88

99
env:
10-
DEVELOPER_DIR: /Applications/Xcode_14.3.app/Contents/Developer
10+
DEVELOPER_DIR: /Applications/Xcode_15.0.app/Contents/Developer
1111

1212
jobs:
1313
swift:
@@ -29,5 +29,5 @@ jobs:
2929
run: xcodebuild -resolvePackageDependencies
3030
- name: Build
3131
run: xcodebuild build-for-testing -scheme "CollectionBuilders" -destination "name=$SIMULATOR,OS=latest"
32-
- name: Run tests
32+
- name: Test
3333
run: xcodebuild test-without-building -scheme "CollectionBuilders" -destination "name=$SIMULATOR,OS=latest"

.swiftlint-rules.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ only_rules:
1111
- anonymous_argument_in_multiline_closure
1212
- anyobject_protocol
1313
- array_init
14-
- attributes
14+
# - attributes
1515
- balanced_xctest_lifecycle
1616
- blanket_disable_command
1717
- block_based_kvo
@@ -129,6 +129,7 @@ only_rules:
129129
- no_grouping_extension
130130
# - no_magic_numbers
131131
- no_space_in_method_call
132+
- non_overridable_class_declaration
132133
- notification_center_detachment
133134
- ns_number_init_as_function_reference
134135
- nslocalizedstring_key
@@ -154,6 +155,7 @@ only_rules:
154155
- private_outlet
155156
- private_over_fileprivate
156157
- private_subject
158+
- private_swiftui_state
157159
- private_unit_test
158160
- prohibited_interface_builder
159161
- prohibited_super_call
@@ -209,6 +211,7 @@ only_rules:
209211
- unavailable_function
210212
- unhandled_throwing_task
211213
- unneeded_break_in_switch
214+
# - unneeded_override
212215
- unneeded_parentheses_in_closure_argument
213216
- unneeded_synthesized_initializer
214217
- unowned_variable_capture

Package.resolved

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@
1414
"kind" : "remoteSourceControl",
1515
"location" : "https://github.com/mattgallagher/CwlPreconditionTesting.git",
1616
"state" : {
17-
"revision" : "a23ded2c91df9156628a6996ab4f347526f17b6b",
18-
"version" : "2.1.2"
17+
"revision" : "dc9af4781f2afdd1e68e90f80b8603be73ea7abc",
18+
"version" : "2.2.0"
1919
}
2020
},
2121
{
2222
"identity" : "nimble",
2323
"kind" : "remoteSourceControl",
2424
"location" : "https://github.com/Quick/Nimble.git",
2525
"state" : {
26-
"revision" : "f552a16f434eef1f18b62985172489f41d37a18e",
27-
"version" : "12.2.0"
26+
"revision" : "d616f15123bfb36db1b1075153f73cf40605b39d",
27+
"version" : "13.0.0"
2828
}
2929
}
3030
],

Package.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.8
1+
// swift-tools-version:5.9
22

33
import PackageDescription
44

@@ -22,7 +22,7 @@ let package = Package(
2222
dependencies: [
2323
.package(
2424
url: "https://github.com/Quick/Nimble.git",
25-
from: "12.0.0"),
25+
from: "13.0.0"),
2626
],
2727
targets: [
2828
.target(
@@ -48,7 +48,7 @@ let package = Package(
4848
path: "Plugins/SwiftLintPlugin"),
4949
.binaryTarget(
5050
name: SwiftLint.binary,
51-
url: "https://github.com/realm/SwiftLint/releases/download/0.52.4/SwiftLintBinary-macos.artifactbundle.zip",
52-
checksum: "8a8095e6235a07d00f34a9e500e7568b359f6f66a249f36d12cd846017a8c6f5"),
51+
url: "https://github.com/realm/SwiftLint/releases/download/0.54.0/SwiftLintBinary-macos.artifactbundle.zip",
52+
checksum: "963121d6babf2bf5fd66a21ac9297e86d855cbc9d28322790646b88dceca00f1"),
5353
]
5454
)

Plugins/SwiftLintPlugin/SwiftLintPlugin.swift

+7-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ internal struct SwiftLintPlugin: BuildToolPlugin {
6262
target: Target
6363
) throws -> [String: String] {
6464

65-
let workingDirectory: Path = try target.directory.resolveWorkingDirectory(in: context.package.directory)
65+
let workingDirectory: Path = try target
66+
.directory
67+
.resolveWorkingDirectory(in: context.package.directory)
6668

6769
return ["BUILD_WORKSPACE_DIRECTORY": "\(workingDirectory)"]
6870
}
@@ -76,9 +78,12 @@ internal struct SwiftLintPlugin: BuildToolPlugin {
7678

7779
print("Environment:", environment)
7880

81+
guard !swiftFiles.isEmpty
82+
else { return [] }
83+
7984
let arguments: [String] = ["lint", "--quiet", "--force-exclude", "--cache-path", "\(path)"]
8085

81-
return swiftFiles.isEmpty ? [] : [
86+
return [
8287
.prebuildCommand(
8388
displayName: "SwiftLint",
8489
executable: executable.path,

0 commit comments

Comments
 (0)