Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SWIFT_COMPILATION_MODE and CODE_SIGN_IDENTITY build settings #417

Merged
merged 5 commits into from
May 16, 2019

Conversation

dangthaison91
Copy link
Contributor

  1. Add SWIFT_COMPILATION_MODE:
  • Debug: Incremental
  • Release: Whole Module
  1. Update CODE_SIGN_IDENTITY:
  • Debug: iPhone Developer
  • Release: iPhone Distribution
  1. Fix SWIFT_ACTIVE_COMPILATION_CONDITIONS :
  • Debug: "DEBUG"
  • Actual Release: "DEBUG"
  • Expected Release: "RELEASE"

@pepicrft
Copy link
Contributor

pepicrft commented May 3, 2019

@dangthaison91 could you update the changelog? We can merge afterwards 😛

@kwridan
Copy link
Collaborator

kwridan commented May 3, 2019

good find @dangthaison91 ! Thanks for fixing it.

By default in Xcode when making a new project, the release configuration doesn't contain any RELEASE flags e.g.

Screen Shot 2019-05-03 at 7 36 40 AM

Is there a need to specify a build setting if it's the default specified by Xcode? e.g.

In Debug SWIFT_COMPILATION_MODE = singlefile (Incremental) by default

Screen Shot 2019-05-03 at 7 40 23 AM

The code signing settings by default are also iPhone Developer in both Release and Debug oddly:

Screen Shot 2019-05-03 at 7 46 44 AM

@dangthaison91
Copy link
Contributor Author

dangthaison91 commented May 3, 2019

@pepibumur @kwridan
I just guess we want to add compile flag for Release also. It's OK to change SWIFT_ACTIVE_COMPILATION_CONDITIONS to empty for Release config?

For CODE_SIGN_IDENTITY , IMHO "iPhone Distribution" for Release is fine because we often use it for archive.

@kwridan
Copy link
Collaborator

kwridan commented May 4, 2019

Hi @dangthaison91

For CODE_SIGN_IDENTITY , IMHO "iPhone Distribution" for Release is fine because we often use it for archive.

This is an interesting one - often Release is tied with archiving & distribution but isn't strictly necessary, for example when profiling the app on a device, you may choose to profile with the release configuration.

Developers may not have the distribution certificate available to them locally, thus this would prevent them from profiling / archiving locally. This is often the case on bigger teams.

This setting can easily be overridden for each use case e.g. in Tuist each manifest can override this setting.

let release = Configuration(settings: ["CODE_SIGN_IDENTITY": "iPhone Distribution"])

let project = Project(name: "App",
                      targets: [
                          Target(name: "App",
                                 platform: .iOS,
                                 product: .app,
                                 bundleId: "io.tuist.App",
                                 infoPlist: "Info.plist",
                                 sources: "Sources/**",
                                 dependencies: [
                                    // ...
                                 ],
                                 settings: Settings(release: release)),

As such for XcodeProj which many tools are built on top of it may be best to keep the Xcode default of iPhone Developer. Open to hearing others thoughts on this who are using XcodeProj directly / indirectly in their tooling.

Thanks again for the updates and apologies for the back and forth.

@pepicrft
Copy link
Contributor

pepicrft commented May 4, 2019

As such for XcodeProj which many tools are built on top of it may be best to keep the Xcode default of iPhone Developer. Open to hearing others thoughts on this who are using XcodeProj directly / indirectly in their tooling.

I think it's fine defaulting to this one in this component because it's an opt-in feature of XcodeProj. If developers would like to use a different value for that setting, they can override or not use the settings provider.

@codecov
Copy link

codecov bot commented May 6, 2019

Codecov Report

Merging #417 into master will decrease coverage by 0.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #417      +/-   ##
==========================================
- Coverage   78.95%   78.94%   -0.02%     
==========================================
  Files         140      140              
  Lines        6819     6820       +1     
==========================================
  Hits         5384     5384              
- Misses       1435     1436       +1
Impacted Files Coverage Δ
...ources/xcodeproj/Utils/BuildSettingsProvider.swift 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 39979d5...0fd9b59. Read the comment docs.

pepicrft
pepicrft previously approved these changes May 6, 2019
@dangthaison91
Copy link
Contributor Author

dangthaison91 commented May 16, 2019

Hey @pepibumur @kwridan I restored CODE_SIGN_IDENTITY setting to iPhone Developer as it is Xcode default settings for both configuration.

@pepicrft pepicrft merged commit c17e1af into tuist:master May 16, 2019
@pepicrft
Copy link
Contributor

Awesome 🎉! PR merged

marciniwanicki added a commit to tuist/tuist that referenced this pull request May 22, 2019
…21) (#364)

### Short description

Update XcodeProj version to point to current master 6029dac06eb48cc29c762965efebddb5d6c2a496 (2019-05-21). 

Includes "Add SWIFT_COMPILATION_MODE and CODE_SIGN_IDENTITY build settings" tuist/XcodeProj#417.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants