Is it possible to select a target platform from within a run configuration? - eclipse-rcp

I'm using Eclipse RCP 2021-9 (can't update because the project is based on this specific version)
Let's say I have 2 target platforms and 2 run configurations in my RCP workspace. I'd like the run config 1 to run with TP 1 and the run config 2 to run with TP 2.
Is it possible ? If so, how would I do that ?
I looked into the run configuration dialog and couldn't find anything related to the target platform.
Thanks

To my knowledge this is not possible.
You should either create a combined Target Platform (Oomph's targlets may be of help but they have their own limitations). Or use 2 different Eclipse instances (possibly pointing at the same sources, just make sure to refresh your workspace etc. when needed).

Related

Is it possible to auto select different "gcloud" configs for different projects in multiple workspaces / folders ? Gcloud on multiple projects

From this question and this article we get that is possible to create multiple configs for the gcloud SDK.
But it seems that you have to manually switch between then, by running:
gcloud config configurations activate <CONFIG_NAME>
But is there a way for each config to be automatically selected whenever I open up a project workspace/folder on VSCode? How can I do this?
I've just tested activating a new config on a different VSCode project. That seems to update it globally. Now, all of my VSCode windows (different projects) are seeing the same activated config.
Isn't it dangerous? I mean, I could be uploading stuff to the cloud on a different project that I'm not aware of. How do people usually handle this? Do I need to run the activate command on every script before deploying something?
Unfortunately, I am not aware of such a possibility, however I have found something interesting that may help you. There is following extension:
GCP Project Switcher
The extension only allows you to change projects, however as I looked into the code it is running gcloud set config project command under the hood. You could raise a request to add the possibility to change the whole configuration to the instead of project only, as it is a very similar approach.

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.

Can 2 different Java programs running in 2 different Eclipse Workspaces, read each other?

I have one common app (Let's call CommmonApp) which needs to be up continuously for other specific (Let say one of them is - SpecificApp) app's' to run.
I need to switch between different git repositories during development and have to perform series of steps such as Clean Build and Maven Update to have the workspace in runnable/clean state and then also every time I have to start CommonApp in all those repository workspaces.
If I run CommonApp from some other repository in Eclipse 1 and run SpecificApp from another repository in Eclipse 2, SpecifcApp is not able to read CommonApp.
The medium of communication between these apps is REST APIs, so I assumed that it will work but it is not.
Is it possible or too wishful? Hope I haven't confused.

Convenient way to run eclipse plugin

I have recently started developing an Eclipse plugin (which is basic stuff for now) and I am struggling with "default" way to run Eclipse plugin ("Run as Eclipse application").
The Eclipse is starting another instance with my plugin already installed in it (this is default behaviour).
The problem is that when I want to re-run my plugin project and I press "run" button again (or Ctrl + F11) (and the another Eclipse instance still running) I get following message:
"Could not launch the application because the associated workspace is currently in use by another Eclipse application".
The error makes sense, and when I close "testing" Eclipse instance I am able to run my plugin again.
The question is - "is it normal routine for plugin development?". Maybe I am missing something, e.g. special arguments for Eclipse?
This seems all pretty normal. The error message is since the run configuration is specifing a workspace and when you start a second instance using the same workspace it is locked and considered in use.
What I usually do when testing a plugin is to create a run configuration (click "Run...") where I disable all the plugins I wont need when testing. This makes sure that the test starts up a couple of seconds quicker. Make sure you save that run configuration as a *.launch file aswell, that makes it quicker to test the next time. Or it can be used to share the configuration.
There's a lot you can configure in the run configuration, such as eclipse arguments, vm argument, if you want environment variables set, etc. So be sure to experiment a little.
In your run configuration. Main tab->Workspace Data ->Location text box add this:
${workspace_loc}/../runtime-EclipseApplication${current_date:yyyyMMdd_HHmmss}
Note the suffix ${current_date:yyyyMMdd_HHmmss} by this every time you launch your application new workspace will be created. So you will not get any error message saying workspace is locked.
But be careful as the folder .metadata will be different for different instances as their work-spaces are different. Thus preferences stored/retrieved by different instances are NOT in sync.
You are probably missing one important point: Eclipse supports the Java hot code replacement. Therefore in many cases you can modify your Java code while your application Eclipse instance is running, save the code and continue without restarting.
If hot code replacement is not possible, Eclipse will tell you, so you always know whether the editing changes are applied to the running instance.
This works best with more recent versions of the JVM, so consider upgrading to the latest Java 7 version, even if you write code to be compliant with Java 1.5 or 6.

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".