diff --git a/Package.resolved b/Package.resolved deleted file mode 100644 index 04b0797..0000000 --- a/Package.resolved +++ /dev/null @@ -1,96 +0,0 @@ -{ - "originHash" : "1f7986484b7e8b057dd70f8be4c133ec09b8168d92949426b9d7e9ffb9521815", - "pins" : [ - { - "identity" : "collectionconcurrencykit", - "kind" : "remoteSourceControl", - "location" : "https://github.com/JohnSundell/CollectionConcurrencyKit.git", - "state" : { - "revision" : "b4f23e24b5a1bff301efc5e70871083ca029ff95", - "version" : "0.2.0" - } - }, - { - "identity" : "cryptoswift", - "kind" : "remoteSourceControl", - "location" : "https://github.com/krzyzanowskim/CryptoSwift.git", - "state" : { - "revision" : "7892a123f7e8d0fe62f9f03728b17bbd4f94df5c", - "version" : "1.8.1" - } - }, - { - "identity" : "sourcekitten", - "kind" : "remoteSourceControl", - "location" : "https://github.com/jpsim/SourceKitten.git", - "state" : { - "revision" : "b6dc09ee51dfb0c66e042d2328c017483a1a5d56", - "version" : "0.34.1" - } - }, - { - "identity" : "swift-argument-parser", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-argument-parser.git", - "state" : { - "revision" : "8f4d2753f0e4778c76d5f05ad16c74f707390531", - "version" : "1.2.3" - } - }, - { - "identity" : "swift-syntax", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-syntax.git", - "state" : { - "revision" : "6ad4ea24b01559dde0773e3d091f1b9e36175036", - "version" : "509.0.2" - } - }, - { - "identity" : "swiftlint", - "kind" : "remoteSourceControl", - "location" : "https://github.com/realm/SwiftLint", - "state" : { - "revision" : "f17a4f9dfb6a6afb0408426354e4180daaf49cee", - "version" : "0.54.0" - } - }, - { - "identity" : "swiftytexttable", - "kind" : "remoteSourceControl", - "location" : "https://github.com/scottrhoyt/SwiftyTextTable.git", - "state" : { - "revision" : "c6df6cf533d120716bff38f8ff9885e1ce2a4ac3", - "version" : "0.9.0" - } - }, - { - "identity" : "swxmlhash", - "kind" : "remoteSourceControl", - "location" : "https://github.com/drmohundro/SWXMLHash.git", - "state" : { - "revision" : "a853604c9e9a83ad9954c7e3d2a565273982471f", - "version" : "7.0.2" - } - }, - { - "identity" : "test-collector-swift", - "kind" : "remoteSourceControl", - "location" : "https://github.com/buildkite/test-collector-swift", - "state" : { - "revision" : "77c7f492f5c1c9ca159f73d18f56bbd1186390b0", - "version" : "0.3.0" - } - }, - { - "identity" : "yams", - "kind" : "remoteSourceControl", - "location" : "https://github.com/jpsim/Yams.git", - "state" : { - "revision" : "0d9ee7ea8c4ebd4a489ad7a73d5c6cad55d6fed3", - "version" : "5.0.6" - } - } - ], - "version" : 3 -} diff --git a/Package.swift b/Package.swift index 147566b..7dacf7d 100644 --- a/Package.swift +++ b/Package.swift @@ -9,10 +9,6 @@ let package = Package( products: [ .library(name: "WordPressShared", targets: ["WordPressShared"]) ], - dependencies: [ - .package(url: "https://github.com/buildkite/test-collector-swift", from: "0.3.0"), - .package(url: "https://github.com/realm/SwiftLint", exact: loadSwiftLintVersion()) - ], targets: [ .target( name: "WordPressSharedObjC", @@ -23,55 +19,20 @@ let package = Package( dependencies: [ .target(name: "WordPressSharedObjC"), ], - resources: [.process("Resources")], - plugins: [ - .plugin(name: "SwiftLintPlugin", package: "SwiftLint") - ] + resources: [.process("Resources")] ), .testTarget( name: "WordPressSharedTests", dependencies: [ - .target(name: "WordPressShared"), - .product(name: "BuildkiteTestCollector", package: "test-collector-swift") - ], - plugins: [ - .plugin(name: "SwiftLintPlugin", package: "SwiftLint") + .target(name: "WordPressShared") ] ), .testTarget( name: "WordPressSharedObjCTests", dependencies: [ - .target(name: "WordPressShared"), - .product(name: "BuildkiteTestCollector", package: "test-collector-swift") + .target(name: "WordPressShared") ], - resources: [.process("Resources")], - plugins: [ - .plugin(name: "SwiftLintPlugin", package: "SwiftLint") - ] + resources: [.process("Resources")] ), ] ) - -func loadSwiftLintVersion() -> Version { - let swiftLintConfigURL = URL(fileURLWithPath: #file) - .deletingLastPathComponent() - .appendingPathComponent(".swiftlint.yml") - - guard let yamlString = try? String(contentsOf: swiftLintConfigURL) else { - fatalError("Failed to read SwiftLint config file at \(swiftLintConfigURL).") - } - - guard let versionLine = yamlString.components(separatedBy: .newlines) - .first(where: { $0.contains("swiftlint_version") }) else { - fatalError("SwiftLint version not found in YAML file.") - } - - // Assumes the format `swiftlint_version: ` - guard let version = Version(versionLine.components(separatedBy: ":") - .last? - .trimmingCharacters(in: .whitespaces) ?? "") else { - fatalError("Failed to extract SwiftLint version.") - } - - return version -}