Hi guys. I am wondering if I can set my own variable in build system? like:
ip:192.168.2.12,
then I can use this variable in the next steps.
Or I have to set it as environment variable? I feel that way sort of contaminated my system environment.
Hi guys. I am wondering if I can set my own variable in build system? like:
ip:192.168.2.12,
then I can use this variable in the next steps.
Or I have to set it as environment variable? I feel that way sort of contaminated my system environment.
You can either create environment variables in the build system via "env": { "MYVAR": "foobar" }
or write you own target command, which gets all non special fields as keyword arguments, and call exec
from there.
PS. Environment variables are only set for the build system process and not global.
You can script your build command in some scripting language such as perl or bash to avoid such issues.
Just to add to what’s already been said, this is an example of writing your own custom target
command to add your own variables to build systems. if you want to go that route.