Questions tagged [swiftpm]

Swift Package Manager, tool for swift code distribution

From the home page: The Swift Package Manager is a tool for managing the distribution of Swift code. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.

35 questions
11
votes
2 answers

ignoring declared target(s) 'swift-nio-zlib-support' in the system package

I'm getting this warning from SPM (I think) since upgrading to Xcode 12.5 and I have two questions: What does it mean? What can I do to solve/hide it? Would be thankful for any responses. I found no good answers to these questions on Google.
Alex
  • 731
  • 1
  • 11
  • 24
8
votes
0 answers

Framework with multiple targets and shared sources

I have a framework with two targets (A and B) with the following file structure: FooFramework |__ A |__ Foo.swift |__ Bar.swift |__ Foobar.swift |__ B |__ Barfoo.swift B basically has a subset of A's sources (where B is set as a…
Martin Dinh
  • 213
  • 1
  • 8
8
votes
1 answer

Swift package dependency with unsafe build flags: target integrity error

TL;DR I am getting the following error for a local Swift package dependency when attempting to use it within an iOS project in Xcode: The package product 'DlibWrapper' cannot be used as a dependency of this target because it uses unsafe build…
Boris
  • 151
  • 1
  • 7
7
votes
0 answers

Conditional dependency for target in SwiftPM

I have a custom swift package I am building that has as one of its dependencies a package (Bugfender) that is an xcframework and is iOS only (and Mac Catalyst). Understandably, when I try to compile this package in Xcode (12.5) I get an error that a…
robowen5mac
  • 866
  • 8
  • 17
5
votes
1 answer

Swift Package Manager - Setting Custom Classes in storyboard in package fails

I am trying to implement a support for Swift Package Manager for an iOS framework that we used to link in our main project with Carthage. The framework's name is "OptionsSheetKit" The framework contained a UIViewController that is a replica of…
Stoyan
  • 1,265
  • 11
  • 20
4
votes
2 answers

How to use a local Swift Package which provides two libraries?

I have a local swift package Foo which provides two different libraries Foo and FooB. Now I would like to use them in another local package Bar. I am only able to get the whole package by path declaration. Is there a way to name/specify which…
4
votes
1 answer

FBLPromise crash with CocoaPods and SwiftPM implemented in both

We've been migrating away from CocoaPods since a while, but not every dependency has made the switch. Like Firebase. I've had a similar question regarding duplicate symbols, but now I'm facing something new, which is probably because I'm using a…
basvk
  • 4,437
  • 3
  • 29
  • 49
3
votes
1 answer

How to change font in Xcode Swift Playgrounds(.swiftpm) project?

How can I implement a custom font in the new Xcode Swift Playgrounds project? In the simple Xcode App project we do it importing the font and adding it in the info plist (fonts provided by application), but in this type of project there isn't the…
Fabez
  • 332
  • 1
  • 12
3
votes
0 answers

Is it possible to get Xcode to build dylibs for a SwiftPM project?

I am building a library using SwiftPM, and it is important for my use case that I link dynamically, so I have a dylib product. .library(name: "ExampleLib", type: .dynamic, targets: ["ExampleLib"]) When I build the library with swift build, there is…
deaton.dg
  • 1,282
  • 9
  • 21
3
votes
1 answer

Referring to a type in another module with the same name as a type in the current module when the other module has a type with its own name in Swift

I am using the swift package manager. I have a module ModuleA which exports two types: ModuleA and Test. I have a module ModuleB which defines a single type: Test. In ModuleB, how can I refer to the type Test from ModuleA? Ideally, I would like…
deaton.dg
  • 1,282
  • 9
  • 21
3
votes
2 answers

Files in Swift Package out of scope

I created a basic project with a swift package(let's call it "Foo") related to this project. I tried printing "hello world" from Foo().text from AppDelegate and I get an error: "Cannot call value of non-function type 'module' " I then tried to…
Yuriy Troyan
  • 91
  • 1
  • 7
2
votes
1 answer

iOS-only SPM targets built against watchOS

Our project uses several 3rd party packages using Swift Package Manager. Some of them are shared among the iOS and watchOS project, but several packages depend on UIKit, so they are not included in the "Frameworks, Libraries, and Embedded Content"…
gklka
  • 2,459
  • 1
  • 26
  • 53
2
votes
0 answers

Is there any way to make the SwiftPackage use only languages supported by the root module?

I have a project that supports limited amount of languages. For example: I have a Package that supports a wider amount of languages Is there any way to make the Package use only languages supported by the root module? The Package uses a system…
Nuzhdin Vladimir
  • 1,714
  • 18
  • 36
2
votes
0 answers

Fastlane SwiftPM dependency caching

SwiftPM is always fetching modules whenever I deploy a build. This takes a long time. I use Fastlane on GitHub for our CI/CD. May be there is some way to enable packages caching? Looks like GitHub do not provide caching for Swift packages.
2
votes
1 answer

Swift CLI --xunit-output option not working for me

I'm running Xcode 13.1 / Swift 5.5.1. I have a package that has some unit tests in it; the Package.swift file uses swift-tools-version:5.5. When I build & test my package from the CLI like this: $ swift test --xunit-output results.xml the tests run…
jbelkins
  • 470
  • 3
  • 15
1
2 3