CocoaPods / CocoaPods/Xcodeproj

Scheme name as a build time environment variable

Open
#897 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Ruby
Stars
2.4k
Forks
488
PR merge metrics
No merged PRs in 30d

Description

Is there any way to configure the Xcode project to set the name of the scheme as a build time environment variable? Or some way to pull a value from some configuration file associated with the scheme?

I need to configure the project so the scheme name is retrievable from a build phase script. I don't have the luxury of using the Xcode interface as I am writing a CLI command that configures the user's project.

I've already looked at Xcode build settings environment variables:
https://developer.apple.com/documentation/xcode/build-settings-reference

There doesn't appear to be any specific scheme configuration file to get the name.

I thought the [EnvironmentVariables](https://www.rubydoc.info/gems/xcodeproj/Xcodeproj/XCScheme/EnvironmentVariables) solved this problem but it appears it is for the run-time, not for build settings.

Any suggestions would be greatly appreciated! Thanks.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the Xcode build settings reference and the XCScheme::EnvironmentVariables entry point mentioned in the issue. Determine whether scheme configuration can expose its name to a build-phase script without relying on the Xcode interface, and document or implement the supported approach for the CLI use case.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
build-system, cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.