From 83f9e3b45b54714139ab0a660e75964b3ffc9948 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danny=20M=C3=B6sch?= Date: Sat, 4 Jan 2025 21:19:05 +0100 Subject: [PATCH] Build framework with targeted strict concurrency checks (#5937) --- BUILD | 6 +++++- Package.swift | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/BUILD b/BUILD index 10f3d6fc52..53907b3b7b 100644 --- a/BUILD +++ b/BUILD @@ -39,6 +39,10 @@ strict_concurrency_copts = [ "-Xfrontend", "-strict-concurrency=complete", ] +targeted_concurrency_copts = [ + "-Xfrontend", + "-strict-concurrency=targeted", +] # Targets @@ -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 = [ diff --git a/Package.swift b/Package.swift index 8e5ca12135..a6fcd21b72 100644 --- a/Package.swift +++ b/Package.swift @@ -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] @@ -57,7 +58,7 @@ let package = Package( "SwiftLintExtraRules", "CollectionConcurrencyKit", ], - swiftSettings: swiftFeatures + swiftSettings: swiftFeatures + targetedConcurrency ), .plugin( name: "SwiftLintBuildToolPlugin",