Search code examples
xcodexcode4buildworkspace

Xcode 4 workspace and scheme's pre-action


I have a very simple Xcode 4 workspace:

  • A simple app : Foo.app
  • A library : Bar.a

As you can imagine Foo.app uses Bar.a, nothing weird here. When I build Foo.app it automatically builds Bar.a and that's exactly what I want! But... Because there's always a but... In the build phase of the Bar.a scheme, I have a pre-action script.

If I build Bar.a the script is executed, but if I build Foo.app, Xcode builds automatically Bar.a without executing the pre-action script!!!

How can I tell my Xcode friend to execute that script, even when I build Foo.app?


Solution

  • After having tried @joshua's manual declaration of dependency, the only, yet unsatisfying, workaround I found is to add the same script as pre-action of the build of Foo.app.