Running Bash Script in Xcode compilation - where to get a list of built-in variables?

When using Xcode to compile a Cocoa application, I run a custom Bash script in the build phase. Unfortunately, I have to describe the full paths. Instead, I'm pretty sure that there are variables that I can use in Bash, and one of them can cover it. Here is what I run:

/Users/mike/Projects/objectivec/proj1/proj1/shellscript.sh  /Users/mike/Projects/objectivec/proj1/proj1/proj1/lang/en/html/

See how $ VAR will help here, and not determine physical paths? It will also help my team members compile this project unchanged.

I tried searching in XCode7 docs but couldn't find anywhere where these variables could be used.

Please note that in this case, the path / Users / mike / Projects / objectivec / proj1 / proj1 / folder contains the AppDelegate.mm file if this helps you.

Can you tell me where I can find the documentation in this list of available variables, so I don’t need to specify the full physical paths?

+1
source share
1 answer

The fix was that I ran this Bash script as a test:

#!/bin/bash

set > /tmp/vars.txt

Then I compiled the assembly. After that, I looked through /tmp/vars.txt to find out what is available for use. From there, I could use them directly both in my regular Bash script and in the black script field inside Xcode, for example $SOURCE_ROOT.

+3
source

Source: https://habr.com/ru/post/1653273/


All Articles