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 "RCPTT/Contribution Guide"

(Eclipse PDE)
(13 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 
=Prerequisites=
 
=Prerequisites=
* Oracle JDK 1.7
+
* Oracle JDK 1.8
  
 
=Source=
 
=Source=
 
<pre>git clone git://git.eclipse.org/gitroot/rcptt/org.eclipse.rcptt</pre>
 
<pre>git clone git://git.eclipse.org/gitroot/rcptt/org.eclipse.rcptt</pre>
 
See also https://git.eclipse.org/c/rcptt/org.eclipse.rcptt.git/
 
See also https://git.eclipse.org/c/rcptt/org.eclipse.rcptt.git/
To work with Mars compatible source, checkout "mars" branch.
 
  
 
==Git configuration==
 
==Git configuration==
Line 12: Line 11:
 
<pre>
 
<pre>
 
$ git config --global user.name "<Your Full Name here>"
 
$ git config --global user.name "<Your Full Name here>"
$ git config --global user.email "<username>@xored.com"
+
$ git config --global user.email "<username@example.com>"
 
   
 
   
 
$ git config --global core.autocrlf true    # on Windows, or
 
$ git config --global core.autocrlf true    # on Windows, or
Line 25: Line 24:
  
 
==Eclipse PDE==
 
==Eclipse PDE==
Install Eclipse Luna/Mars IDE for Eclipse Committers form https://www.eclipse.org/downloads/
+
Install Eclipse IDE for Eclipse Committers form https://www.eclipse.org/downloads/
  
Install features from repos. Use .p2f files to Import -> Install -> Install Software Items from File.
+
Set "Window/Preferences/Java/Compiler/Compiler compliance level" equal to 1.7 or higher.
There are /'''preferencies/LunaSoftwareItems.p2f''' and '''/preferencies/MarsSoftwareItems.p2f''' in rcptt repo. Choose one depending on your Eclipse Version.
+
  
Set "Window/Preferences/Java/Compiler/Compiler compliance level" > 1.6.
+
Install Eclipse features from repositories:
 +
* AspectJ Development Tools (AJDT): https://download.eclipse.org/tools/ajdt/48/dev/update/
 +
* EMF - Eclipse Modeling Framework SDK: from main Eclipse repository, such as http://download.eclipse.org/releases/2019-06/
  
 
== Importing projects ==
 
== Importing projects ==
Line 54: Line 54:
 
# set Window/Preferences/General/Workspace/Line delimiter to Unix
 
# set Window/Preferences/General/Workspace/Line delimiter to Unix
  
==Target platform==
+
==Target Platform==
Use [[PDE/Target_Definitions|target definition]] from [https://git.eclipse.org/c/rcptt/org.eclipse.rcptt.git/tree/releng/target-platforms build/org.eclipse.rcptt.targets]
+
To apply a target platform:
 +
# open 'photon/ide.target' file from '''org.eclipse.rcptt.targets''' project
 +
# click on '''Set as Active Target Platform''' link
  
 
=Launching from Eclipse=
 
=Launching from Eclipse=
Line 62: Line 64:
  
 
==Launching issues==
 
==Launching issues==
If you have error "java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-bit JVM"
 
 
 
Sometimes, when product is not used to create launch configuration or due to target platform updates, selected plug-ins are lost from launch configuration. When you restore them, take a note that following plug-ins are required (by RCPTT launchers) but are not covered by direct dependencies:
 
Sometimes, when product is not used to create launch configuration or due to target platform updates, selected plug-ins are lost from launch configuration. When you restore them, take a note that following plug-ins are required (by RCPTT launchers) but are not covered by direct dependencies:
  
 
     org.eclipse.equinox.p2.touchpoint.natives
 
     org.eclipse.equinox.p2.touchpoint.natives
    org.eclipse.equinox.ds
 
 
     org.eclipse.equinox.p2.transport.ecf
 
     org.eclipse.equinox.p2.transport.ecf
 
     org.aspectj.weaver
 
     org.aspectj.weaver
Line 80: Line 79:
 
<pre>-Xms128m -Xmx768m -XX:PermSize=128M -XX:MaxPermSize=192M -DteslaPort=7926 -DeclPort=5378 -Dosgi.framework.extensions=org.eclipse.equinox.weaving.hook</pre>
 
<pre>-Xms128m -Xmx768m -XX:PermSize=128M -XX:MaxPermSize=192M -DteslaPort=7926 -DeclPort=5378 -Dosgi.framework.extensions=org.eclipse.equinox.weaving.hook</pre>
 
* Add the following plugins:
 
* Add the following plugins:
**  org.eclipse.rcptt.ecl.platform plugin,
+
**  'org.eclipse.rcptt.ecl.platform' plugin,
 
**    working set 'runtime' of RCPTT repo,
 
**    working set 'runtime' of RCPTT repo,
**    all plugins containing 'aspectj' from the target platform tree. Note that required plugin org.aspectj.weaver is not added automatically by dependency,
+
**    all plugins containing 'aspectj' from the target platform tree. Note that required plugin 'org.aspectj.weaver' is not added automatically by dependency,
 
**    remove all plugins containing 'mylyn'.
 
**    remove all plugins containing 'mylyn'.
 
** click 'Add required plug-ins' button.
 
** click 'Add required plug-ins' button.
** set Auto-start to true for the org.eclipse.equinox.weaving.aspectj plugin
+
** set Auto-start to true for the 'org.eclipse.equinox.weaving.aspectj' plugin
  
 
If RCPTT AUT start, you should return to RCPTT and import existing project into workspace of RCPTT, choose  rcptt/rcpttTests. Then click on rcpttTests > Run as > Run configurations > Remote application under tests > new:
 
If RCPTT AUT start, you should return to RCPTT and import existing project into workspace of RCPTT, choose  rcptt/rcpttTests. Then click on rcpttTests > Run as > Run configurations > Remote application under tests > new:
Line 118: Line 117:
 
# Create ssh keys and upload public key to Gerrit [https://git.eclipse.org/r/#/settings/ssh-keys here]
 
# Create ssh keys and upload public key to Gerrit [https://git.eclipse.org/r/#/settings/ssh-keys here]
 
# Add remote "gerrit" <nowiki>ssh://&lt;username&gt;@git.eclipse.org:29418/rcptt/org.eclipse.rcptt</nowiki>
 
# Add remote "gerrit" <nowiki>ssh://&lt;username&gt;@git.eclipse.org:29418/rcptt/org.eclipse.rcptt</nowiki>
 +
<pre>
 +
git remote add gerrit <nowiki>ssh://&lt;username&gt;@git.eclipse.org:29418/rcptt/org.eclipse.rcptt</nowiki>
 +
</pre>
 +
  
 
== Creating the review ==
 
== Creating the review ==
Line 134: Line 137:
  
 
Once you've uploaded the change, observe it being built at [https://hudson.eclipse.org/rcptt/job/rcptt-all-gerrit/ RCPTT HIPP instance]
 
Once you've uploaded the change, observe it being built at [https://hudson.eclipse.org/rcptt/job/rcptt-all-gerrit/ RCPTT HIPP instance]
 +
 +
[[Category:RCPTT]]

Revision as of 01:00, 15 January 2020

Prerequisites

  • Oracle JDK 1.8

Source

git clone git://git.eclipse.org/gitroot/rcptt/org.eclipse.rcptt

See also https://git.eclipse.org/c/rcptt/org.eclipse.rcptt.git/

Git configuration

Use these commands in your Git Bash / Terminal window:

$ git config --global user.name "<Your Full Name here>"
$ git config --global user.email "<username@example.com>"
 
$ git config --global core.autocrlf true    # on Windows, or
$ git config --global core.autocrlf input   # on Mac; see [https://help.github.com/articles/dealing-with-line-endings] for details
 
$ git config --global branch.autosetuprebase always   # [http://stevenharman.net/git-pull-with-automatic-rebase] for details
 
$ git config --global color.ui true   # colorful Git output in Mac's Terminal (don't need it on Windows, as Git Bash is already colorful)

$ scp -p -P 29418 user.name@git.eclipse.org:hooks/commit-msg .git/hooks/

Eclipse PDE

Install Eclipse IDE for Eclipse Committers form https://www.eclipse.org/downloads/

Set "Window/Preferences/Java/Compiler/Compiler compliance level" equal to 1.7 or higher.

Install Eclipse features from repositories:

Importing projects

Switch to Git perspective, right-click rcptt repository and select Import projects > Import existing projects > add project to working set > select. Next, create the desired working sets.

Main RCPTT working sets:

   ecl: /ecl
   core: /core
   launching: /launching
   runtime: /runtime, /testing/org.eclipse.rcptt.testing.ecl
   ide: /rcp
   watson: /watson
   runner: /runner
   build: /repository/full, /releng/target-platforms

Formatter

Once you imported the projects, you should import formatter settings:

  1. open Preferences window, go to Java -> Code Style -> Formatter
  2. import formatter.xml profile from rcptt working directory
  3. go to Java -> Editor -> Save Actions
  4. select Format source code (Format edited lines) and Organize imports
  5. set Window/Preferences/General/Workspace/Encoding to utf-8
  6. set Window/Preferences/General/Workspace/Line delimiter to Unix

Target Platform

To apply a target platform:

  1. open 'photon/ide.target' file from org.eclipse.rcptt.targets project
  2. click on Set as Active Target Platform link

Launching from Eclipse

Use product build/org.eclipse.rcptt.product/org.eclipse.rcptt.product to create initial launch configuration. Currently product definition lacks some required plugins, so you might have to hit "Add required" button on Plugins tab of created launch configuration.

Launching issues

Sometimes, when product is not used to create launch configuration or due to target platform updates, selected plug-ins are lost from launch configuration. When you restore them, take a note that following plug-ins are required (by RCPTT launchers) but are not covered by direct dependencies:

   org.eclipse.equinox.p2.touchpoint.natives
   org.eclipse.equinox.p2.transport.ecf
   org.aspectj.weaver

Create RCPTT application under test

To create RCPTT attachable AUT, you also need to add a set of plug-ins to configuration.

  • Copy debug configuration "RCPTT" and rename it to "RCPTT AUT".
  • Change workspace path
  • Set the following VM arguments:
-Xms128m -Xmx768m -XX:PermSize=128M -XX:MaxPermSize=192M -DteslaPort=7926 -DeclPort=5378 -Dosgi.framework.extensions=org.eclipse.equinox.weaving.hook
  • Add the following plugins:
    • 'org.eclipse.rcptt.ecl.platform' plugin,
    • working set 'runtime' of RCPTT repo,
    • all plugins containing 'aspectj' from the target platform tree. Note that required plugin 'org.aspectj.weaver' is not added automatically by dependency,
    • remove all plugins containing 'mylyn'.
    • click 'Add required plug-ins' button.
    • set Auto-start to true for the 'org.eclipse.equinox.weaving.aspectj' plugin

If RCPTT AUT start, you should return to RCPTT and import existing project into workspace of RCPTT, choose rcptt/rcpttTests. Then click on rcpttTests > Run as > Run configurations > Remote application under tests > new:

If all is well, you should see a green triangle on AUT item in Application view.

Self RCPTT AUT

  • Copy "RCPT AUT" and rename it to "SELF RCPT AUT".
  • Change workspace path
  • Set the following VM arguments with different ports:
-Xms128m -Xmx768m -XX:PermSize=128M -XX:MaxPermSize=192M -DteslaPort=7927 -DeclPort=5379 -Dosgi.framework.extensions=org.eclipse.equinox.weaving.hook
  • In RCPTT IDE click on Run as > Run configurations > Remote application under tests > new.
    • Set name "selfQ7",
    • Change ELC port to 5379 and Tesla port to 7927 and run.

Third-party AUT's

  • Copy "RCPTT AUT" and rename it to "AUT APP".
  • Change workspace path
  • On plugins tab:
    • remove all plugins that contain 'update' substring.
    • add 'org.eclipse.ui.ide.application' plugin
    • add all plugins containing 'aspectj' from the target platform tree. Note that required plugin org.aspectj.weaver is not added automatically by dependency.
    • add org.eclipse.rcptt.ecl.interop, 'org.eclipse.rcptt.ecl.operations' and 'org.eclipse.rcptt.ecl.filesystem' plugins
    • add org.eclipse.rcptt.updates.runtime
    • click 'Add required plug-ins' button.

Contributing Patches

Prerequisites

https://wiki.eclipse.org/Gerrit#User_Account

  1. Create eclipse account and sign CLA
  2. Create ssh keys and upload public key to Gerrit here
  3. Add remote "gerrit" ssh://<username>@git.eclipse.org:29418/rcptt/org.eclipse.rcptt
git remote add gerrit ssh://<username>@git.eclipse.org:29418/rcptt/org.eclipse.rcptt


Creating the review

  1. Create a new signed-off-by commit (a line at the end of the commit message should be like "Signed-off-by: User Name <your email>")
  2. Push this commit into gerrit (*remote ref should be refs/for/master*, according to this)
git push gerrit HEAD:refs/for/master

If you have more than one commits for review, please squash them into one:

git checkout master
git checkout -b newBranchWithOneCommit
git merge --squash oldBranchWithFewCommits

git commit -am "Commit message"

Once you've uploaded the change, observe it being built at RCPTT HIPP instance

Back to the top