yonaskolb / XcodeGen

A Swift command line tool for generating your Xcode project
MIT License
7k stars 818 forks source link

DeploymentTarget and configFiles in options from Yaml file affect each other? #874

Open sfdux opened 4 years ago

sfdux commented 4 years ago

I have a question for deploymentTarget and configFiles in options. See my yaml file below: name: XXX

options: minimumXcodeGenVersion: "2.11.0" indentWidth: 2 tabWidth: 2 deploymentTarget: iOS: "10.0" generateEmptyDirectories: true configFiles: Debug: "xcconfig/Project-Debug.xcconfig" Release: "xcconfig/Project-Release.xcconfig"

But the value of iOS Deployment Target is empty...See the screenshot below: image

If I remove the configFiles from my yaml file, iOS Deployment Target is "10.0". It's very strange. Who can help me?😂😂

yonaskolb commented 4 years ago

Hi @sfdux, can you show your build settings page, filtered for DEPLOYMENT_TARGET?

Screen Shot 2020-05-30 at 10 52 11 am
sfdux commented 4 years ago

@yonaskolb Thanks for your prompt reply. See my build settings page below: image My Yaml File: name: ToosieSlide options: minimumXcodeGenVersion: "2.11.0" indentWidth: 2 tabWidth: 2 deploymentTarget: iOS: "10.0" generateEmptyDirectories: true configFiles: Debug: "xcconfig/Project-Debug.xcconfig" Release: "xcconfig/Project-Release.xcconfig" targets: ... Why DEPLOYMENT_TARGET is not iOS 10.0 in build settings page?🤔

shakfu commented 2 years ago

I have a similar problem: deploymentTarget is not having any effect at the project or target level (I have configFiles set at the project level):

Ideally, I thought (as per the docs), that I should be able to do something like this:

name: demo
options:
  bundleIdPrefix: org.me
  deploymentTarget:
    macOS: "10.13"
settings:
  CODE_SIGN_IDENTITY: "-"
  DEVELOPMENT_TEAM: ""
  GCC_OPTIMIZATION_LEVEL: 0
  GCC_NO_COMMON_BLOCKS: No
  HEADER_SEARCH_PATHS:
    - $(PROJECT_HEADERS)
  INFOPLIST_FILE: $(SRCROOT)/../../../Info.plist
  LIBRARY_SEARCH_PATHS: $(PROJECT_LIBS)
  OTHER_LDFLAGS:
    - $(PROJECT_LDFLAGS)
  PRODUCT_NAME: $(TARGET_NAME)
configFiles:
  Debug: project.xcconfig
  Release: project.xcconfig
targets:
  foo:
    type: bundle
    platform: macOS
    sources:
      - foo.c
    dependencies:
      - sdk: CoreFoundation.framework

But I am having to actually to forgo deploymentTarget and set it at target.settings level:

name: demo
options:
  bundleIdPrefix: org.me
settings:
  CODE_SIGN_IDENTITY: "-"
  DEVELOPMENT_TEAM: ""
  GCC_OPTIMIZATION_LEVEL: 0
  GCC_NO_COMMON_BLOCKS: No
  HEADER_SEARCH_PATHS:
    - $(PROJECT_HEADERS)
  INFOPLIST_FILE: $(SRCROOT)/../../../Info.plist
  LIBRARY_SEARCH_PATHS: $(PROJECT_LIBS)
  OTHER_LDFLAGS:
    - $(PROJECT_LDFLAGS)
  PRODUCT_NAME: $(TARGET_NAME)
configFiles:
  Debug: project.xcconfig
  Release: project.xcconfig
targets:
  foo:
    type: bundle
    platform: macOS
    sources:
      - foo.c
    dependencies:
      - sdk: CoreFoundation.framework
    settings:
      MACOSX_DEPLOYMENT_TARGET: "10.13"

It's no biggie, but I'd you should know since it directly contradicts what you have in the documented spec.