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 "JSDT/Development"

(Development Environment Setup)
(Target Platform, API Baseline and Other Preferences)
 
(26 intermediate revisions by the same user not shown)
Line 21: Line 21:
 
* check the [https://wiki.eclipse.org/JSDT/Confcalls JSDT Confcalls]
 
* check the [https://wiki.eclipse.org/JSDT/Confcalls JSDT Confcalls]
  
=== Reporting Bugs ===
+
=== Bugzilla for JSDT Bugs ===
[https://bugs.eclipse.org/bugs/enter_bug.cgi?product=JSDT Report a bug] through [http://bugs.eclipse.org/bugs/ Eclipse Bugzilla] under WebTools category, JSDT component.
+
You can [https://bugs.eclipse.org/bugs/enter_bug.cgi?product=JSDT Report a JSDT bug] through [http://bugs.eclipse.org/bugs/ Eclipse Bugzilla] choosing WebTools category, JSDT component.
  
 
Here is a [https://bugs.eclipse.org/bugs/buglist.cgi?list_id=3212991&resolution=---&classification=WebTools&query_format=advanced&product=JSDT list of open JSDT bugs]. We're working through them as fast as we can!
 
Here is a [https://bugs.eclipse.org/bugs/buglist.cgi?list_id=3212991&resolution=---&classification=WebTools&query_format=advanced&product=JSDT list of open JSDT bugs]. We're working through them as fast as we can!
  
You can receive notifications of incoming bugs by monitoring account ''jsdt.javascript-inbox@eclipse.org'' in https://bugs.eclipse.org/bugs/userprefs.cgi?tab=email
+
Don't forget to subscribe to Bugzilla notifications for JSDT. Here is an "how-to" reminder:
 +
* Go to https://bugs.eclipse.org/bugs/userprefs.cgi?tab=email
 +
* Add  jsdt.web-inbox@eclipse.org to the watch list, at the end of the page.
  
 
=== Contribute Code ===
 
=== Contribute Code ===
  
As Contributor, you can fix bugs on our backlog and send code contributions via Gerrit.
+
As Contributor, you can fix JSDT bugs and send code contributions via Gerrit:
 
* To start you need to sign the [https://eclipse.org/legal/CLA.php CLA] and to [setup the development environment]
 
* To start you need to sign the [https://eclipse.org/legal/CLA.php CLA] and to [setup the development environment]
* Then you can pick an [https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&list_id=13964165&product=JSDT open JSDT Bug], check is not assigned to any team member, and assign it to yourself.  
+
* Then pick an [https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&list_id=13964165&product=JSDT open JSDT Bug], if not assigned to any team member, assign it to yourself.  
* Solve the bug and test the solution, then you can contribute your code edits back using Gerrit.
+
* Solve the bug and test the solution, so you can commit and push your change with Gerrit.
* Now wait for a committer to review commit your changes, possibly asking you code edits
+
* Now wait for a committer who has to review and approve (+1) before your changes are committed.
  
 
Below you can read how to setup the development environment, get the source code, edit the source, run the application, perform tests, and commit the changes via Gerrit.
 
Below you can read how to setup the development environment, get the source code, edit the source, run the application, perform tests, and commit the changes via Gerrit.
  
== Development Environment Setup ==
+
== Setup the Development Environment ==
  
There are several ways to setup the development environment. Here are two good ones:
+
To setup the development environment you can either use a Full Stack ''Eclipse IDE loaded with the Target Platform Plug-ins'', or use an ''Eclipse IDE'' for coding and keep a separate installation as a ''Target Platform''.  
  
* Work on an Eclipse IDE and keep a separate Eclipse installation as a Target Platform. This separation IDE vs. TP leads to an easy setup and good flexibility.
+
Separating your development IDE from Target Platform makes your IDE lighter, more stable when adding development plug-ins and more flexible for development against different versions.
* Work on a Full Stack Eclipse = Eclipse IDE + all plugins needed in Target Platform. With a single installation, you need to know the full list of needed plug-ins in advance, and it shouldn't be faster than the previous method.  
+
  
=== Eclipse IDE + Target Platform aside ===
+
If you're new to this setup, watch once this video to see a full setup for JSDT development environment: https://www.youtube.com/watch?v=SFxfuudlau8 (for Mars.1).
  
For this setup you will be using an Eclipse installation for development (IDE) and an Eclipse installation as Target Platform (TP). As a gentle introduction, you can watch this 12 minutes [https://www.youtube.com/watch?v=SFxfuudlau8 video: setup JSDT development environment] (Mars.1). 
+
=== Eclipse IDE + Target Platform aside ===
  
Start downloading two Eclipse installations
+
Download recent builds of Eclipse IDE and Target Platform from the eclipse download page: https://www.eclipse.org/downloads/  
* IDE (dev tools) : [https://www.eclipse.org/downloads/packages/eclipse-rcp-and-rap-developers/mars2 Eclipse for RCP and RAP developers (Mars.2)]
+
* TP (target) : [https://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/mars2 Eclipse IDE for Java EE Developers (Mars.2)]
+
  
This document explain the first kind of setup
+
As an example, for Mars.2, you need to download:
 +
* Eclipse IDE (dev tools) : [https://www.eclipse.org/downloads/packages/eclipse-rcp-and-rap-developers/mars2 for RCP and RAP developers]
 +
* Eclipse TP (target) : [https://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/mars2 for Java EE developers]
  
Then unzip both on local disk; launch the IDE (the one you'll use for development) and click away the welcome window. and setup IDE Properties and TP+Baseline as follows.
+
After the downloads, unzip both installations. Launch the IDE, and remember you should never launch or update the Target Platform.
  
 
=== Target Platform, API Baseline and Other Preferences ===
 
=== Target Platform, API Baseline and Other Preferences ===
  
Below you see how to setup Target Platform and API Baselines.  
+
For the development you'll need to edit '''Preferences''', and set the Target Platform, API Baselines and other recommended values.  
  
[[File:Setup-target-platform-and-api-baseline-eclipse-jee-mars-2.png|400px]]
+
[[File:Set-downloaded-instalaltion-as-target-platform.png|650px]]
  
To set the ''Target Platform'' and the ''API Baseline'' open from menu  '''Windows > Preferences''' then select:
+
To set the ''Target Platform'' and the ''API Baseline'' open '''Windows > Preferences''' from menu and then select:
* '''Plug-in Development''' > ''' API Baseline''' and point to the Target Platform installation
+
* '''Plug-in Development''' > ''' API Baseline''' Click "Add Baseline" and point to the Target Platform installation
* '''Plug-in Development''' > '''Target Platform''' and point to the Target Platform installation.
+
* '''Plug-in Development''' > '''Target Platform''' Click "Add.." and point to the Target Platform installation.
  
Below you see how to set the other recommended preferences in line with the [[Platform_UI/How_to_Contribute]] guidelines.
+
To set the other recommended preferences in line with the [[Platform_UI/How_to_Contribute]] guidelines open '''Windows > Preferences''' from menu and then select:
 
+
From '''Windows > Preferences''' select:
+
 
* '''Preferences > General > Workspace''', set text file delimiters to Unix line delimiters
 
* '''Preferences > General > Workspace''', set text file delimiters to Unix line delimiters
 
* '''Preferences > Java  > Editor > Save Actions''', enable the “Perform the selected actions ..” and set:
 
* '''Preferences > Java  > Editor > Save Actions''', enable the “Perform the selected actions ..” and set:
Line 78: Line 77:
 
=== Get the Source Code ===
 
=== Get the Source Code ===
  
Download the projectSet defining all the needed JSDT projects along with their repositories:
+
''Note'': If you already have local Git repositories with JSDT projects, you can switch to Git perspective, and import them in the Git Repository View, via the "Add an existing local repository" Link. So doing, the download of projects from the project set will re-use those imported repositories, instead of doing a full download.
 
+
[http://www.asegno.com/wp-content/uploads/2016/02/wst.jsdt_.allProjects_20160209.psf wst.jsdt_.allProjects_20160209.psf]
+
 
+
Then import all projects via:
+
 
+
* '''Import > Team > Team Project Set''' then choose the project set file
+
  
 
==== JSDT Source Repositories ====
 
==== JSDT Source Repositories ====
  
An expert user might prefer first to clone from Git repos, then to import the projectSet.psf.<br/>
+
To edit JSDT code, you will need to fetch code from four project repositories. Below you can see the Gerrit URLs.  
 
+
Below you can see the https URLs for Gerrit.  
+
 
<pre>
 
<pre>
 
https://git.eclipse.org/r/p/jsdt/webtools.jsdt
 
https://git.eclipse.org/r/p/jsdt/webtools.jsdt
Line 96: Line 87:
 
http://git.eclipse.org/gitroot/www.eclipse.org/webtools.git
 
http://git.eclipse.org/gitroot/www.eclipse.org/webtools.git
 
https://git.eclipse.org/r/platform/eclipse.platform.runtime
 
https://git.eclipse.org/r/platform/eclipse.platform.runtime
</pre>  
+
</pre>
  
'''Note''': To directly clone and setup the Gerrit credentials, edit the above URLs by adding your username as follows <code>https://<YOUR-USERNAME>@git.eclipse.org/...</code>, and then provide the [https://git.eclipse.org/r/#/settings/http-password Gerrit https password] when needed, at first loading.  
+
If you already provided Eclipse your [https://git.eclipse.org/r/#/settings/http-password Gerrit https password], you can clone and setup quickly by prepending your username to the URL as <code>https://<YOUR-USERNAME>@git.eclipse.org/...</code>.
 +
 
 +
==== JSDT ProjectSet  ====
 +
 
 +
The JSDT ProjectSet defines all the project needed to develop on JSDT, along with the needed repositories.
 +
 
 +
[http://www.asegno.com/wp-content/uploads/2016/02/wst.jsdt_.allProjects_20160209.psf wst.jsdt_.allProjects_20160209.psf]
 +
 
 +
Then import all projects via:
 +
 
 +
* '''Import > Team > Team Project Set''' and choose the project set file
 +
 
 +
[[File:Import-jsdt-project-set.png|500px]]
 +
 
 +
'''Please Note''': Sometimes the ProjectSet could be not in sync with latest developments. If so, you can fix by adding missing projects, and looking in the \bundles\ folder of JSDT repositories.  
  
 
==== JSDT Git Sources ====
 
==== JSDT Git Sources ====
Line 116: Line 121:
 
* Then Run the launch configuration. You will see a new Inner Eclipse popping up.  
 
* Then Run the launch configuration. You will see a new Inner Eclipse popping up.  
 
* If needed you can debug this Eclipse instance you’re going to develop against.
 
* If needed you can debug this Eclipse instance you’re going to develop against.
 +
 +
You can check the [https://youtu.be/SFxfuudlau8?t=9m44s video starting 9'44"] to see how to choose plug-ins and run the application.
  
 
=== Building and testing JSDT locally ===
 
=== Building and testing JSDT locally ===

Latest revision as of 19:29, 19 April 2016


JSDT
Website
Download
Community
Mailing ListForumsIRCmattermost
Issues
OpenHelp WantedBug Day
Contribute
Browse Source


JSDT is a subproject of WTP providing JavaScript editing features based on JDT; other editors based on SSE; Nodejs and JS debugging support based on ChromeDevTools and much more. Check the project pages below and see Developer Resources to get the list of Source repositories:

  • JSDT: JavaScript Development Tools
  • WTP: WebTools Platform, parent project since WTP3.0
  • SSE: Structured Source Editing, for editors like XML, CSS, JSON
  • JDT: Java Development Tools, extended by the JavaScript Editor

Contributing to JSDT

The JSDT is driven by a small and dedicated development team with limited resources. ANY serious developers or contributors will be enthusiastically welcomed. For more information on how to become a Committer, read how we nominate and elect new committers according the standard Eclipse process.

To contribute to JSDT you can report bugs, resolve bugs and write documents or create media contents to spread your knowledge.

Getting in touch with the Community

For more information about contributing to JSDT or for questions about its internals you have few options:

Bugzilla for JSDT Bugs

You can Report a JSDT bug through Eclipse Bugzilla choosing WebTools category, JSDT component.

Here is a list of open JSDT bugs. We're working through them as fast as we can!

Don't forget to subscribe to Bugzilla notifications for JSDT. Here is an "how-to" reminder:

Contribute Code

As Contributor, you can fix JSDT bugs and send code contributions via Gerrit:

  • To start you need to sign the CLA and to [setup the development environment]
  • Then pick an open JSDT Bug, if not assigned to any team member, assign it to yourself.
  • Solve the bug and test the solution, so you can commit and push your change with Gerrit.
  • Now wait for a committer who has to review and approve (+1) before your changes are committed.

Below you can read how to setup the development environment, get the source code, edit the source, run the application, perform tests, and commit the changes via Gerrit.

Setup the Development Environment

To setup the development environment you can either use a Full Stack Eclipse IDE loaded with the Target Platform Plug-ins, or use an Eclipse IDE for coding and keep a separate installation as a Target Platform.

Separating your development IDE from Target Platform makes your IDE lighter, more stable when adding development plug-ins and more flexible for development against different versions.

If you're new to this setup, watch once this video to see a full setup for JSDT development environment: https://www.youtube.com/watch?v=SFxfuudlau8 (for Mars.1).

Eclipse IDE + Target Platform aside

Download recent builds of Eclipse IDE and Target Platform from the eclipse download page: https://www.eclipse.org/downloads/

As an example, for Mars.2, you need to download:

After the downloads, unzip both installations. Launch the IDE, and remember you should never launch or update the Target Platform.

Target Platform, API Baseline and Other Preferences

For the development you'll need to edit Preferences, and set the Target Platform, API Baselines and other recommended values.

Set-downloaded-instalaltion-as-target-platform.png

To set the Target Platform and the API Baseline open Windows > Preferences from menu and then select:

  • Plug-in Development > API Baseline Click "Add Baseline" and point to the Target Platform installation
  • Plug-in Development > Target Platform Click "Add.." and point to the Target Platform installation.

To set the other recommended preferences in line with the Platform_UI/How_to_Contribute guidelines open Windows > Preferences from menu and then select:

  • Preferences > General > Workspace, set text file delimiters to Unix line delimiters
  • Preferences > Java > Editor > Save Actions, enable the “Perform the selected actions ..” and set:
    • Format Source Code > Format Edited Lines: to avoid formatting the whole file, but limit the changes to edited lines.
    • Additional Actions > Remove Trailing Whitespaces: to avoid adding trailing whitespaces
  • Preferences > Java > Installed JREs add the needed JREs. Usually I add Java8, 7 and 6.

Get the Source Code

Note: If you already have local Git repositories with JSDT projects, you can switch to Git perspective, and import them in the Git Repository View, via the "Add an existing local repository" Link. So doing, the download of projects from the project set will re-use those imported repositories, instead of doing a full download.

JSDT Source Repositories

To edit JSDT code, you will need to fetch code from four project repositories. Below you can see the Gerrit URLs.

https://git.eclipse.org/r/p/jsdt/webtools.jsdt
https://git.eclipse.org/r/p/sourceediting/webtools.sourceediting
http://git.eclipse.org/gitroot/www.eclipse.org/webtools.git
https://git.eclipse.org/r/platform/eclipse.platform.runtime

If you already provided Eclipse your Gerrit https password, you can clone and setup quickly by prepending your username to the URL as https://<YOUR-USERNAME>@git.eclipse.org/....

JSDT ProjectSet

The JSDT ProjectSet defines all the project needed to develop on JSDT, along with the needed repositories.

wst.jsdt_.allProjects_20160209.psf

Then import all projects via:

  • Import > Team > Team Project Set and choose the project set file

Import-jsdt-project-set.png

Please Note: Sometimes the ProjectSet could be not in sync with latest developments. If so, you can fix by adding missing projects, and looking in the \bundles\ folder of JSDT repositories.

JSDT Git Sources

Testing

Here you can find information on JSDT testing by launching an inner eclipse, by building and testing locally and about functional testing scenarios.

Launch the Target Platform from IDE

Launching an inner eclipse with target platform plugins onboard, added by the plugins of which you are editing the source code:

  • Create a new launch configuration, based on plugins contained in the target platform
  • Then Run the launch configuration. You will see a new Inner Eclipse popping up.
  • If needed you can debug this Eclipse instance you’re going to develop against.

You can check the video starting 9'44" to see how to choose plug-ins and run the application.

Building and testing JSDT locally

Simply run mvn clean verify -Pbuild-individual-bundles -DskipTests=false. This command will run the Unit-tests. After the build, you can install your JSDT snapshot in an Eclipse IDE or other RCP application using the p2 repository in location site/target/repository

JSDT Functional Testing

Testing Scenarios

Gerrit Reviews

Pushing a new patch for review

You can use Gerrit (mandatory reading, important to set up hooks, SSH keys, CLA & other) to push Git commits on JSDT repositories. The repo URL for JSDT@Gerrit is ssh://user@git.eclipse.org:29418/jsdt/webtools.jsdt. Once logged into Gerrit, you can see more details about the URL at https://git.eclipse.org/r/#/admin/projects/jsdt/webtools.jsdt .

Assuming you named this repo gerrit, you can push a commit to one of this repository with

$ git push gerrit HEAD:refs/for/master

This will give you the URL of the Gerrit review where you can interact with project committers to get your commit merged.

In case you need to push another version of the patch, don't forget to copy the Change-Id from the Gerrit review if you didn't set up the git hook. Providing another version of the patch doesn't require a new commit, simply amend the one you already pushed, and push it again:

$ git log -1 #Shows the commit. Message should contain Sign-Off-By and Change-Id
$ git add file/to/change
$ git commit --amend # add --signoff if Sign-Off-By is missing, and copy Change-Id from Gerrit review if missing
$ git push gerrit HEAD:refs/for/master # will create another version of the patch, on the same review.

Reviewing a patch

Incoming patch automatically triggers a build and will receive an automated vote according to whether patch breaks the build/tests or not. The CI job providing this vote is https://hudson.eclipse.org/webtools/job/jsdt-gerrit.

  • Anytime Hudson votes with -1, it generally means that something is wrong with the patch: it breaks build or make a test failing, so the patch shouldn't be merged. The build log should be inspected by submitter and reviewers to understand the cause of the bug and submit (or assist in submitting) a better patch.
  • Hudson voting +1 means that the test didn't introduce any regression visible by build or automated tests.

Anyone is free to add comments and vote on a review. Committers have the final power to decide whether or not a patch can be merged.

List reviews and be notified

You can see the list of open Gerrit reviews at https://git.eclipse.org/r/#/q/status:open+project:jsdt/webtools.jsdt,n,z .

Regular contributors and committers should really subscribe to notifications of proposed patches. You can set up notifications for proposed incoming changes at https://git.eclipse.org/r/#/settings/projects

Static analysis with SonarQube

JSDT uses SonarQube to get reports about static analysis. Those can show potential bugs, performance traps, or just bad practices. Here is the status of JSDT on these topics: https://dev.eclipse.org/sonar/dashboard/index/org.eclipse.webtools.jsdt:jsdt-parent . Any help to clean up warnings is welcome!

Back to the top