Re: Replacing build rule with copy bundle resource
Re: Replacing build rule with copy bundle resource
- Subject: Re: Replacing build rule with copy bundle resource
- From: Jean-Denis MUYS <email@hidden>
- Date: Wed, 21 Dec 2011 14:45:34 +0000
- Thread-topic: Replacing build rule with copy bundle resource
It seems to me MacRuby is doing something very similar to what you describe. You can develop Mac apps in Ruby. The Ruby code ends up in the app bundle. I suggest you go to macruby.org, build a template app or a sample, and see how the .rb files are handled at build time.
You may also be interested in an extension to that mechanism whereby you can edit the Ruby source from within Xcode, and reload the changed Ruby in the app without rebuilding it, not even without quitting it. This enables hot fixing of bugs at runtime, at least in a number of cases.
If you want to look at that, you can download the MacRubyReload sample project at http://github.com/jdmuys/MacRubyReload
Jean-Denis
On 21 déc. 2011, at 15:33, Aaron Burghardt wrote:
> Two suggestions:
>
> 1. If the list of files is easy to distinguish and manage, then Create a Run Script phase and write a script to copy the files.
>
> 2. If the files are never compiled and only to be included in your app bundle, rename the files with a custom extension and create a build rule script that copies and renames the file either to the derived outputs directory or directly into the app bundle. The script will have all of the normal Xcode build settings via it's environment that a Run Script phase has. Where ever you put them, make sure it matches the Output Files section of the build rule. A good way to ensure that is use the variable SCRIPT_OUTPUT_FILE_0, which is the expanded version of the first file in the Output Files. The input file is SCRIPT_INPUT_FILE and/or INPUT_FILE_*. To have the output file reflect the input filename, specify the output folder similar to this: "$(DERIVED_FILES_DIR)/$(INPUT_FILE_BASE).processed_ext" (without the quotes).
>
> A couple notes on specifying input and output files to build rules and Run Script phases:
>
> * Refer to variables as $VARIABLE or ${VARIABLE} in the script, but as $(VARIABLE) in the inputs and outputs sections.
>
> * Don't quote paths in the inputs and outputs section. Xcode will pass the quotes as part of the path.
>
> * To see a list of the environment variables, check the box in a Run Script phase or include a printenv in a build rule.
>
>
>> On 2011-12-18, at 3:56 PM, Fritz Anderson wrote:
>>
>>> No need for a special rule. Remove the .cl files from the Compile Sources build phase and add them to the Copy Bundle Resources phase.
>>
>> Yes, I had done that already. It makes no difference. I also tried re-ordering the build phases, to no effect.
>
> I'm not sure if it's documented as the designed behavior, but I will confirm that my build rules get invoked for both Compile and Copy Files phases.
>
> Aaron
>
>
> On Dec 18, 2011, at 4:49 PM, Andrew Brownsword wrote:
>
>> I'm trying to get xcode 4 to simply copy my *.cl files into the application bundle, however it compiles them first and copies the outputs of the compile. I haven't been able to disable this rule, nor figure out how to create a replacement rule that will do this for me -- the documentation on how to write scripts for build rules, specify the output files, etc is abysmal and bordering on non-existant. The couple of books I have on xcode 4 similarly fail to illuminate.
>>
>> Sorry if this has been covered in the archive -- search doesn't seem to work on this mailing list's archives. Advice on any of these topics would be appreciated, thanks.
>>
>>
>> _______________________________________________
>> 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
_______________________________________________
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