3

I am new in Xcode. From the "Targets" in Xcode, I could see that there is a Tab called "Build Rules".

I wonder what is this tab does?

Thanks

user454083
  • 1,337
  • 3
  • 16
  • 31

2 Answers2

4

To my understanding under the Tab 'Build rules' you can automate any behaviour you would like the compiler to do when compiling a file. Xcode has standard rules when compiling, with Build Rules you can add a rule to that.

Personally I am quite new to Xcode as well and didn't know about build rules too. I found this information that helped me understand it better, maybe that is any help to you. If anyone with more experience with Xcode has a better answer, please correct me as I'm still learning Xcode too.

B_s
  • 3,026
  • 5
  • 32
  • 51
2

You can use "build rules" to say: hey XCode, with files matching pattern (your pattern), do the following: (your instructions)

For example, you can use that to specify that all Ruby files ('*.rb') that happened in your source (don't ask how) should be executed during build process.

Kirill Gamazkov
  • 3,277
  • 1
  • 18
  • 22
  • I understand your example, but I don't understand what that would mean for my build. Does it run first or after? How does it effect my build? – Michael Ozeryansky Feb 01 '20 at 03:49
  • It would run before it is needed. The exact build order is not deterministic. Rules define input and output files. When other tasks need some output generated by a rule xcode makes sure that it is run first. Forget XCode and learn about the good old "make". tool first. It principles are still at the heart of all build system. – Lothar May 20 '22 at 15:36