Skip to content

Commit

Permalink
Build framework with targeted strict concurrency checks (#5937)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimplyDanny authored Jan 4, 2025
1 parent 7321f2b commit 83f9e3b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ strict_concurrency_copts = [
"-Xfrontend",
"-strict-concurrency=complete",
]
targeted_concurrency_copts = [
"-Xfrontend",
"-strict-concurrency=targeted",
]

# Targets

Expand Down Expand Up @@ -140,7 +144,7 @@ swift_library(
srcs = glob(
["Source/SwiftLintFramework/**/*.swift"],
),
copts = copts, # TODO: strict_concurrency_copts
copts = copts + targeted_concurrency_copts,
module_name = "SwiftLintFramework",
visibility = ["//visibility:public"],
deps = [
Expand Down
5 changes: 3 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ let swiftFeatures: [SwiftSetting] = [
.enableUpcomingFeature("ForwardTrailingClosures"),
.enableUpcomingFeature("ImplicitOpenExistentials"),
]
let strictConcurrency = [SwiftSetting.enableExperimentalFeature("StrictConcurrency")]
let strictConcurrency = [SwiftSetting.enableExperimentalFeature("StrictConcurrency=complete")]
let targetedConcurrency = [SwiftSetting.enableExperimentalFeature("StrictConcurrency=targeted")]

let swiftLintPluginDependencies: [Target.Dependency]

Expand Down Expand Up @@ -57,7 +58,7 @@ let package = Package(
"SwiftLintExtraRules",
"CollectionConcurrencyKit",
],
swiftSettings: swiftFeatures
swiftSettings: swiftFeatures + targetedConcurrency
),
.plugin(
name: "SwiftLintBuildToolPlugin",
Expand Down

0 comments on commit 83f9e3b

Please sign in to comment.