[GH-ISSUE #38] [SwiftPM] How to include in only certain configurations? #31

Closed
opened 2026-03-03 19:11:08 +03:00 by kerem · 2 comments
Owner

Originally created by @jsorge on GitHub (Nov 11, 2020).
Original GitHub issue: https://github.com/ProxymanApp/atlantis/issues/38

Originally assigned to: @NghiaTranUIT on GitHub.

First: this is awesome. I've just installed the Swift Package into our project and it's fantastic!

I'm wondering if there's a way for me to only include the library in a certain configuration (debug in my case) since I would prefer to exclude Atlantis from all of my release builds. Were this just a library in my project I could use a build setting in the OTHER_LDFLAGS for my debug configuration to link it. I don't see any way to do this in the Xcode UI though 😞

Any tips to get this done are much appreciated!

Originally created by @jsorge on GitHub (Nov 11, 2020). Original GitHub issue: https://github.com/ProxymanApp/atlantis/issues/38 Originally assigned to: @NghiaTranUIT on GitHub. First: this is awesome. I've just installed the Swift Package into our project and it's fantastic! I'm wondering if there's a way for me to only include the library in a certain configuration (debug in my case) since I would prefer to exclude Atlantis from all of my release builds. Were this just a library in my project I could use a build setting in the `OTHER_LDFLAGS` for my debug configuration to link it. I don't see any way to do this in the Xcode UI though 😞 Any tips to get this done are much appreciated!
kerem closed this issue 2026-03-03 19:11:08 +03:00
Author
Owner

@NghiaTranUIT commented on GitHub (Nov 12, 2020):

You can exclude it in two way:

Soft approach

It means that you still include Atlantis library to your source code, but don't import it or start the Atlantis. It just stays there and does nothing.

#if DEBUG
import Atlantis
Atlantis.start()
#endif

Hard approach

It means that you completely exclude Atlantis from Production build, but include in Debug build.

  1. Duplicate your current target and add suffix "-Production"
  2. Select the new target and Remove Atlantis library from the "Framework, libraries, and embedded contents" section
Screen_Shot_2020-11-12_at_09_06_37
  1. Create a new Scheme that links to the new target. e.g MyApp-Production
  2. Use the same code
#if DEBUG
import Atlantis
Atlantis.start()
#endif
  1. When you release a Production build, make sure you select MyApp-Production Scheme and achieve it.
<!-- gh-comment-id:725783090 --> @NghiaTranUIT commented on GitHub (Nov 12, 2020): You can exclude it in two way: ### Soft approach It means that you still include Atlantis library to your source code, but don't import it or start the Atlantis. It just stays there and does nothing. ```swift #if DEBUG import Atlantis Atlantis.start() #endif ``` ### Hard approach It means that you **completely exclude** Atlantis from Production build, but include in Debug build. 1. Duplicate your current target and add suffix "-Production" 2. Select the new target and Remove Atlantis library from the "Framework, libraries, and embedded contents" section <img width="1411" alt="Screen_Shot_2020-11-12_at_09_06_37" src="https://user-images.githubusercontent.com/5878421/98886775-3dde4200-24c7-11eb-8249-93ab14c3d94b.png"> 3. Create a new Scheme that links to the new target. e.g MyApp-Production 4. Use the same code ```swift #if DEBUG import Atlantis Atlantis.start() #endif ``` 5. When you release a Production build, make sure you select MyApp-Production Scheme and achieve it.
Author
Owner

@jsorge commented on GitHub (Nov 12, 2020):

Gotcha, thanks!

<!-- gh-comment-id:726224390 --> @jsorge commented on GitHub (Nov 12, 2020): Gotcha, thanks!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/atlantis#31
No description provided.