Retrieving Path Variable Values

MPS let you define Path Variables under Preferences. Path variables can be used to avoid absolute paths. We would like to resolve the value of a path variable in one of our project programmatically from within an MPS behavior. Could anybody recommend a place to look where this is done in the MPS platform?

For instance, if I defined a.b under Preferences->Path Variables a.b=/a/B, how do I retrieve /a/b using the a.b key?

I know the build system resolves Path Variables values, but I have been unable to track down exactly where this is done. Thanks, Fabien
4 comments
PathMacros.getInstance().getValue("a.b")
prettyPrint();
or

MacrosFactory.getGlobal().expandPath("${a.b}")
prettyPrint();
1
Thanks Sascha. Exactly what we were looking for. Works great. Fabien
0
Hi,

MacrosFactory.getGlobal().expandPath("${a.b}") gives correct value inside MPS but gives  just "{a.b}" while running my test from terminal using ant.

Can someone help me regarding this?

Thanks in advance.
0

@Dinesh

Sorry for pushing this old thread.

I have the same problem. How did you manage to fix this?

0

Please sign in to leave a comment.