Xcodegen: Add a file to project target, that file have no file extension

Created on 20 Nov 2019  路  4Comments  路  Source: yonaskolb/XcodeGen

is there any wat to add a file without file extension to project target

Most helpful comment

Files with no file extension aren't given added to any build phase automatically. You will have to supply the build phase manually, before adding the whole directory as sources.

sources:
  - path: Files/file
    buildPhase: resources
  - Files

You could also use an includes glob if all the files share a certain name.
Let me know how you go.

One other option we have is also adding files with no extension to the resources build phase automatically, but I'm not sure if that's a good default. If someone wants to add a pr adding an option in options for it (something like defaultBuildPhaseForNoFileExtension), I'd be happy to merge

All 4 comments

Hi @dabaddah. Could you give some more information? Are you trying to add it to a specific build phase, or just have it show up in the navigator?

@yonaskolb Heyo, I'm having this same issue.

Our use case is that we're testing some files that are test data that don't have an extension, and we'd like them to be include in the test target. Currently, these files aren't added in, even when specified in sources, and I can't seem to add a glob to get the attached to the test target.

Am I missing something basic here?

Files with no file extension aren't given added to any build phase automatically. You will have to supply the build phase manually, before adding the whole directory as sources.

sources:
  - path: Files/file
    buildPhase: resources
  - Files

You could also use an includes glob if all the files share a certain name.
Let me know how you go.

One other option we have is also adding files with no extension to the resources build phase automatically, but I'm not sure if that's a good default. If someone wants to add a pr adding an option in options for it (something like defaultBuildPhaseForNoFileExtension), I'd be happy to merge

@yonaskolb Perfect, thank you!

I think this would maybe be worth mentioning _explicitly_ in the docs?

i.e.

This manually sets the build phase this file or files in this directory will be added to, otherwise XcodeGen will guess based on the file extension. If no extension is present, the file will be automatically ignored.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

toshi0383 picture toshi0383  路  3Comments

vlozko picture vlozko  路  4Comments

pvinis picture pvinis  路  6Comments

AlexisQapa picture AlexisQapa  路  3Comments

yonaskolb picture yonaskolb  路  3Comments