On Mar 4, 2012, at 23:42 , Erik Stainsby wrote: The challenge there Jens is knowing where all the paths are in the Xc configure environment. Witness the multiple project layout. I'm not scripting in Kansas anymore.
I think this is easier than you think it is:
1. When you first create the project, you can move the *contents* of the outer project folder anywhere you like**, because at that point everything in the project is relative to the project file, not the folder that contains it.
If you want to create 40 projects, you can put all 40 pairs of project file/source folder in the same place, then throw away the 40 outer folders that are now empty.
2. When you add other sources to your project, you should add whole folders of them to the project, letting Xcode create a top-level group for each top level folder. That way, the top level groups are all relative to the project ('../../sources' or whatever), while all the files will be relative to the group (i.e. effectively relative to 'sources' rather than the project file).
(3. If you want a top level group structure that doesn't match your actual folders, create the top level groups first and set their paths explicitly to 'sources'. Then, when you drag files and subfolders into the top level groups, they'll get get group-relative -- i.e. 'sources'-relative -- paths.)
If you've already messed things up (e.g. your groups have no path relative to the project, and the files in the groups have '../../sources' paths), the way to fix it fairly quickly is:
a. Select all of the affected files. Unfortunately you have to *not* select any groups, but it's OK to select files in different groups. (This trick worked in Xcode 3 even if you selected groups, but oh well.)
b. Change the entire selection to "relative to project". Or "absolute paths" if you like.
c. Change your top level groups to refer to '../../sources' "relative to project".
d. Re-select all of the files you selected in step a.
e. Change the entire selection to "relative to group". The unwanted relative paths should now disappear from the files.
** However, if you created git repositories for the projects, then you should keep the projects in the original enclosing folders, because that's where their git repositories are. If you dump all the projects in the same folder, you'll leave behind any git repositories you created with the projects, and your only choice would be to create a single git repository for them all.
|