Suppress warnings from dependencies using Swift Package Manager

Assuming I have Package.swift, as shown below, and SomePackagefrom the dependencies it generates warnings during swift build.

// swift-tools-version:4.0
import PackageDescription

let package = Package(
    name: "my-app",
    dependencies: [
        .package(url: "https://some-package.git", .upToNextMajor(from: "1.0"))
    ],
    targets: [
        .target(name: "Run", dependencies: ["SomePackage"]
    ]
)

How can I suppress these warnings from dependencies, but save them from my code?

+4
source share
1 answer

I do not know how to suppress warning only dependencies, but you can turn off all the warnings in the build time by passing this option: -Xswiftc -suppress-warnings. The call will look like

swift build -Xswiftc -suppress-warnings
+1
source

Source: https://habr.com/ru/post/1689388/


All Articles