Create empty group in Xcode 7 template
Asked Answered
E

2

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?

Elwin answered 20/1, 2016 at 13:13 Comment(2)
What is it exactly you're trying to accomplish?Verve
@StuartP. I've updated the question and added the expected resultElwin
F
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>
Fastback answered 7/3, 2017 at 17:15 Comment(3)
This creates a yellow folder? And not a blue folder?Cimah
@Cimah this creates Blue folderRawdan
@Rawdan Any idea how to make it yellow?Cleavland
C
-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).

Coursing answered 24/10, 2016 at 22:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.