将目录添加到Xcode自定义项目模板会产生奇怪的递归
Adding Directories to Xcode custom project template creates weird recursion
我正在尝试创建一个Xcode项目模板,该模板将使用.plist中的以下内容来创建一个包含classe文件的目录:
<key>Definitions</key>
<dict>
<key>Classes</key>
<dict>
<key>Path</key>
<string>Classes</string>
</dict>
</dict>
<key>Nodes</key>
<array>
<string>Classes</string>
</array>
这几乎可行,但Classes中的最后一个文件总是成为Classes文件的引用文件夹,从而创建一个奇怪的递归。
举个例子,假设Classes有3个文件,a.h、b.h和c.h。生成的项目将具有如下的文件结构:
project
+-Classes
+-a.h
+-b.h
+-c.h //This is not a proper .h file, it is a file reference
+-a.h
+-b.h
+-c.h //This is the actual .h file
有没有一种干净的方法可以让项目模板从一个目录中复制所有文件?
经过大量研究,这似乎是Xcode模板系统的一个错误。似乎没有一种方法可以在不产生这个问题的情况下复制包含其他文件的目录(至少在编写这个答案时)。
我能找到的唯一替代方案是在项目模板的目录中手动指定每个文件,指定文件的组以匹配文件夹结构。
<key>Definitions</key>
<dict>
<key>Classes/a.h</key>
<dict>
<key>Group</key>
<array>
<string>Classes</string>
</array>
<key>Path</key>
<string>Classes/a.h</string>
</dict>
<!--Repeat for b and c-->
</dict>
<key>Nodes</key>
<array>
<string>Classes/a.h</string>
<!--Repeat for b and c-->
</array>
相关文章:
- 通过递归进行因子分解
- 递归函数计算序列中的平方和(并输出过程)
- 递归添加子树以提升属性树
- 编写递归算法以从链表中删除元素.编写递归算法以将元素添加到链表中
- 如何在Qt中递归添加源文件
- 递归地将 1 添加到 BST 中的所有节点,但具有最小数据的节点除外
- 简单的二进制搜索树非递归添加功能
- c++ 递归添加,4*x
- 如何使用递归向字符串添加逗号
- 递归函数,添加传递给它的两个变量
- 将目录添加到Xcode自定义项目模板会产生奇怪的递归
- 使用递归将元素添加到向量中
- 递归添加到带有点 c++ 的向量
- 用内部类函数递归地添加数组数
- 递归-按顺序向列表中添加树数据
- 将基数10转换为12,在递归地添加字母字符时遇到麻烦
- 递归函数扫描字符串以添加ASCII
- 以递归方式将项添加到矢量
- QTDom -递归地向特定元素添加子元素
- 为什么添加相同的东西会翻转递归