Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Recommenders/BuildingFromSource"

m (IRecommendersCompletionContextFactory already configured Exception)
(Replaced content with "See [https://git.eclipse.org/c/recommenders/org.eclipse.recommenders.git/about/ here] for a description how to build Code Recommenders from source. Category:Recommenders")
 
(26 intermediate revisions by 4 users not shown)
Line 1: Line 1:
__TOC__
+
See [https://git.eclipse.org/c/recommenders/org.eclipse.recommenders.git/about/ here] for a description how to build Code Recommenders from source.
 
+
Building Eclipse Code Recommenders from sources should be pretty easy. If some of the steps below fail - let us know.
+
 
+
= Build Prerequisites =
+
On your development machine, you should have installed/use:
+
 
+
* '''Eclipse 3.7+''':
+
** Plug-in Developer package (you need the ''plugin development environment'')
+
** Xtend 2.2+ Plug-ins (only needed when writing tests with Xtend)
+
* '''command line:'''
+
** Maven 3.0+
+
 
+
= Building with Maven Tycho  =
+
<pre>$ git clone http://git.eclipse.org/gitroot/recommenders/org.eclipse.recommenders.git
+
$ cd org.eclipse.recommenders
+
$ mvn clean install
+
</pre>
+
''mvn clean install'' automatically executes the maven builds for Eclipse 4.2 platform. If you want to build Code Recommenders for 3.7 just use
+
<pre>$ mvn clean install -P e3x
+
</pre>
+
 
+
A list of defined maven profiles you can specify with ''-P'':
+
 
+
* '''e3x''': Builds Code Recommender with Eclipse 3.x target platform. A consumable P2 update site is generated under dist/org.eclipse.recommenders.head.e37/target/repository/
+
* '''e42''': Builds Code Recommender with Eclipse 4.2 target platform. A consumable P2 update site is generated under dist/org.eclipse.recommenders.head.e42/target/repository/
+
* '''build-server''': This profile is considered to be run on the hudson.eclipse.org only. Running it locally won't work.
+
 
+
Sidenote: It's possible to specify more than one profile at the same time using a comma separated list as in "-P e3x,build-server". Note, that there is no whitespace between the profiles. Note further that e3x and e42 are mutually exclusive since they specify the build environment using target definition files.
+
 
+
= Building from Eclipse Workspace  =
+
 
+
Configuring Eclipse Code Recommenders Workspace for Eclipse is slightly more complicated:
+
 
+
On command line do:
+
<pre>$ git clone http://git.eclipse.org/gitroot/recommenders/org.eclipse.recommenders.git
+
</pre>
+
 
+
Then,
+
 
+
#Import all projects into your Eclipse workspace.
+
# Set workspace encoding to UTF-8.
+
# <font color=red>Set the workspace's target platform: </font>
+
##Go to etc/targets/
+
##Open ''''e42-devel.target'''' target definition with target platform editor.
+
##Wait until Eclipse resolved all dependencies. Check the progress view to see when resolving finished.
+
##Now click on the 'Set as target platform' link on the upper right corner of the editor.
+
#Wait until workspace is rebuild and all compile errors went away (maybe except from a few projects)
+
# In the case you see error markers on the projects saying ''Execution environment references were not checked for 'project-name' because no environment descriptions are installed.'' your Eclipse installation is missing an Execution Environment Description (EED) for Java 1.6. See [http://wiki.eclipse.org/index.php/Execution_Environments this page] how to install and use EEDs.
+
#Done. Start a new Eclipse runtime and trigger code completion on some Eclipse UI classes. The screenshot below gives a feature-based runtime configuration for Eclipse 3.7. Use that as starting point for your own configuration.
+
 
+
[[Image:Recommenders_example_runtime_configuration.png|Example Confoguration w/ Eclipse 3.7]]
+
 
+
= Troubleshooting  =
+
 
+
If anything does not work as expected, report it to http://eclipse.org/forums/eclipse.recommenders. We are glad to lend a hand to get the build working for you.
+
 
+
== "IRecommendersCompletionContextFactory already configured" when starting Recommenders in Eclipse runtime==
+
 
+
If you experience the exception below, please ensure that the project ''org.eclipse.recommenders.completion.rcp.e37'' is closed. We have two fragments that contain specific code for Eclipse 3.7 and Eclipse 4.2/3.8. Having both installed causes this exception.
+
 
+
 
+
<pre>
+
!ENTRY org.eclipse.jdt.ui 4 0 2012-05-19 17:46:07.306
+
!MESSAGE The 'Code Recommenders: Call Chain Proposal Computer' proposal computer from the 'org.eclipse.recommenders.completion.rcp.chain' plug-in did not complete normally. Unable to instantiate the extension.
+
!STACK 1
+
org.eclipse.core.runtime.CoreException: Plug-in "org.eclipse.recommenders.completion.rcp.chain" was unable to instantiate class "org.eclipse.recommenders.injection.ExtensionFactory".
+
  ...
+
Caused by: com.google.inject.CreationException: Guice creation errors:
+
 
+
1) A binding to org.eclipse.recommenders.completion.rcp.IRecommendersCompletionContextFactory was already configured at com.google.inject.assistedinject.FactoryModuleBuilder$1.configure(FactoryModuleBuilder.java:335).
+
at com.google.inject.assistedinject.FactoryModuleBuilder$1.configure(FactoryModuleBuilder.java:335)
+
...
+
 
+
</pre>
+
 
+
= Additional Notes =
+
After setting the target platform, there will be several projects projects which will still contain compile errors. '''*.fixture*''' projects contain test scenarios for code completion and don't compile "per construction". Some test and plug-in projects (e.g., codesearch.rcp, udc.rcp, and completion.rcp.templates) haven't been migrated to the latest e4.2 infrastructure yet. But you shouldn't care too much about them.
+
  
 
[[Category:Recommenders]]
 
[[Category:Recommenders]]

Latest revision as of 07:00, 6 January 2014

See here for a description how to build Code Recommenders from source.

Back to the top