How to find list of installed Eclipse features from external program? - eclipse

I am preparing windows installer for my Eclipse plugin. I want install it into target eclipse product using P2 director. I am targetting only Eclipse 3.5 for now.
Installer should check that prerequisite features/plugins are already installed. I am not sure how to do this check. (Other reason for this check is to choose what other features to install, as I will bundle some prerequisites in the installer).
Easy solution is to look into eclipse/features/ and eclipse/plugins/ directories, but plugins may be installed elsewhere too: dropins directory and linked via links directory.
I would like to get list of installed fetures and plugins from P2 (profile?), if possible. Is there any way to do this? Any better solutions?

Have a look at the P2 agent, it does what you are after. Browse the source code to see how it interacts with the repository. You can use the p2 director to streamline the actual installation.
The Equinox Incubator also has a number of useful links

At http://wiki.eclipse.org/Equinox_p2_Getting_Started, they talk about eclipse/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info file:
The file bundles.info contains a list of all the plug-ins installed in the current system. On startup, all the plug-ins listed in this file are given to OSGi as the exact set of plug-ins to run with. Any extra plug-ins in the plugins directory or elsewhere are ignored. ... However, it's useful to know about this file so you can see exactly what is installed in the system you are running.
Well, it's not list of features, but list of plugins is good too.

Related

How can I automate installing eclipse with the same plugins and settings on multiple computers?

I want to find a way to quickly install eclipse with the same plugins and settings on several different Windows 7 computers. How could I go about doing this?
There are no easy solutions, but the process itself is clearly automateable. One solution would be the use of the p2 director application. You have to download a single director installation - one is available from the Buckminster download page, but from any Eclipse installation you can access this director application and use it to download all required software.
An alternative is the Oomph project, where you can define a model that describes what features do you want to install (among other things, such as default properties, source code to checkout), and it manages the download and installation automatically; and can also update the installation as well. One of my collegues like Oomph very much, but to tell the truth, my personal experience was that it was a bit raw (a few month ago).

Custom Eclipse packages

I would like to make an offline Eclipse installation with JDT, CDT and a few other plugins. This is what I would like to do, in decreasing preference:
Create an installation package similar to the ones available for download on the Eclipse website. Question: How can this be done? How are they created? Is there some kind of automated tool that gets the packages from p2 repositories and builds them? Is there a detailed explanation somewhere of how they are created? (I am aware of Yoxos, but that is a few versions old)
Do the installation on an internet-connected computer, and then copy the folder to another computer. Question: Can this be done? Will a simple Copy/Paste work correctly? Is there anything I can delete from the installation that will be automatically recreated?
Use an Eclipse package, say JDT, and a downloaded copy (zip file?) of the CDT and other plugins, and install them on the target machine using the standard Eclipse plugin installation from a local archive method. Question Where can I get these downloads?
The simplest approach you could use is to start from the eclipse "classic" package downloaded directly from the site, and then manually install the other components you need via update manager. You can then zip the eclipse directory and distribute it without any problem.
Otherwise you could try to use Yoxos to create your package, download and distribute it

How to install a custom plug-in in Eclipse Ganymede?

We have a custom plug-in. That is, the company where I'm working developed it in house.
I would like to install it as an available plug-in in Eclipse Ganymede. How do I do that?
From what I can figure out, the Eclipse software install only supports installation from Eclipse software update sites.
I went to Help -> Install New Software... -> Add -> Local...
to browse to a folder containing the plug-in. Although the dialog lets me add the directory as an update site, it doesn't work. It expects that directory to be a local Eclipse update site (I think). I get the error
No repository found at file:/G:/TOOLS/...
Next I just copied the plug-in into the plug-in directory under my Eclipse installation. That didn't work either. I also tried copying it into the dropins directory. No dice.
Can anyone enlighten me how to install a plug-in that's not on an "update" site?
Thanks in advance....
Usually an Eclipse plug-in packaged as zip file is install by extracting it into the Eclipse installation directory (or the plugins directory depending on how it is packaged, as it can also extract files in features directory).
Next restart Eclipse with the --clean option.
Did you check the Eclipse error log? Maybe the bundle is failing to deploy for some reason.
Otherwise, create a Feature and Update Site for your plugin as described here. An update site can either be a remote http server (SVN even), or a local directory. The nice thing is that you'll get versioning and the ability to upgrade and uninstall from inside Eclipse. It also makes things easier once your plugin grows into several plugins because they can be bundled together into a single, versioned feature.

