任何人都在 Xcode 4 模板中的复制文件构建阶段取得了成功
我一直在尝试将复制文件构建阶段添加到 Xcode 4 的项目模板中,但我不知道如何添加要复制的文件。
这是我添加到目标中的内容。对 DstPath、DstSubfolderSpec 和 RunOnlyForDeploymentPostprocessing 的更改都反映在从模板创建的项目中。但没有文件。我尝试使用名为“文件”、“定义”、“节点”的键添加数组,但没有任何影响。
任何想法或想法将不胜感激!
<key>BuildPhases</key>
<array>
<dict>
<key>Class</key>
<string>CopyFiles</string>
<key>DstPath</key>
<string></string>
<key>DstSubfolderSpec</key>
<string>10</string>
<key>RunOnlyForDeploymentPostprocessing</key>
<string>NO</string>
</dict>
</array>
I've been trying to add a Copy Files build phase to a project template for Xcode 4 but I cannot figure out how to add files to copy.
Here's what I've added to my target. Changes to DstPath, DstSubfolderSpec and RunOnlyForDeploymentPostprocessing are all reflected in projects created from the template. But no files. I have tried adding an array using keys named Files, Definitions, Nodes, nothing has any affect.
Any thoughts or ideas would be greatly appreciated!
<key>BuildPhases</key>
<array>
<dict>
<key>Class</key>
<string>CopyFiles</string>
<key>DstPath</key>
<string></string>
<key>DstSubfolderSpec</key>
<string>10</string>
<key>RunOnlyForDeploymentPostprocessing</key>
<string>NO</string>
</dict>
</array>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我发现一个隐藏在一些奇怪的 python 脚本中的小宝石,它为神秘
DstSubfolderSpec
提供了“更好”(而不是没有)的解释......实际上有很多有趣的地方脚本中的信息(显然它是 pythonwebkit 的一部分,或者其他东西).. 但是不管怎样,如果你想尝试收集任何其他有用的花絮,我在这里发布了它的要点。
I found a little gem hidden in some weird python script that gave a "better" (as opposed to nothing) explanation of the mysterious
DstSubfolderSpec
…There's actually quite a bit of interesting info in the script, (apparently it's part of pythonwebkit, or something).. but regardless, I posted a gist of it here if you want to try and glean any other useful tidbits.
到目前为止,我已经完成了这项工作:
这将创建一个 CopyFiles 构建阶段,将文件复制到资源内的文件夹“www”。 (这将导致这些文件位于应用程序包中的 /www 下。)但是,我还无法指定复制哪些文件。这类似于 这个问题
So far I have this working:
This creates a CopyFiles build phase that copies files to the folder "www" inside of Resources. (This would result in those files living under /www in the app bundle.) However, I haven't yet been able to specify which files get copied. This is similar to this question
我不知道答案,但这可能是一个解决方法。它在每次构建时运行一个脚本。
请注意,脚本的路径是绝对路径。也许您可以使用
PathType
Group
定义路径,以将其设置为相对于项目内的组(我没有尝试)。DstPath
是要复制的文件的目标路径(我猜)。我不知道DstSubfolderSpec
是什么,它只出现在命令行工具中,值为0。我猜你也不知道。I don't know the answer but this may be a workaround. It runs a script with each build.
Note that the path to the script is absolute. Maybe you can define a path with
PathType
Group
to set it relative to a group inside the project (I didn't try).DstPath
is the destination path of the files to copy (I guess). I don't know whatDstSubfolderSpec
is, it only appears in the Command Line Tool with a value of 0. I guess you don't know it either.