Path variables

Last modified: 15 August 2022

Path variables are placeholders that stand for paths to resources linked to your project. They provide sharing flexibility as you do not have to reference a fixed location on your computer.

Path variables are useful if, for example, you have a third-party library defined at the project or module level, and it is stored outside the project directory or module content roots (for projects shared through VCS). Such a library is referenced by its absolute path and there is no guarantee that this path is the same on computers of your teammates. If you use a path variable, you make the path relative as each variable is configured on each computer individually.

In AppCode, there are some pre-defined variables:

  • $USER_HOME$: stands for your home directory.

  • $PROJECT_DIR$: stands for the directory where your project is stored.

  • $MODULE_DIR$: stands for the directory that keeps module configuration files IML.

To configure path variables, in the Preferences dialog ⌃ ⌥ S, select Appearance & Behavior | Path Variables.