Re: Setting xcodeproj-relative working directory
Re: Setting xcodeproj-relative working directory
- Subject: Re: Setting xcodeproj-relative working directory
- From: Damian Carrillo <email@hidden>
- Date: Sun, 16 Dec 2012 15:29:04 -0600
I do something similar to what you are trying to achieve with a command line program that I wrote. I have two targets in my project. One is an iOS app and the other is the aforementioned command line program. My command line program will take the previous initial sqlite database from the iOS app's project directory, copy it into a temporary directory, update the data in the database, and then overwrite the previous initial database for the iOS app if there are no failures. It does this by referencing the items relative to the project directory.
When I set up the scheme for my command line program (named DBTool), I supply the following arguments on launch:
* ${PROJECT_DIR}/DBTool/CreateSchema.sql
* ${PROJECT_DIR}/Draught/InitialDatabase.sqlite
* ...
In order to list the environment variables like PROJECT_DIR above, I add a run script build phase and tick the box with the label of "Show environment variables in build log". Then, the next time I build, I inspect the build log in the log navigator for the line with the shell script I just added. If you select the line for the shell script a little oval with 5 horizontal lines will appear to the far right of the log navigator. Clicking it will reveal a list of all the environment variables that Xcode introduces.
There is also a document that lists and describes the environment variables at https://developer.apple.com/library/mac/#documentation/DeveloperTools/Reference/XcodeBuildSettingRef/0-Introduction/introduction.html .
Hope this helps,
Damian
On Dec 15, 2012, at 9:30 PM, Tom Seddon wrote:
> Is it possible to set an xcodeproj-relative working directory in a scheme? The goal is just to have the program able to get access some test data using relative paths, without requiring each programmer to set up a working folder in the shared scheme.
>
> I also tried adding a Copy Files build phase, to get the data into the build products folder. But a Copy Files build phase can't copy folders, it seems. (Well, I suppose it is called Copy *Files*.) The program is a command-line program, so there's no bundle for Copy Bundle Files to work with.
>
> Solutions or alternative suggestions sought!
>
> Thanks,
>
> --Tom
>
>
> _______________________________________________
> 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