Swift CLI application in workspace and dependencies in workspace and cocoapod

Viewed 141

I try to create a CLI application using Swift.
I've made a framework with logic and create for that framework separate project in a workspace.
Also I use cocoapods to manage dependencies.
Now my workspace has following structure:

Workpace
   FrameworkProject
   CLIApplicationProject
   PodsProject

The CLI application has dependencies on the Framework and Pods libraries. Also I've add a copy Framework phase into building stages. If I launch a building of the CLI application I'll get an error about missed libraries (Framework and Pod).
I do not want to use static linking, I want to use Frameworks. Also I do not want to put all targets in a same project, I want to use a Workspace and different projects for targets with different semantic.
I tried to find guide for building a CLI applications with frameworks in different projects and same workspace, but couldn't.
How I can configure building process for CLI application with Frameworks and Cocoapods?

Here example of a such application.

1 Answers

I assume POD's configuration should not be changed, so the fix is to add Runpath Search Path for framework from POD (ie. in your case '@loader_path/SwiftyTimer') as shown below

demo

Also as I don't have your team & certificate, I disabled signing & library validation for Debug, as below, but this should not be a step for you. Just in case.

demo2

Tested with Xcode 11.4 / macOS 10.15.4

demo2

Related