Edit environment variables and start project build automatically with Python [message #1828248] |
Thu, 04 June 2020 17:08  |
Eclipse User |
|
|
|
I have a C++ Eclipse project.
With an every new software cycle at my organization, I need to update the environment variables and build the project.
E.g. change SW_Path from "C:/Installation/2019B" to "C:/Installation/2020A" and then build the project.
Till now I have done this manually, but now the requirement is to automate the entire process. I couldn't find relevant resources about the topic. Searching for Eclipse API showed the results only for Java.
Any tips how can I simply update the environment variables and build the project automatically with Python (or maybe even using a batch file)? Without having any manual involvement.
Thanks in advance.
|
|
|
|
|
|
Re: Edit environment variables and start project build automatically with Python [message #1828270 is a reply to message #1828267] |
Fri, 05 June 2020 06:40   |
Eclipse User |
|
|
|
Note that when you edit the variable, you can enter a value or you can use the "Variables" button. There are lots of variables you can use, but most significantly, if you go to Window -> Preferences -> Run/Debug -> String Substitutions you can define variables here, i.e., a mapping from name, e.g., my.example.variable , to value, e.g., C:\Something-really-important. Then in the other dialog where you edit the environment variable, you can find "my.example.value" in the list of variable choices and can use ${my.example.value} as the value. This then decouples the information stored in the project from the configurable value it should have. (And, for what it's worth, Oomph lets you define String Substitution Tasks for setting up such values automatically.)
|
|
|
|
Powered by
FUDForum. Page generated in 0.03712 seconds