#!/usr/bin/perl
sub
print_help();
if
(
scalar
@ARGV
) {
my
@parameters
;
my
@args
=
map
{
$_
}
@ARGV
;
my
$args
= \
@args
;
my
$index
= 0;
my
$file_path
;
foreach
(
@ARGV
) {
$index
++;
if
(
$_
=~ /^-target/) {
my
$target
=
$args
[
$index
];
push
@parameters
,
$target
;
next
;
}
if
(
$_
=~ /^-configuration/) {
my
$config
=
$args
[
$index
];
push
@parameters
,
$config
;
next
;
}
if
(
$_
=~ /=/) {
push
@parameters
,
$_
;
}
if
(
$_
=~ m/project.pbxproj$/) {
$file_path
=
$_
;
next
;
}
}
my
$project
= Xcode::Project->new(
$file_path
);
$project
->set_buildSettings_with_keyValue(
@parameters
);
$project
->save();
exit
;
}
else
{
print_help();
exit
;
}
sub
print_help() {
print
<<EOF
-target :specify the need be edited target.
-configuration :specify the need be edited configuration, that must need be specify target
EOF
}