Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode aggregate target dependency

I have an XCode project with 3 targets:

  1. The application
  2. An external build system target that builds my assets
  3. An aggregate target that has 1 and 2 as dependencies.

The functionality that I want is:

  1. Building the application will only build the application
  2. Building the external build system will only build the assets
  3. Building the aggregate will build the external build system first and then the application

Currently the aggregate builds both simultaneously which creates a race condition if the application gets to a certain point before the external build system completes. I can't add the build system as a dependecy for the application, because then building the application would do both. Is there a way to accomplish this without making a copy of my application target?

like image 234
Tom Sweeney Avatar asked Nov 29 '25 08:11

Tom Sweeney


1 Answers

The following works for me in a similarly arranged project.

  1. Under Build Phases -> Target Dependencies arrange the targets in the order that you want them to compile. (external build system then the application).
  2. Second, in the Edit Scheme window for the aggregate project, under Build, uncheck Parallelize Build.

Additionally, to get the application to build only the application, you may need to uncheck Find Implicit Dependencies in the application project's build scheme.

like image 51
robinspb Avatar answered Nov 30 '25 21:11

robinspb



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!