Dependencies vs. Perforce + .nib and .xcdatamodel files
Dependencies vs. Perforce + .nib and .xcdatamodel files
- Subject: Dependencies vs. Perforce + .nib and .xcdatamodel files
- From: Jim Correia <email@hidden>
- Date: Fri, 8 Jul 2005 09:26:05 -0400
How does Xcode compute dependency information for bundle resources?
We use Perforce for revision control. It appeared that in the past
(1.5?) Xcode would copy the .nib packages into the bundle of the
modification date of the .nib directory was newer than the
modification date of the .nib in the build product. Perforce doesn't
version directories, and doesn't touch them on p4 sync, so this posed
a problem.
The hack/solution at the time was a dependent target which ran a
script that touched all the relevant directories in the build
product, and the nibs would be recopied at build time (sometimes
unnecessarily, but that was an acceptable trade off.)
That doesn't appear to work anymore with Xcode 2.1. (The files in the
bundle get touched backwards in time, but they aren't recopied when
the master target is built; the .xcdatamodel file isn't recompiled.)
Has anyone else solved this particular problem? How do I coax the
build system into rebuilding/copying the new files after a sync?
For reference, here is the script:
#!/usr/bin/env python
import os
import sys
import time
DEBUG = True
PACKAGE_EXTENSIONS = ['.nib']
FILE_EXTENSIONS = ['.mom']
def process_entries(root, entries, extensions):
for name in entries:
(basename, ext) = os.path.splitext(name)
if ext in extensions:
resource_path = os.path.join(root, name)
if DEBUG:
print "Touching: %s" % (resource_path)
os.utime(resource_path, (0, 0))
def main():
package_name = sys.argv[1]
build_dir = os.environ['BUILT_PRODUCTS_DIR']
product_dir = os.path.join(build_dir, package_name)
if os.path.exists(product_dir):
for root, dirs, files in os.walk(product_dir, topdown=False):
process_entries(root, dirs, PACKAGE_EXTENSIONS)
process_entries(root, files, FILE_EXTENSIONS)
if __name__ == "__main__":
main()
Thanks,
Jim
_______________________________________________
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