Xcode - exclude files in a custom configuration - better way?

前端 未结 3 756
轻奢々
轻奢々 2020-12-28 19:02

I\'m trying to come up with a way to make it easy to switch out our \"mock\" data services and our live ones. Basically, we\'ll have live servers with real web services, but

相关标签:
3条回答
  • 2020-12-28 19:22

    If you would like to add a file but do not wont to compile it. Go to (for all your targets) project>build phases>compile source and take out the file that you do not want to compile.

    0 讨论(0)
  • 2020-12-28 19:23

    See http://lists.apple.com/archives/xcode-users/2009/Jun/msg00153.html

    The trick is to define EXCLUDED_SOURCE_FILE_NAMES in the configuration you want to exclude the files from, and set the value of that custom build setting to a list of the file names (or a pattern that matches those, and only those, file names).

    0 讨论(0)
  • 2020-12-28 19:40

    I would recommend creating two targets one of which has the mock categories included and another one which does not.

    When you want to test, just build the target containing the mock categories. Everything else can remain identical.

    0 讨论(0)
提交回复
热议问题