Finding about Eclipse dependency (e.g. for red5)

According to the Red5 plugin for eclipse,
You must use the Java EE distribution of Eclipse. The standard Java distribution will not work.
But what part exacty of the Java EE distribution is needed. This way I can bring my current distribution of Eclipse to the level needed for Red5 without having to install an entirely new distribution just for Red5.
If you don't have an answer, but can point me to a way I can find it out for myself somehow what that dependency could be, that would be good enough too.
Every eclipse plugin has an (unique) identifier and a list with identifier it depends upon. If you unzip the jar file you will find a directory "META-INF" with a textfile "MANIFEST.MF". There will be an entry "Require-Bundle:" with a list of bundles (e.g. org.junit4;bundle-version="4.5.0"). This list tells you what you have to install for the plugin to work.
The id of the plugin is the entry "Bundle-SymbolicName:". With the ids on hand you should be able to determine what plugins exactly you have to install.
The installation processed described in this page is through an old pre-P2 area with eclipse3.3
(source: red5.org)
You could try the same update site, with an basic eclipse3.5.1: the P2 provisioning mechanism should list for you all the missing components.
You can then compare the missing packages with the different eclipse distros and see for yourself exactly what part if the J2EE distro you actually need for the Red5 eclipse plugin.
You mainly need the JST and WST plugins available from Eclipse themselves.

Where should Eclipse third-party plugins be stored?

We have an Eclipse RCP product, which means it depends on a number of Eclipse plugins (for the UI etc). We have set up a reference Eclipse ("target") to supply the latter.
Our product also depends on a number of third party plugins. Is there a standard location for these to be put?
We have a few of our third-party plugins in the /plugins of the target Eclipse, but this seems wrong to me. The third party plugins change more frequently than, or at least in a different timeframe to, our reference Eclipse.
I tried putting some third party plugins in a separate project in the workspace (under version control), but the PDE headless build did not seem to find them - even though I used the pluginPath property in the headless build.properties.
This is Eclipse 3.4.2. I am aware than the handling of target platforms has changed somewhat in 3.5.
Most of the comments I've seen see on the web about this seem to assume that you're writing a plugin to be added to a standard Eclipse installation. We're not, it's a completely separate product.
For my RCP applications I created a customized target platform directory for it to use (e.g. rcpapptarget). Under that directory I unzip the following packages:
eclipse-RCP-SDK-3.4.2-win32.zip
eclipse-3.4.2-delta-pack.zip
Then I add what ever other eclipse or third party plug-ins that my application will need. For example:
the latest GEF all .zip file
jay libs EclipseCallBasic_1.1.0 plug-in
derby distributed plug-in
additional eclipse plug-ins needed for help support, cheatsheets, updates etc.
I then setup a workspace for developing that RCP application and point the workspace's "Target Platform" to use that customized target platform directory. I do all my development using that target platform and my headless builds use it too.
To set the target platform choose the Window | Preferences command and then select Plug-in Development | Target Platform from the preference tree. Set the "Location" to point to the directory you created.
There isn't a standard that I know of for where 3rd part plugins should go. You can define an external extension location and store your party plugins/features there. This also allows you to reuse the plugins in multiple Eclipse installs if you wish.
You add an Extension location by going to
Ganymede onwards: Help->Software Updates->Available Software->Add Site->Local
Older versions: Help->Software Updates->Manage Configuration->Add Extension Location
For Ganymede onwards, the extension locations work a bit differently (IIRC the plugins are copied to the standard Eclipse install, which kind of defeats the point),there is however a new concept called dropins that you might find useful.