Defining Path Variables in Build Scripts

Hello,

How can I define a Path Variable (i.e Settings->Build, Execution, Deployment->Path Variables) inside a Build Script so that when the project is distributed and the standalone ide is started the Path Variables are inserted automatically?

Thanks
0
2 comments
Avatar
Permanently deleted user
I looked into this and came to the conclusion that path variables can't be set from MPS except from the mentioned dialog (IntelliJ specific feature). You can however read them. Just type in the console:
foreach userName in PathMacros.getInstance().getUserNames() { 
  #print userName + ":" + PathMacros.getInstance().getValue(userName); 
}
0
Avatar
Permanently deleted user
Thank you for your answer. I think I need to find another solution for this issue then.

By the way, in case someone needs it, there is also another method of reading the path of a path-variable if you provide the specific name of the variable:
string path = MacrosFactory.getGlobal().expandPath("${name_of_the_variable}");

Note: MacrosFactory is in MPS.Core -> jetbrains.mps.util
0

Please sign in to leave a comment.