XcodeGen icon indicating copy to clipboard operation
XcodeGen copied to clipboard

Add a source folder as a group, but with any children folders as a folder

Open hiltonc opened this issue 4 years ago • 4 comments

I'm working on a Safari web extension which includes a bunch of files and folders in a Resources directory. I need to bundle all of these files and folders, but without a parent "Resources" folder in my app extension. In Xcode it should look like:

Screen Shot 2021-08-17 at 4 59 19 PM

Unfortunately I can't find a straightforward way to do this with XcodeGen. If I hardcode each path I can do it, but the contents of this folder can change over time and I'd prefer to just pick up those changes from the file system.

I currently have them hardcoded like this:

    type: app-extension
    platform: iOS
    sources:
      - Sources
      - path: Resources/assets
        type: file
        buildPhase: resources
        group: Resources
      - path: Resources/background.js
        buildPhase: resources
        group: Resources
      - path: Resources/content.js
        buildPhase: resources
        group: Resources
      - path: Resources/manifest.json
        buildPhase: resources
        group: Resources
      - path: Resources/popup.html
        buildPhase: resources
        group: Resources
      - path: Resources/popup.js
        buildPhase: resources
        group: Resources

I'd prefer to be able to just specify the Resources path with some configuration to have it treated like this.

Is there already a way to do this, or is this something that can be easily accomodated?

hiltonc avatar Aug 18 '21 00:08 hiltonc

@hiltonc, it could be done by specifying type argument:

- path: SafariExtension/Resources/_locales
  type: folder
- path: SafariExtension/Resources/images
  type: folder

or

- path: SafariExtension/Resources/_locales
  buildPhase: resources
  type: file
- path: SafariExtension/Resources/images
  buildPhase: resources
  type: file

barbasevich avatar Mar 16 '22 12:03 barbasevich

@barbasevich I still have to specify them one-by-one with that.

hiltonc avatar Mar 21 '22 20:03 hiltonc