7

How do I make my custom Xcode project template add a file, e.g., README.md, to the project group (in the Project Navigator)?

The following steps puts the README.md file in the root project directory (on the filesystem) but in the group named after the target. How do I add it to the project group?

  1. Add README.md to the project template's root directory.

  2. Add the following key-value pairs to the TemplateInfo.plist.

    <key>Definitions</key>
    <dict>
        <key>../README.md</key>
        <dict>
            <key>Path</key>
            <string>README.md</string>
            <key>TargetIndices</key>
            <array/>
        </dict>
    </dict>
    

    and

    <key>Nodes</key>
    <array>
        <string>../README.md</string>
    </array>
    
ma11hew28
  • 121,420
  • 116
  • 450
  • 651

1 Answers1

1
  1. You can put README.md file into Project template/FolderName
  2. add Definitions in TemplateInfo.plist

    <key>FolderName/README.md</key>
    <dict>
        <key>Path</key>
        <string>FolderName/README.md</string>
        <key>Group</key>
        <array>
            <string>FolderName</string>
        </array>
    </dict>
    

and

  1. add Nodes

    <string>FolderName/README.md</string>
    
Pratik Lad
  • 464
  • 4
  • 9