Files
SwiftLint/Package.swift
Marcelo Fabri 8d9c501cb8 Add optional return_value_from_void_function rule using SwiftSyntax (#3054)
* Add optional return_value_from_void_function rule using SwiftSyntax

* Use Script/bootstrap in CI

* Make SwiftSyntax optional

* Make SwiftSyntax optional in SPM

* Fix Package.swift

* Try again

* Add minSwiftVersion

* Fix thread sanitizer issue

* Take 2

* Fix false positive on nested computed variables

* Remove support for Xcode 10.x

* Fix rule description

* Enable opt-in rule in configuration file

* Extract code into `SyntaxRule` protocol

* nit: make property private

* Missing docs

* Fix MasterRuleList.swift

* Update CHANGELOG

* Remove unused imports

* Use Example type

* Change rule kind to .idiomatic

* Update CHANGELOG

* Bump deployment target to macOS 10.12

* Simplify SyntaxRule.validate(file:visitor)

* Make TSan happy

* Use script/bootstrap in the README
2020-02-08 02:43:40 -08:00

60 lines
1.8 KiB
Swift

// swift-tools-version:5.0
import PackageDescription
#if canImport(CommonCrypto)
private let addCryptoSwift = false
#else
private let addCryptoSwift = true
#endif
#if compiler(>=5.1.0)
private let addSwiftSyntax = true
#else
private let addSwiftSyntax = false
#endif
let package = Package(
name: "SwiftLint",
platforms: [
.macOS(.v10_12)
],
products: [
.executable(name: "swiftlint", targets: ["swiftlint"]),
.library(name: "SwiftLintFramework", targets: ["SwiftLintFramework"])
],
dependencies: [
.package(url: "https://github.com/Carthage/Commandant.git", .upToNextMinor(from: "0.17.0")),
.package(url: "https://github.com/jpsim/SourceKitten.git", .upToNextMinor(from: "0.29.0")),
.package(url: "https://github.com/jpsim/Yams.git", from: "2.0.0"),
.package(url: "https://github.com/scottrhoyt/SwiftyTextTable.git", from: "0.9.0"),
] + (addCryptoSwift ? [.package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", .upToNextMinor(from: "1.0.0"))] : []) +
(addSwiftSyntax ? [.package(url: "https://github.com/apple/swift-syntax.git", .exact("0.50100.0"))] : []),
targets: [
.target(
name: "swiftlint",
dependencies: [
"Commandant",
"SwiftLintFramework",
"SwiftyTextTable",
]
),
.target(
name: "SwiftLintFramework",
dependencies: [
"SourceKittenFramework",
"Yams",
] + (addCryptoSwift ? ["CryptoSwift"] : []) +
(addSwiftSyntax ? ["SwiftSyntax"] : [])
),
.testTarget(
name: "SwiftLintFrameworkTests",
dependencies: [
"SwiftLintFramework"
],
exclude: [
"Resources",
]
)
]
)