Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Edit environment variables and start project build automatically with Python
Edit environment variables and start project build automatically with Python [message #1828248] Thu, 04 June 2020 21:08 Go to next message
M Saad Sh is currently offline M Saad ShFriend
Messages: 3
Registered: June 2020
Junior Member
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 #1828253 is a reply to message #1828248] Fri, 05 June 2020 04:58 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31710
Registered: July 2009
Senior Member
Where are these environment variables stored? I.e., where specifically do you go to change them? Perhaps using Oomph you can automate the entire process of setting up a specific development environment along with a workspace containing the specific things you want.

https://wiki.eclipse.org/Eclipse_Oomph_Authoring


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Edit environment variables and start project build automatically with Python [message #1828261 is a reply to message #1828253] Fri, 05 June 2020 07:27 Go to previous messageGo to next message
Rolf Theunissen is currently offline Rolf TheunissenFriend
Messages: 181
Registered: April 2012
Senior Member
If the environment variables are not related to the IDE but to your project, i.e. specific to the build tooling of your project and check in to the repository, Oomph might not be the best fit. In that case I would suggest that you ask the question on the CDT forum [1] or look into the documentation of your build configuration.

[1] https://www.eclipse.org/forums/index.php/f/80/
Re: Edit environment variables and start project build automatically with Python [message #1828267 is a reply to message #1828261] Fri, 05 June 2020 09:03 Go to previous messageGo to next message
M Saad Sh is currently offline M Saad ShFriend
Messages: 3
Registered: June 2020
Junior Member
Sorry, I don't know the exact correct terminology but I set the environment variables from the project Properties as shown below:
https://ibb.co/F061XPc

And the project build from here:
https://ibb.co/MBRsKdV

Somehow, I was able to find the environment variables that I set in the project Properties in the following file in ".settings" folder:
https://ibb.co/wWdWYnH

But still I am not sure how should I proceed to update the environment variables and build the project with some script.
Does this topic belong here or should I ask in CDT forum as Rolf said?
Re: Edit environment variables and start project build automatically with Python [message #1828270 is a reply to message #1828267] Fri, 05 June 2020 10:40 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31710
Registered: July 2009
Senior Member
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.)

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Edit environment variables and start project build automatically with Python [message #1828347 is a reply to message #1828270] Mon, 08 June 2020 08:09 Go to previous message
M Saad Sh is currently offline M Saad ShFriend
Messages: 3
Registered: June 2020
Junior Member
I hoped that there would be a simpler solution, but the "Oomph Authoring" seems to be a lengthy process. I will look into it, thanks for your help!
Previous Topic:Large Text Files Editor
Next Topic:java.lang.IllegalStateException: Workbench has not been created yet.
Goto Forum:
  


Current Time: Mon Jan 25 07:47:34 GMT 2021

Powered by FUDForum. Page generated in 0.02242 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top