yonaskolb / XcodeGen

A Swift command line tool for generating your Xcode project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generated Xcode projects are different when include only resource folders vs include every resource file

larrytaowang opened this issue · comments

Might be similar to #763

When I have a resources folder like this

Resources
├── en-CA.lproj
     ├── Localized.strings
     └── empty.json

I am not sure if this is intentional when handling localized resources, but the generated Xcode project will be different if

  • include only Resources folder
  • include Resources folder and all its child files

Another issue I noticed is that, when I include Resources folder and all its child files, the reference value of localizable resources are temporary values, which changes in every xcode generator. I wonder if we can make this value consistent. E.g., the fileRef has `TEMP_XXX' values.

A3B91F68A2C75A2768B83823 /* empty.json in Resources */ = {isa = PBXBuildFile; fileRef = "TEMP_4814A821-4434-4B43-8472-492642E3B567" /* empty.json */; };
A924B0907ABAEB6A0645F235 /* empty.json in Resources */ = {isa = PBXBuildFile; fileRef = "TEMP_2573875C-3416-4EBA-B7AD-94BC7A2A028F" /* empty.json */; };

Steps to Reproduce

Here is my sample project: xcodegen-localized.zip.

When I include Resources folder and all its child files like this

targets:
  App:
    type: framework.static
    platform: iOS
    sources:
       ...
      - path: "/Users/tawang/Downloads/xcodegen-localized/rules-ios/objc/Resources/en-CA.lproj"
        optional: true     
      - path: "/Users/tawang/Downloads/xcodegen-localized/rules-ios/objc/Resources/en-CA.lproj/Localized.strings"
        optional: true
      - path: "/Users/tawang/Downloads/xcodegen-localized/rules-ios/objc/Resources/en-CA.lproj/empty.json"

the generated xcode project is as expected

When I include only the root Resource folder like this

targets:
  App:
    type: framework.static
    platform: iOS
    sources:
      - path: "/Users/tawang/Downloads/xcodegen-localized/rules-ios/objc"
        optional: true

The generated Xcode project is like this

Screen Shot 2022-04-19 at 10 45 49 AM