Xcode Project Template: Add file to the project group
Asked Answered
D

1

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>
    
Dolphin answered 21/3, 2013 at 21:55 Comment(0)
R
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>
    
Redevelop answered 27/6, 2017 at 11:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.