Re: copy 'Run script build phase' to another project
Re: copy 'Run script build phase' to another project
- Subject: Re: copy 'Run script build phase' to another project
- From: Andreas Grosam <email@hidden>
- Date: Thu, 18 Feb 2010 19:12:58 +0100
On Feb 17, 2010, at 9:19 PM, appledev wrote:
> Hi,
>
> Is it possible to copy f.e a run script build phase from one target to another target?
As far as I know, no. But you can create a separate script file with the Run Script's contents. Add the script file to your Xcode project, and start the script in a Run Script Phase's panel as follows:
my_path_to_script/CopyHeadersRunScript.rb
(this is the "Script" field - the large field)
Furthermore, ensure the field "Shell" contains "/bin/sh"
You can create as many Run Script Phases as you like, and add them to targets.
The line "my_path_to_script/CopyHeadersRunScript.rb" above is a tiny sh script which starts a Ruby script which is located in the specified folder "my_path_to_script". The folder is usually located in your project. In a sh script the folder where the Xcode project resides can be accessed via $(SRCROOT). So you could write:
$(SRCROOT)/BuildScripts/CopyHeadersRunScript.rb or
BuildScripts/CopyHeadersRunScript.rb
since $(SRCROOT) is the working directory. Of course, the folder BuildScripts and the script CopyHeadersRunScript.rb must exist.
To create a separate script file, copy the contents of the original Run Script Phase to a new file, or create one from scratch. The script file shall have the usual extensions, eg. for a sh script it is .sh, for Perl it is .pl for Python it is .py and so on, and it should be executable and it should contain the shebang at the very start.
To make a text file a executable, in the Terminal console set the chmod once:
chmod +x my_path_to_script/CopyHeadersRunScript.rb
>
> Is it possible to copy f.e a run script build phase from one project to another project?
dito. :)
Regards
Andreas
>
> Thank you _______________________________________________
> 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
_______________________________________________
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