Re: building with different assets/strings
Re: building with different assets/strings
- Subject: Re: building with different assets/strings
- From: Bernie Maier <email@hidden>
- Date: Thu, 13 Apr 2017 22:00:19 +1100
I have a project that I want to create two different products from.
The only thing that changes with the build are the strings files and the
xcassets catalog.
I guess I could make it two different "Targets" but that means I need to
keep "Copy Bundle Resources" manually in sync.
There are probably a few different ways of doing this, but since you say you
have two different *products* that does strongly imply two targets as being
the best way to model this. Is it that bad keeping things in sync for two
closely related targets?
The reason I ask is that one of the sets of projects I work on happens to be
audio plugins, and the ones I work on come in two flavours: Audio Units and
VST. I handle these via separate targets, and don't have too much trouble
keeping things in sync. The AU has just a few extra files over the VST, and
while I have slipped up occasionally in the past, usually the error becomes
obvious quite rapidly.
One thing though is that I am comfortable with adding custom build phases and
am not so wedded on having Xcode's default "Copy Bundle Resources" do
everything resource-related. So one of my extra build phases does some
target-specific resource copying, and that's a good point to take advantage of
not only Xcode's standard target and configuration build variables but any of
your own extra build variables you define (preferably in an xcconfig file, in
my opinion).
Could anyone think of a better way of doing this?
One alternative (I don't really think it's better, but still...) could be if
you can split the build into a shared "core" that is built via one target,
then define separate targets for each product, each of which depend on the
core target and simply exist to add the product-specific resources to the
core. But I can imagine code signing could get tricky in this scenario.
And yet another way might be to have one target and multiple build
configurations, and define separate schemes for each build configuration. But
again you will likely need a custom build phase to easily grab the
configuration-specific resources, in which case I think you might as well be
doing things more obviously with targets.
Maybe with some xconfig magic? Or with a variable in the path to the
resources somehow - Xcode seems to let me only pick the file.
Well certainly xcconfig magic can help, especially with custom build phases.
But I don't think they will necessarily help with Xcode's pre-canned build
phases. In any case, you would tend to apply each xcconfig file to a specific
target, so we are back to targets again.
Cheers,
Bernie
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden