XcodeGen icon indicating copy to clipboard operation
XcodeGen copied to clipboard

Add folder/files without target but keeping tree structure

Open marcosmko opened this issue 3 years ago • 5 comments

Hello all!

Just wondering if I can add files and folders to project without adding to target (like fileGroup) but keeping the tree structure. Maybe something like this?

targets:
  MyApp:
    sources:
      - path: MyApp
        excludes:
          - "Resources/Environments"
    fileGroups:
      - Resources/Environments

It would generate the project structure as if I'm not excluding folders AND not adding to the MyApp target.

Thank you very much!

marcosmko avatar Jan 17 '23 13:01 marcosmko

I'm writing this off the top of my head, but does this work?

targets:
  MyApp:
    sources:
      - path: MyApp/Resources/Environments
        buildPhase: none
      - path: MyApp

yonaskolb avatar Jan 19 '23 02:01 yonaskolb

hey @yonaskolb ! unfortunately it doesn't 😕 it is adding to the root, to target and to build phase

marcosmko avatar Jan 19 '23 13:01 marcosmko

I have the same question. I would like to keep MarkDown files visible within Xcode, but they shouldn't be included as a resource in my app.

NSURLSession0 avatar Mar 15 '23 19:03 NSURLSession0

I found a solution:

    sources:
     - path: myTarget
       excludes:
         - "**/*.plist"
     - path: myTarget
       includes:
         - "**/*.plist"
       buildPhase: none

This adds the files to the project, but not to the target.

Use the same lists of paths in includes and excludes, and add buildPhase: none in the includes.

KacperCzapp avatar May 30 '23 07:05 KacperCzapp

works, but seems kinds h4xey :P

alessdiimperio avatar Jan 24 '24 20:01 alessdiimperio