Skip to content

How environment variables are set

jantje edited this page May 15, 2020 · 3 revisions

Sloeber uses environment variables to link the arduino framework to feed CDT build information. When working around or fixing problems related to environment variables it is important to understand which environment variables are used when.

There are 2 levels that need to be understood

  1. The hierarchy of environment variables in CDT/eclipse
  2. the parsing of files setting the environment variables.

The description is based on the fact that environment variables are overwritten. This way things that are coming later are overwriting previous variables. As such the last one is the only one remaining.

The hierarchy of environment variables in CDT/eclipse

  1. System level environment variables (preferences->c/C++->Build->Environment)
  2. Project level environment variable (project properties->C/C++build->Environment)
  3. Project level build variables (project properties->C/C++build->Build variables)

Since 4.3.3 Sloeber sets all boards manager installed tools in the system level environment variables.
Boards.txt, platform.txt and other arduino IDE defined things are put in the project level environment variables.
This means that putting things in the build variables allows you to overwrite any environment you like.

the parsing of files setting the environment variables.

  1. the defaults.
  2. the pre processing boards and platforms https://github.com/Sloeber/arduino-eclipse-plugin/tree/master/io.sloeber.core/config
  3. the boards.txt and platform.txt
  4. the json tools from referenced and referencing platforms
  5. the post processing boards and platforms.txt https://github.com/Sloeber/arduino-eclipse-plugin/tree/master/io.sloeber.core/config
  6. stuff to make things work in CDT