How can we run a custom command in eclipse? - eclipse

I want to run a custom command say "run mspaint.exe" from eclipse..How can i do that? I want to run more complex commands written by me but i want to run from eclipse because the resources are in my workspace generated on some program compilation..

run > external tool > external tool configurations...
for paint say,
Name: run paint
Location: C:\Windows\System32\mspaint.exe
done. you can see this menu. and execute.
Well, since paint just opened, lets get a screenshot for you :)

One can use internal DSL when defining an external tool. Instead of C:\Windows\System32\calc.exe one writes ${system_path:calc}.
Full list of supported functions:
https://help.eclipse.org/2022-09/topic/org.eclipse.platform.doc.user/concepts/concepts-exttools.htm

Related

How to run exported Parameters Variation experiment in a headless environment automatically?

I would like to run an exported Parameters Variation experiment on my Linux machine. Although there is a way for setting a Simulation experiment to start automatically running the batch file (or .sh file for Linux) once the file is opened, I cannot find a similar option for Parameters Variation in which I am running 40 different replications of the same model. In Windows, you need to open the file and manually click the Run button for this.
Considering Linux OS, which is a headless environment, how can I make the model start automatically once I run the command ./mySimulationModel_linux.sh?
Currently when I run this command, the model does nothing. Any help will be appreciated.
The best option would be to add some code to your "Initial Experiment setup:" section to get it to run without any user input
just add run();
Of course, you can add any of other code as well there.

Apama 10.3: Add pysys nature to projects

I am working with Apama 10.3, in Software AG Designer. I have a project that I'd like to add the Pysys nature to my project, but the usual attempts (right-click on project name, project > properties, etc.) don't help. I couldn't find anything in the documentation either.
How can I work with Pysys in Designer, please? I'd like to be able to build my tests via the IDE, for consistency and convenience.
Currently eclipse/Designer doesn't have a PySys nature, but what you can do is add a generic eclipse "Python" nature – which you can do using "PyDev".
And then to launch pysys from eclipse you’ll need to add a launch configuration. There are various options but the most convenient for this purpose is the “external tool” eclipse feature.
You need to invoke pysys.py with the right environment for locating python and also Apama if you want to use it with the Apama extensions. If you’re using PySys with Apama 10.3.1+ this is easy as you can use the new capability of the apama_env.bat script to execute a command e.g. ${apama_home}\bin\apama_env pysys run –n 0 –purge. If you’re on an earlier version I’m afraid you probably need to create a trivial .bat script of your own that first runs apama_env and then pysys %*
You'll want to set the working directory in the eclipse launch config go ${project_loc}/tests so it runs all tests. Or alternatively, ${selected_resource_loc}, to invoke a specific test subtree. You could create separate launch configs for both use cases.

how to include run as configurations in exported eclipse product

I am exporting eclipse rcp application using "eclipse product export wizard". I want to redirect console logs into a file.
I am doing the below, which is working fine when I run as a eclipse application. It is not reflecting after export.
The Run configurations cover how to run something, i.e. they are the part external(ish)* to your application.
In particular, the Output File and Standard Input and Output settings are ways in the Eclipse development environment to handle redirects of the application.
A quick rundown would be to run the console application like this:
$ path/to/app -application com.example.yourname > file.log
If the shell you are using is Bash, there is a long bit in the manual with further options. Powershell and cmd on windows have similar options.
Of course, if you want your program to write to a file all the time (with a possible command line argument to specify file), you probably will want to code that yourself.
* The reason I put "ish" on external is that some of the settings, like Configuration and Plug-ins are part of what you export, but Arguments, Tracing and Environment are not.

Eclipse/PyDev/GAE: How do I add command line options to my Run As->PyDev Google App Run

I am using Eclipse/PyDev to develop a Google App Engine project called GAEServer. One of my common operations is to right click on the project and select Debug As->1 PyDev: Google App Run. Which kicks of a debug session for my application.
I would like to change the command line arguments executed when this command is invoked (to relocate where GAE local server looks for its database). This requires me to add arguments to the executed command.
If I select from the main menu: Run->Debug Configurations... there is an expandable item called PyDev Google App Run which contains a list of items:
PyDev Google App Run
GAEServer GAEServer
GAEServer GAEServer (1)
GAEServer GAEServer (2)
...
At the moment I have 19 of these which is a little surprising. If I select the first one then there is a tab where you appear to be able to add arguments (x)= Arguments but if I edit this and try to debug as again, it does not invoke GAE with the additional options, instead it creates another GAEServer GAEServer (n) with the default settings.
It may be that I have set up my project in some odd way, that I'm not understanding how this is supposed to work or that I have uncovered a bug. Can anyone help me figure out which?
Thanks in advance
Jules
The run as will really create a new run configuration... Just erase the bunch of configurations you have, run it once and edit that one.
Later ( if you followed the suggestion on http://pydev.org/manual_101_run.html ), you should be able to Ctrl+F11 to rerun the last launch done (or choose it from the menu: run > run history > previous launches: can be accessed through Alt+R, T, number of config).

What is the best way to integrate an external build tool into Eclipse?

I've just started using Eclipse for Python development since we can make use of a lovely plugin I've found to enable distributed pair-programming. Anyway, the next step to getting Eclipse to integrate properly with our existing environment, would be finding a way to drive our current build tool (Waf) from within the IDE.
So the question is, is there a way I can set up Eclipse to drive Waf in a Make-like fashion? I see for Make it has some quite advanced functionality, such as being able to work out what targets are available etc. Bonus points for telling me if there is a way I could go as far as this! (I suspect the answer is that this is all built in to the Make plugin for Ecplipse).
In eclipse CDT I run waf by simply changing the build program in
ProjectPreferences->C/C++ Build->BuilderSettings
Choose External builder and then put in the path to waf
for example I use
/Users/mark/bin/waf -v -k -j2
Note that waf and make do not agree on the -j setting and you have to give i explicitly and not use the eclipse dialog.
You can use the Make targets view add the targets to call waf e.g. configure, build etc.
One issue I had is that Eclipse is hard coded to see the output from Make say Make when i changes directory so I had to patch waf
see waf issue
You could try and define a Custom builder, calling Waf with the appropriate options for the python compilation step.
(From eclipsejdt alcatel-lucent manual)
That picture (not related to Waf at all) illustrates the fact a builder can be defined as an external tool (meaning any .bat or shell you may want to call)
In that "eclipsejdt" example, the custom builder was configured like so:
To set up the builder, bring up the property dialog for project "jex1p" by selecting the project in the Package Explorer and selecting Project > Properties > Builders. Then click New..., select Program, and click OK.
Configure the builder Main tab using values:
Name : nmbldr_pre
Location : ${system_path:ksh}
Working Directory: ${build_project}
Arguments : nmbldr -p 2 -t ${build_type} -s jpre
As VonC says, the elegant way is to use a Custom builder.
Alternatively it is less work (in the short term) to hack together an ant script to do the heavy lifting and define an external builder to configure it onto the project. You may find the drawbacks of an external builder (e.g. no incremental support) mean it is worth investing the effort to do it "properly".