Re: relocating source files
Re: relocating source files
- Subject: Re: relocating source files
- From: James Bucanek <email@hidden>
- Date: Fri, 25 Aug 2006 07:05:03 -0700
Fred Ross-Perry wrote on Thursday, August 24, 2006:
>Xcode 2.4, OS X 10.4
>
>I have some source files arrange likey so:
>
> Some Library
> folder a
> some source files
> folder b
> some more source files
> etc...
> My Project folder
> My Project
> my source files
>
>My Project builds "my source files" and some, but not all, of
>the sources in Some Library. Fine.
>
>Now I want to move *all* of Some Library to a different
>spot on my hard drive, and change the project so it
>builds the Some Library source files I already use,
>from their new location.
>
>It's not obvious to me how that's done.
1. Move the file to the new location.
2. Update the source file references in your project to match.
You've illustrated your actual file structure, but you didn't mention how those files and folders are referenced in your project. Moving the files will entails changing the file and folder references in your project to match the new location.
Each source item (source group and source file) in your project has a reference to the real item it refers to. Each reference has a path and a reference type. These can be examined and editing the Inspector window/palette for the item.
Typically, source file references are "enclosing folder" references. This means that the reference is relative to the location of its enclosing source group. If you change the reference of the group, it changes the references for all its descendents.
Since your "Some Library" is outside your project folder, you have at least one source group reference that points to the directory outsider of your project. If all of the items and groups contained in the top-level source group are "enclosing group" relative, you only have to redefine the location of the top-level group. If all of your references use a reference type that is independent of the enclosing group, then you'll have to change them all. Or, better yet, change them all to enclosing group relative then fix up the top-level source group.
If you do this in more than one project I would also suggest that you look into source trees. Source trees are a way of creating a symbolic name for a location such as "Some Library". All of your source groups, files, and projects can use a source tree relative reference. If the library ever moves, you only need to redefine the source tree and every group, file, and project that references it gets redefined automatically.
James Bucanek
____________________________________________________________________
Author of Beginning Xcode ISBN: 047175479X
<http://www.beginningxcode.com/>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden