The product definition is not pulling in dependencies from the required features - eclipse-rcp

I am converting a plug-in-based RCP product to a feature-based one. I have grouped the plug-ins into 4 features and have created a traget definition containing all the required plug-ins.
When I view the dependency lists of each new feature, they look about right but when I run the product, I get a long list of Missing Constraint errors which seem to refer to plug-ins listed the Dependencies of my features.
Do I need to explicitly define these plug-ins as Included plug-ins in each feature definition? Why isn't the project definition itself loading the plug-ins automatically?

The 'Run Configuration' for your RCP in the 'Run > Run Configurations...' menu determines what is available when your run your code from within Eclipse.
On the 'Plug-ins' tab you can select 'features selected below' on the 'Launch with' combo to select your features. Use the 'Validate Plug-ins' button to check the selection.
For building (maven + tycho is strongly recommended) the features in the .product file are used.
On the 'Overview' tab of the .product editor select 'features' for 'the product configuration is based on' combo
On the 'Content' tab add your features.
Example contents configuration:
Example run configuration:

Related

External Tool Configuration build options tab in Eclipse > Luna (i.e. Mars)

I had a supercool hook set up on Eclipse to compile my project's .css theme file from its .less modules every time a .less module was modified by monitoring those resources through an "external tool configuration".
I could select which resources to monitor for triggering the nodejs less compiler tool on the launch configurations build options tab.
On eclipse Mars there is no such tab.
It really bothers me to loose this automation. Does anybody know where did that tab go or how can I keep this functionality without it?
You set up such custom builders via the project's Properties dialog. Open the properties, then select the Builders section. There you can use the New... button to configure a Program to run as a builder.

Debugging eclipse e4 source code

I have an Eclipse e4 RCP project using the compatibility layer.
The targets include org.eclipse.e4.* plug-ins and their source code. For example:
$ ls org.eclipse.e4.core.di*
org.eclipse.e4.core.di.extensions.source_0.12.0.v20140417-2033.jar
org.eclipse.e4.core.di.extensions_0.12.0.v20140417-2033.jar
org.eclipse.e4.core.di.source_1.4.0.v20140414-1837.jar
org.eclipse.e4.core.di_1.4.0.v20140414-1837.jar
The launcher configurations include the plug-ins without source code.
Source code for classes within those plug-ins is not being found with Navigate>Open Type or when debugging. In the debugger, I'm given a button Edit Source Lookup Path -- but I'd like the source path to automatically update when I switch targets.
I can make that happen by adding these plug-ins to the manifest of one of my plug-ins. However, these are not direct dependencies, and it seems inelegant to list these here.
Adding the plug-ins to the product configuration file does not appear to help.
How can I automatically access the current target's source code within the org.eclipse.e4 packages, when debugging, and when using Navigate>Open Type?
You include the target platform plugins in the Java searches (including Navigate > Open Type) by checking the
Include all plug-ins from target in Java search
check box on the Preferences > Plug-in Development preference page.
The first time after this that you use Navigate > Open Type or another search it may be a bit slow while the Java indexer runs on the extra source files. It should run normally once the indexes are built.

Eclipse RCP - Product dependencies

I am finding it difficult to see the difference between the plugins listed in the Debug Configuration's Plug-ins tab of my product launch config and the ones in my dependencies tab in the product file.
My product is based on features and it is for an RCP application.
If a launch config has been created automatically when I click on the Launch an Eclipse application in Debug mode via the Overview tab of the product file, then in the Debug Configurations Plug-ins tab I have 174 plugins selected. My RCP application runs without any warnings or errors in my Console.
Now if I deselect all the plugins in the product launch config and then click Add Required Plugins, only 70 are selected. When I now run it, I get many warnings on missing imported pacakge, bundle not resolved and missing required bundle in my development Console.
The reason I am trying to understand this, is that I am not sure why the Add Required Plugins is not adding the additional 104 plugins and I do not want a problem when I export this as a product.
The launch configuration itself is not used to decide which plugins to include in during the product export. As you say, the plugins included in the features that you have listed in the product dependency tab will comprise the built product.
When you deselect and click 'Add all required plugins' do you have the 'include optional dependecies' checkbox selected?

How can I automatically validate the dependencies in my RCP .product file?

I'm a bit new to building Eclipse RCP applications, and I'm finding it necessary to validate the list of plugins in the Dependencies tab of the .product file. But Eclipse (Indigo) offers no tools to help. In the launch configurations, there are great tools in the Plug-ins tab (buttons Add Required Plug-ins and Validate Plug-ins). It seems like there are 2 really obvious solutions that just aren't available:
Add a new button (or something) to copy the exact list of plugins from a .launch into a .product file (I tried to manually copy the text of the backing files, but the xml formats differ), or
Put the same two buttons in the Dependencies tab of the .product file.
I'm only creating one simple plugin, and the dependency list has 300 entries... very tedious to manually compare with a .launch! Am I missing something, is there actually a way to validate these dependencies directly in the .product file? Thanks for your help.
Byron
Here are two posibilities to get what you want:
Create a new product configuration
In the New Product Configuration dialog under Initialize the file content select Use a launch configuration and choose your Plug-In's launch configuration
Open the *.product file, switch to the Dependencies tab and you can see all Plug-Ins which are required to run your defining Plug-In
Edit an existing product configuration
Open the *.product file, switch to the Overview tab and select your Plug-In's launch configuration under Product Definition / Application
Switch to the Dependencies tab and add your defining Plug-In via the Add button
Select the Include optional dependencies when computing required plug-ins checkbox (which you can find at the bottom)
Hit the Add Required Plug-Ins button and you can see all Plug-Ins which are required to run your defining Plug-In

Eclipse RCP export product custom plugins not exported

I use Eclipse Product export wizard to create my application distributable image. The export want without errors, but the result contains only the eclipse.org.* plugins, none of my application plugins.
To add your own Plug-In's to the product configuration, you can do the following:
Open the *.product file and switch to the Dependencies tab
Use the Add button to add your Plug-In's
And you're done.
Optional: Hit the Add Required Plug-ins to add the Plug-ins required by your own Plug-in.