Re: Questions about target build settings
Re: Questions about target build settings
- Subject: Re: Questions about target build settings
- From: Romain Brestac <email@hidden>
- Date: Mon, 19 Jan 2004 14:58:01 +0100
Hi JOAR,
Aujourd'hui, JOAR a proclami:
Feature request 1)
Build settings can be defined in other places in addition to a
targetfor example, you can define a build setting in a build style.
This flexibility lets you change build settings quickly without
having to create a new target.
This implies that the build settings set in a build style should be
ones that you would like to be able to toggle for the targets in your
project. We use build styles like this, but we also use it to set
default values for our targets, something it's not really suited to do
as it overrides target settings, and as they apply to all targets.
This has been requested in the past, but I would just like to chime in:
It would be extremely useful to have "target groups" where you could
set default build settings for a group of targets. You would then only
have to set target specific build settings in the target itself. Our
project have about 150 targets, it takes a lot of time to keep them
"synchronized" as we:
- Can't edit more than one target at a time, even for shared build
settings
- Have to set build settings individually on a per target basis.
Here is a little Applescript I made for this purpose. It replaces
customized build settings of given targets with a model target's
settings.
It is quite simple and limited because it applies only to customized
settings, and not as easy to use as a potential embedded feature would
be, but it could help...
The script does the following:
1/ Get the value VALUE of build setting "TARGET_MODEL_NAME" of the
current target TARGET in the current project and...
2/ Set customized builds settings of every target of the project whose
build setting "TARGET_MODEL" is VALUE to customized build settings of
TARGET.
You just need to make a new build setting "TARGET_MODEL_NAME" with an
arbitrary value for your master target and create a build setting
"TARGET_MODEL" for each of your slave targets with the same value.
[Script]
(* Applies only to settings from the group customized settings in the
info inspector*)
property TARGET_MODEL_NAME : "TARGET_MODEL_NAME"
property TARGET_MODEL : "TARGET_MODEL"
property DisplayWarning : true
tell application "Xcode"
tell current project
set ModelBuildSettings to get (build settings of current target)
set TargetModelVisibleName to name of current target
try
set ModelName to value for key TARGET_MODEL_NAME of (build settings
of current target)
log ModelName & "Do not remove. A bug in xcode scripting returns
nothing when the key does not exist"
on error
display dialog "The current target " & TargetModelVisibleName & " is
not a Model Target" & return & "Create a PRODUCT_MODEL_NAME build
setting first"
return
end try
set CountProcessed to 0
repeat with aTarget in targets
try
if (value for key TARGET_MODEL of (build settings of aTarget)) is
ModelName then
log "replacing ..."
activate
if DisplayWarning then display dialog "Are you sure you want to
replace builds settings of Target '" & (name of aTarget) & "' with
those from Target model '" & TargetModelVisibleName & "' ?" with icon 0
set (build settings of aTarget) to ModelBuildSettings
(* Replace with your custom routine , see bellow*)
set CountProcessed to CountProcessed + 1
end if
end try
end repeat
activate
display dialog "" & CountProcessed & " targets processed" with icon 1
end tell
end tell
(* Custom routines if you need a different behavior - To be completed *)
on update from buildSettingOLD to buildSettingNEW
"Replace existing settings, do not add non existing settings"
return FinalSettings
end update
on append from buildSettingOLD to buildSettingNEW
"Add non existing settings, do not replace existing settings"
return FinalSettings
end append
[/Script]
If you modify and improve this script, please share it.
Regards,
Romain.
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.