PageRenderTime 20ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

Unknown | 63 lines | 62 code | 1 blank | 0 comment | 0 complexity | c4e736ce14c70e3e5c1f56f57a1ba8d7 MD5 | raw file
  1. {\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf430
  2. {\fonttbl\f0\fswiss\fcharset0 ArialMT;}
  3. {\colortbl;\red255\green255\blue255;}
  4. \vieww11000\viewh18640\viewkind0
  5. \deftab720
  6. \pard\pardeftab720\ql\qnatural
  7. \f0\fs26 \cf0 (preliminary instructions from Henri Asseily, March 19, 2009)\
  8. \
  9. My goal was to build a completely universal, drag-and-drop framework\
  10. for distribution. Build it in one-click, zip it, post it on the site,\
  11. and let people download and drop in their project irrespective of what\
  12. target or build they're doing.\
  13. \
  14. That said, it is known that the iPhone does not support standard\
  15. dynamic frameworks, nor does XCode allow for creating framework\
  16. targets for an iPhone project. So this had to be a "hack" in some\
  17. respects. Given that, my strategy was not to achieve the above using\
  18. XCode best practices, since I was already breaking them before even\
  19. starting. So I elected to go the exact opposite route: the simplest,\
  20. most independent technique to achieve the goal above. No referencing\
  21. multiple other targets, no nothing. One target, one click, done.\
  22. \
  23. So it was clear that the only way to do it would be a good old shell\
  24. script target that would do everything through CLI commands. But\
  25. first, I had to put inside the project an empty skeletion of a\
  26. framework, which is called the "Canonical.framework". All it has is\
  27. the directory structure within a framework bundle. That would take\
  28. care of simulating a framework target for the iPhone.\
  29. \
  30. On to the script:\
  31. - it first cleans old output files\
  32. - it determines the version number from svn if it can\
  33. - then it untars the canonical framework into the build directory.\
  34. This will be the final resting place of the build, by default "build/\
  35. MapView.framework"\
  36. - then it calls xcodebuild to build the MapView.a static lib for every\
  37. single standard permutation of target and build: simulator+iphone, for\
  38. debug+release. That's 4 builds.\
  39. - after that, it merges the 4 libs into 2 fat libs using lipo. The\
  40. debug lib is named with a "_debug" postfix.\
  41. - and finally, it finishes "building" the framework:\
  42. \'a0 \'a0 \'a0 \'a0\'95 it copies the lib over into the framework directory\
  43. \'a0 \'a0 \'a0 \'a0\'95 it creates the correct symlinks inside the framework directory\
  44. \'a0 \'a0 \'a0 \'a0\'95 it updates the default Info.plist with the version value calculated earlier\
  45. \
  46. That's it. You now have a complete, as minimalistic as possible,\
  47. static framework that works in debug or release mode for simulator or\
  48. device, that can be simply dropped in a project and referenced with\
  49. #include <MapView/...h>\
  50. \
  51. The things to note are:\
  52. \
  53. - this target does not care what active build you've got, it builds\
  54. all 4 builds irrespectively.\
  55. - this target is independent from any other target you create, and as\
  56. such all output products from your other targets will stay red on\
  57. XCode if you haven't built them.\
  58. - this target will not use your Info.plist except for the Bundle\
  59. Version.\
  60. \
  61. Enjoy.\
  62. }