12

I try to create a Xcode template. I followed the question Xcode 4 template create empty group but it doesn't work anymore.

There is only a file called "Application" (without an extension).

TemplateInfo.plist

<key>Nodes</key>
<array>
    <string>Application</string>
</array>

<key>Definitions</key>
<dict>
    <key>Application</key>
    <dict>
        <key>Path</key>
        <string>Application</string>
    </dict>
</dict>

Current result:

Project structure

Expected result:

Expected result

How do I have to change the TemplateInfo.plist so Xcode generates an empty folder called Application and not a file without an extension?

Community
  • 1
  • 1
ammerzon
  • 998
  • 1
  • 13
  • 30

2 Answers2

1

In Xcode 8, I wanted to add an empty group for to ensure the template follows a specific scaffolding. Through trial and error, I achieved this by I adding an empty folder in the xctemplate directory, and then configured the node / definition accordingly. I hope this helps :)

enter image description here

<key>Nodes</key>
<array>
    <string>Application</string>
</array>

<key>Definitions</key>
<dict>
    <key>Application</key>
    <dict>
        <key>Path</key>
        <string>Application/</string>
    </dict>
</dict>
AntonTheDev
  • 899
  • 6
  • 13
-1

Xcode 8

You could create folders inside .xctemplate directory. After creating files from that template, the folders that you've created will be shown as real folders, not groups, so...

You can simply just remove reference to all of those files and add them again to your project (with create groups from folders option selected).