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

Platform settings not applied #247

Closed
thecb4 opened this issue Feb 25, 2018 · 13 comments
Closed

Platform settings not applied #247

thecb4 opened this issue Feb 25, 2018 · 13 comments

Comments

@thecb4
Copy link

thecb4 commented Feb 25, 2018

New to XcodeGen and trying to create a universal framework as a test. However, the below project.yml does not apply the correct base SDK or deployment targets by platform. Not sure what I'm missing.

name: GenKit
options:
  usesTabs: false
  indentWidth: 2
  createIntermediateGroups: true
  bundleIdPrefix: io.thecb4
  settingPresets: all
  # deploymentTarget:
  #   iOS: 11.2
  #   tvOS: 11.2
  #   watchOS": 4.1
  #   macOS: 10.13
configs:
  Debug: debug
  Release: release
fileGroups:
  - Framework
targets:
  GenKit:
    type: framework
    platform: [macOS, iOS, tvOS, watchOS]
    sources:
      - Framework/Sources/Core
      - Framework/Sources/$platform
    scheme:
      testTargets:
        - GenKitUnitTests_$platform
        # - GenKitUITests_$platform
      build:
        targets:
          - target: GenKit
            buildTypes: all
          - target: GenKitUnitTests_$platform
            buildTypes: testing
      test:
        config: Debug
      run:
        config: Debug
      analyze:
        config: Debug
      gatherCoverageData: true
      commandLineArguments:
        # "-MyEnabledArg": true
        # "-MyDisabledArg": false
    # settings:
    #   PRODUCT_MODULE_NAME: $(PROJECT_NAME)
    #   PRODUCT_NAME: $(PROJECT_NAME)
  GenKitUnitTests:
    type: bundle.unit-test
    platform: [macOS, iOS, tvOS, watchOS]
    sources:
      - Framework/Tests/Unit/Core
      - Framework/Tests/Unit/$platform
    dependencies:
      # - carthage: RxSwift
      # - carthage: Dwifft
      # - carthage: SwiftCheck
      - target: GenKit_$platform
  # GenKitUITests:
  #   type: bundle.ui-testing
  #   platform: [macOS, iOS, tvOS, watchOS]
  #   sources:
  #     - Framework/Tests/UI/Core
  #     - Framework/Tests/UI/Core/$platform
  #   dependencies:
  #     # - carthage: RxSwift
  #     # - carthage: Dwifft
  #     # - carthage: SwiftCheck
  #     - target: GenKit_$platform
@toshi0383
Copy link
Collaborator

watchOS": 4.1

@thecb4
You have unnecessary " there. So maybe that's the problem?
I tried it locally and it seems to working fine.

@thecb4
Copy link
Author

thecb4 commented Feb 25, 2018

the watchOS item is commented out in the above example.

When I uncomment and fix the watchOS ", the base SDK still shows as macOS for the iOS target.

@yonaskolb
Copy link
Owner

Hi @thecb4
What installation method did you use? Is it possible that the SettingsPresets directory isn't being found? What is the output in the terminal, perhaps there are some warnings to that effect?

Also just a note, your targets.GenKit.scheme seems to be in the wrong format. You're using properties from https://github.com/yonaskolb/XcodeGen/blob/master/Docs/ProjectSpec.md#scheme instead of https://github.com/yonaskolb/XcodeGen/blob/master/Docs/ProjectSpec.md#target-scheme
The following properties are not required:

  • build
  • test
  • run
  • analyze

@thecb4
Copy link
Author

thecb4 commented Feb 25, 2018

I installed via Homebrew. I am getting the following error when I run

No "base" settings found
No "release config" settings found
No "$platform" settings found

for each $platform. I figured it was because I wasn't using xcconfig files

@yonaskolb
Copy link
Owner

yonaskolb commented Feb 26, 2018

Strange, the latest homebrew install is working for me (and many others I assume)
Can you run the following commands:

which xcodegen
xcodegen -v
ls /usr/local/share/xcodegen/SettingPresets

@thecb4
Copy link
Author

thecb4 commented Feb 26, 2018

/usr/local/bin/xcodegen
1.6.0
ls: /usr/local/share/xcodegen/SettingPresets: No such file or directory

may have found the culprit. I installed using Mint, not homebrew

@yonaskolb
Copy link
Owner

Oh, I just did some testing on this and it's highlighted a issue in the Mint installation. Xcodegen isn't reading the platform settings from the right place.
I'm actually really surprised this wasn't picked up before. Personally I had some shared files lying around from a homebrew installation. This could possibly be a change in High Sierra in how symlinks are read.
@toshi0383 your issue here relates to this yonaskolb/Mint#53
Fixing now

@thecb4
Copy link
Author

thecb4 commented Feb 26, 2018

awesome. I'll be on the lookout for the fix.

@yonaskolb
Copy link
Owner

Fixed in #248 and will be in the next release. For a temporary fix copy SettingPresets to /usr/local/share/xcodegen/SettingPresets

@thecb4
Copy link
Author

thecb4 commented Feb 26, 2018

work around works perfectly. Thanks!

@atreat
Copy link

atreat commented May 9, 2018

Is this fix in XcodeGen, Mint, or both?

I still run into it with the following:

bash-3.2$ mint -v
0.9.1
bash-3.2$ xcodegen -v
1.9.0

I can use the work around above

bash-3.2$ mkdir /usr/local/share/xcodegen
bash-3.2$ cp -R /usr/local/lib/mint/packages/github.com_yonaskolb_xcodegen/build/1.9.0/SettingPresets /usr/local/share/xcodegen/

but I'm trying to get this working in a CI environment and the install path for xcodegen may not work for me.


I updated my setup script with a bit for a workaround for this issue. Still not excited about using the build path for the xcodegen package though:

if [ ! -d "/usr/local/share/xcodegen" ];
then
    mkdir /usr/local/share/xcodegen
fi
cp -R /usr/local/lib/mint/packages/github.com_yonaskolb_xcodegen/build/$(xcodegen -v)/SettingPresets /usr/local/share/xcodegen/

@davertay
Copy link

FYI, I encountered this same issue today when installing mint + xcodegen. What version will have the fix?
% mint -v
Version: 0.10.2
% xcodegen -v
1.10.2

@yonaskolb
Copy link
Owner

Just fixed this in XcodeGen 1.10.3

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

No branches or pull requests

5 participants