如何让Xcode在磁盘上的文件夹结构中复制项目组结构? [英] How do I get Xcode to replicate project group structure in the folder structure on disk?

查看:229
本文介绍了如何让Xcode在磁盘上的文件夹结构中复制项目组结构?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个具有以下组结构的Xcode项目:

I have an Xcode project with the following group structure:

ProjectName/
    Classes/
        class1.h
        class1.m
        class2.h
        class2.m
        ...
    XMLDocs/
        doc1.xml
        doc2.xml
        ...
    Resources/
        Info.plist
        MainMenu.xib
        ...

等等。

我想要在文件夹结构中磁盘:

I'd like this to be represented in the folder structure on the disk as well:

ProjectFolder/
    Project.xcodeproj
    Classes/
        class1.h
        class1.m
        class2.h
        class2.m
        ...
    XMLDocs/
        doc1.xml
        doc2.xml
        ...
    Resources/
        Info.plist
        MainMenu.xib
        ...

而不是根项目文件夹方法中的通常的一切。

as opposed to the usual everything in the root project folder methodology.

有没有办法做到这一点,无需手动创建文件夹结构在磁盘上,然后必须重新指定所有的参考在Xcode的新位置?

Is there any way to do this without manually creating the folder structure on the disk and then having to repoint all the reference in Xcode to the new location?

奖金积分,如果你能告诉我如何自动做任何时候我

Bonus points if you can tell me how to do this automatically any time I create a new group or add files to an existing group in Xcode.

推荐答案

没有让我的磁盘看起来像我的项目结构功能。

There's no "make my disk look like my project structure" functionality in Xcode.

您可以使用AppleScript自动执行任务:您可以从脚本中检查和更改项目结构。所以你只需要编写一个脚本,遍历项目结构,使文件夹层次结构看起来像项目结构,并调整Xcode的文件和组引用同时指向的位置。

You could automate the task using AppleScript, though: You can both examine and change project structure from a script. So you'd just have to write a script that iterates over the project structure and makes the folder hierarchy look the way the project structure does, and adjust where Xcode's file and group references point at the same time.

这篇关于如何让Xcode在磁盘上的文件夹结构中复制项目组结构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