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 "PDT/Contributing"

< PDT
(Fix required dependencies)
(16 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
[[Category:PDT]]
 
[[Category:PDT]]
== Quick guide ==
 
Following is a two-step guide to get and build PDT source code:
 
  
1. Get PDT source code:
+
== Working with PDT source code in Eclipse ==
  
  git clone http://git.eclipse.org/gitroot/pdt/org.eclipse.pdt.git
+
=== Which Eclipse version? ===
  # or if you're eclipse user and/or PDT committer: git clone ssh://committerid@git.eclipse.org:29418/pdt/org.eclipse.pdt.git
+
  
2. Build PDT using Maven:
+
To comfortably edit PDT source code and execute it, you can use '''Eclipse IDE for Eclipse Committers''', which contains some required plugins (Java Development Tools, Plug-in Development Environment, Git Integration, …). You can download it from [https://www.eclipse.org/downloads/eclipse-packages/ here].
  
  cd org.eclipse.pdt                            // project root dir
+
=== Required plugins ===
  mvn clean install                            // build and run all tests
+
  mvn clean install -DskipTests                // build and ignore all tests
+
  mvn clean install -DskipPdtPerformanceTests  // build and skip performance tests only (recommend)
+
  
3. Build PDT release:
+
In addition to the plugins bundled with Eclipse, PDT requires other plugins that can be installed via the ''Help'' → ''Install New Software…'' menu item.
  
  cd org.elipse.pdt                            // project root dir
+
You'll need to add the following software site (you can add them by clicking the Manage button in the Install dialog):
  mvn clean install -Prelease                  // this will produce normalized, signed and packed release, inside eclipse.org infrastructure
+
  mvn clean install -Prelease -DskipSign        // this will produce normalized and packed release
+
  
== Working with PDT source code in Eclipse ==
+
* DLTK Nightly: http://download.eclipse.org/technology/dltk/updates-dev/latest-nightly
 +
* Orbit:
 +
** for Eclipse Oxygen.3a: http://download.eclipse.org/tools/orbit/downloads/drops/R20180330011457/repository
 +
** for other versions see http://download.eclipse.org/tools/orbit/downloads
 +
 
 +
Once you defined the above update sites, you should install these plugins:
 +
 
 +
* Category "All Orbit Bundles"
 +
** Apache Commons Exec Plug-in
 +
* Category "Business Intelligence, Reporting and Charting"
 +
** BIRT Framework
 +
* Category "Dynamic Languages Toolkit (DLTK)"
 +
** Dynamic Languages Toolkit - Core Frameworks SDK
 +
** Dynamic Languages Toolkit - Core Lucene Index Frameworks SDK
 +
** Dynamic Languages Toolkit - Mylyn Integration
 +
* Category "Dynamic Languages Toolkit (DLTK) Tests"
 +
** DLTK Core Tests
 +
* Category "General Purpose Tools"
 +
** Parallel Tools Platform
 +
** TM Terminal
 +
* Category "Modeling"
 +
** Zest SDK
 +
* Category "Web, XML, Java EE and OSGi Enterprise Development"
 +
** Eclipse Web Developer Tools
 +
 
 +
=== Importing the PDT projects ===
 +
 
 +
To import and prepare the PDT projects in Eclipse:
 +
 
 +
* Choose the ''File'' → ''Import…'' menu item, then choose ''Team'' → ''Team Project Set'', and specify to import from the URL https://git.eclipse.org/c/pdt/org.eclipse.pdt.git/plain/dev/psf/pdt-dev.psf
 +
* Select current Target Platform (''Window'' → ''Preferences'' menu item, then ''Plug-in Development'' → ''Target Platform'', then select '''''org.eclipse.php.target.current''''' and choose ''Apply and Close'')
 +
* (Optional) Disable API Baselines errors (''Window'' → ''Preferences'' menu item, then ''Plug-in Development'' → ''API Baselines'', then choose ''Missing API baseline'' → ''Ignore'')
 +
 
 +
=== Running and debugging PDT ===
 +
 
 +
In order to run (and debug) PDT, you can choose the ''Run'' → ''Debug Configurations…'' menu item, and add a new ''Eclipse Application''. Alternatively, PDT can be run/debug just by selecting one of PDT projects and choose ''Run As'' → ''Eclipse Application'' from the context menu.
 +
 
 +
NOTE: Currently because of [https://bugs.eclipse.org/bugs/show_bug.cgi?id=534370 bug 534370] MANIFEST.MF in org.eclipse.php.core plugin can indicate errors, you can ignore them.
 +
 
 +
You can keep the default settings, but it's very handy to go to the ''Common'' tab, and check ''Debug'' and ''Run'' in the ''Display in favorites menu'' checklist (so that you'll be able to launch the debug environment by clicking the Debug or Run icons in the toolbar).
 +
 
 +
When launching the debug application, a new Eclipse instance will be executed: you can create a new PHP project, and you can place breakpoints and analyze the execution in the Eclipse instance containing the PDT project.
 +
 
 +
PS: when executing PDT, you may see some validation warnings: you can safely ignore them.
  
# To comfortably edit PDT source code you will need Eclipse JDT (Java Development Tools), PDE (Plug-in Development Environment) and Egit (Eclipse Git Team Provider). Ideally Eclipse Classic package from Eclipse downloads page is what you need. Great addition can be m2eclipse.
 
# Save the XML below ("PDT Team Project Set") to a file named pdt.psf
 
# In Eclipse, choose File->Import, select Team->Team Project Set and choose the pdt.psf file created in step 2. After finishing the import wizard, you should see all PDT source code in your workspace. Source code might not be compiling yet
 
# Find file org.eclipse.php.core/Resources/parserTools/build.xml and launch it as Ant Build. This will generate PHP language parser classes.
 
# Install missing dependencies:
 
## Dynamic Languages Toolkit - Core Frameworks (PDT usually requires the [http://download.eclipse.org/technology/dltk/updates-dev/latest-nightly/ nightly version] of DLTK)
 
## Dynamic Languages Toolkit - Core Lucene Index Frameworks
 
## Eclipse Web Developer Tools
 
## JavaScript Development Tools
 
## Eclipse XML Editors and Tools
 
## Dynamic Languages Toolkit - Mylyn Integration
 
# In preferences (Window->Preferences->Plug-in Development->API Baselines), switch "Missing API baseline" to "Warning" or "Ignore".
 
# You can now run PDT in Eclipse self-hosting mode. Click on any of PDT projects and choose Run As->Eclipse Application
 
# If your developer environment have PDT already installed, you might want disable debugger daemons via: -Dorg.eclipse.php.debug.disableDaemonStartup in eclipse.ini
 
  
 
== Preparing and sending patches ==
 
== Preparing and sending patches ==
  
When you decide to send us your new amazing patch, please read this articles how to do it:
+
When you decide to send us your new patch, you'll need:
  
# [http://wiki.eclipse.org/Development_Resources/Contributing_via_Git#Eclipse_Foundation_Contributor_License_Agreement Make sure you are signed Eclipse Foundation Contributor License Agreement]
+
# an Eclipse account (you can create it [https://accounts.eclipse.org/user/register here])
# [http://wiki.eclipse.org/Gerrit#Using_Gerrit_with_the_git_command_line Configure Gerrit with git]
+
# to sign the [https://www.eclipse.org/contribute/cla Eclipse Contributor Agreement]
# [http://wiki.eclipse.org/Development_Resources/Contributing_via_Git#via_Gerrit Prepare patch and send it to Gerrit]
+
  
=== Patch naming conventions ===
+
Patches must be sent via GitHub pull requests: https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests
Each patch message, at first line have to follow one of these patterns:
+
  
1. If you fixed bugzilla bug (for example #1234)
+
Before sending patches, you should file a bug report.
  
  Bug 1234 - Bug / patch description
+
The commit message must be like this:
  
2. Other patches:
+
  Bug 1234 - Description
 +
 
 +
  Notes
 +
 
 +
  Signed-off-by: Your Name <your-email@example.com>
  
  No bug - Your patch description
+
Where:
  
'''If your patch is still in progress, to avoid confusion add "[WIP] " prefix.'''
+
* 1234<br />is the GitHub issue
 +
* Description<br />is the main title of the patch.
 +
* Notes<br />are optional notes about the patch.
 +
* Your Name<br />is your real name.
 +
* your-email@example.com<br />is your email address.
 +
 
 +
PS: the commit author and submitter usually have the same value as the Signed-off-by.
 +
 
 +
== Compiling PDT outside Eclipse ==
 +
 
 +
You can compile the PDT source code outside Eclipse.
 +
 
 +
First of all, you need to clone the PDT git repository:
 +
 
 +
  git clone https://github.com/eclipse/pdt
 +
 
 +
If you are an Eclipse user and/or a PDT committer:
 +
 
 +
  git clone git@github.com:eclipse/pdt.git
 +
 
 +
To build PDT, you need Maven, and launch these commands:
 +
 
 +
  # project root dir
 +
  cd org.eclipse.pdt
 +
  # build and run all tests
 +
  mvn clean install
 +
  # build and ignore all tests
 +
  mvn clean install -DskipTests
 +
  # build and skip performance tests only (recommend)
 +
  mvn clean install -DskipPdtPerformanceTests
 +
 
 +
To build the PDT release:
 +
 
 +
  # project root dir
 +
  cd org.elipse.pdt
 +
  # this will produce normalized, signed and packed release, inside eclipse.org infrastructure
 +
  mvn clean install -Prelease
 +
  #this will produce normalized and packed release
 +
  mvn clean install -Prelease -DskipSign
  
    [WIP] Bug 1234 - Bug description
 
  
 
== Sonar ==
 
== Sonar ==
 +
 
Sonar is used in order to track Code Quality:
 
Sonar is used in order to track Code Quality:
# Sonar dashboard: https://dev.eclipse.org/sonar/project/index/org.eclipse.php:org.eclipse.pdt.releng
+
# Sonar dashboard: https://sonarcloud.io/dashboard?id=eclipse-tools.pdt.main
# Reports are ganerated based on dedicated build: https://hudson.eclipse.org/pdt/job/pdt-sonar/#https://hudson.eclipse.org/pdt/job/pdt-sonar
+
# Reports are ganerated based on dedicated build: https://ci.eclipse.org/pdt/job/pdt-sonarcloud
  
== PDT Team Project Set ==
+
== Developer Resources ==
You can quickly set up your Eclipse workspace using the following [http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Ftasks%2Ftasks-cvs-project-set.htm Team Project Set]. Save the following text into a file named "pdt.psf"; use "File > Import > Team Project Set" to import that file.
+
  
  <?xml version="1.0" encoding="UTF-8"?>
+
After setting up PDT source code please have a look at a set of docs we have for our developers on the [[PDT#Developer_Resources]] page.
  <psf version="2.0">
+
  <provider id="org.eclipse.egit.core.GitProvider">
+
  <project reference="1.0,http://git.eclipse.org/gitroot/pdt/org.eclipse.pdt.git,master,plugins/org.eclipse.php.core"/>
+
  <project reference="1.0,http://git.eclipse.org/gitroot/pdt/org.eclipse.pdt.git,master,plugins/org.eclipse.php.core.parser"/>
+
  <project reference="1.0,http://git.eclipse.org/gitroot/pdt/org.eclipse.pdt.git,master,plugins/org.eclipse.php.debug.core"/>
+
  <project reference="1.0,http://git.eclipse.org/gitroot/pdt/org.eclipse.pdt.git,master,plugins/org.eclipse.php.debug.daemon"/>
+
  <project reference="1.0,http://git.eclipse.org/gitroot/pdt/org.eclipse.pdt.git,master,plugins/org.eclipse.php.debug.ui"/>
+
  <project reference="1.0,http://git.eclipse.org/gitroot/pdt/org.eclipse.pdt.git,master,plugins/org.eclipse.php.help"/>
+
  <project reference="1.0,http://git.eclipse.org/gitroot/pdt/org.eclipse.pdt.git,master,plugins/org.eclipse.php.mylyn.ui"/>
+
  <project reference="1.0,http://git.eclipse.org/gitroot/pdt/org.eclipse.pdt.git,master,plugins/org.eclipse.php.server.core"/>
+
  <project reference="1.0,http://git.eclipse.org/gitroot/pdt/org.eclipse.pdt.git,master,plugins/org.eclipse.php.server.ui"/>
+
  <project reference="1.0,http://git.eclipse.org/gitroot/pdt/org.eclipse.pdt.git,master,plugins/org.eclipse.php.ui"/>
+
  <project reference="1.0,http://git.eclipse.org/gitroot/pdt/org.eclipse.pdt.git,master,plugins/org.eclipse.php.formatter.core"/>
+
  <project reference="1.0,http://git.eclipse.org/gitroot/pdt/org.eclipse.pdt.git,master,plugins/org.eclipse.php.formatter.ui"/>
+
  <project reference="1.0,http://git.eclipse.org/gitroot/pdt/org.eclipse.pdt.git,master,plugins/org.eclipse.php.refactoring.core"/>
+
  <project reference="1.0,http://git.eclipse.org/gitroot/pdt/org.eclipse.pdt.git,master,plugins/org.eclipse.php.refactoring.ui"/>
+
  </provider>
+
  </psf>
+
  
== Developer Resources ==
 
After setting up PDT source code please have a look at a set of docs we have for our developers on [[PDT#Developer_Resources]] page.
 
  
 
== Update help pages ==
 
== Update help pages ==
 +
 
All help pages sitting under plugins/org.eclipse.php.help/docs/source/ in *.md format.
 
All help pages sitting under plugins/org.eclipse.php.help/docs/source/ in *.md format.
  

Revision as of 15:21, 12 May 2020


Working with PDT source code in Eclipse

Which Eclipse version?

To comfortably edit PDT source code and execute it, you can use Eclipse IDE for Eclipse Committers, which contains some required plugins (Java Development Tools, Plug-in Development Environment, Git Integration, …). You can download it from here.

Required plugins

In addition to the plugins bundled with Eclipse, PDT requires other plugins that can be installed via the HelpInstall New Software… menu item.

You'll need to add the following software site (you can add them by clicking the Manage button in the Install dialog):

Once you defined the above update sites, you should install these plugins:

  • Category "All Orbit Bundles"
    • Apache Commons Exec Plug-in
  • Category "Business Intelligence, Reporting and Charting"
    • BIRT Framework
  • Category "Dynamic Languages Toolkit (DLTK)"
    • Dynamic Languages Toolkit - Core Frameworks SDK
    • Dynamic Languages Toolkit - Core Lucene Index Frameworks SDK
    • Dynamic Languages Toolkit - Mylyn Integration
  • Category "Dynamic Languages Toolkit (DLTK) Tests"
    • DLTK Core Tests
  • Category "General Purpose Tools"
    • Parallel Tools Platform
    • TM Terminal
  • Category "Modeling"
    • Zest SDK
  • Category "Web, XML, Java EE and OSGi Enterprise Development"
    • Eclipse Web Developer Tools

Importing the PDT projects

To import and prepare the PDT projects in Eclipse:

  • Choose the FileImport… menu item, then choose TeamTeam Project Set, and specify to import from the URL https://git.eclipse.org/c/pdt/org.eclipse.pdt.git/plain/dev/psf/pdt-dev.psf
  • Select current Target Platform (WindowPreferences menu item, then Plug-in DevelopmentTarget Platform, then select org.eclipse.php.target.current and choose Apply and Close)
  • (Optional) Disable API Baselines errors (WindowPreferences menu item, then Plug-in DevelopmentAPI Baselines, then choose Missing API baselineIgnore)

Running and debugging PDT

In order to run (and debug) PDT, you can choose the RunDebug Configurations… menu item, and add a new Eclipse Application. Alternatively, PDT can be run/debug just by selecting one of PDT projects and choose Run AsEclipse Application from the context menu.

NOTE: Currently because of bug 534370 MANIFEST.MF in org.eclipse.php.core plugin can indicate errors, you can ignore them.

You can keep the default settings, but it's very handy to go to the Common tab, and check Debug and Run in the Display in favorites menu checklist (so that you'll be able to launch the debug environment by clicking the Debug or Run icons in the toolbar).

When launching the debug application, a new Eclipse instance will be executed: you can create a new PHP project, and you can place breakpoints and analyze the execution in the Eclipse instance containing the PDT project.

PS: when executing PDT, you may see some validation warnings: you can safely ignore them.


Preparing and sending patches

When you decide to send us your new patch, you'll need:

  1. an Eclipse account (you can create it here)
  2. to sign the Eclipse Contributor Agreement

Patches must be sent via GitHub pull requests: https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests

Before sending patches, you should file a bug report.

The commit message must be like this:

 Bug 1234 - Description
 
 Notes
 
 Signed-off-by: Your Name <your-email@example.com>

Where:

  • 1234
    is the GitHub issue
  • Description
    is the main title of the patch.
  • Notes
    are optional notes about the patch.
  • Your Name
    is your real name.
  • your-email@example.com
    is your email address.

PS: the commit author and submitter usually have the same value as the Signed-off-by.

Compiling PDT outside Eclipse

You can compile the PDT source code outside Eclipse.

First of all, you need to clone the PDT git repository:

 git clone https://github.com/eclipse/pdt

If you are an Eclipse user and/or a PDT committer:

 git clone git@github.com:eclipse/pdt.git

To build PDT, you need Maven, and launch these commands:

 # project root dir
 cd org.eclipse.pdt
 # build and run all tests
 mvn clean install
 # build and ignore all tests
 mvn clean install -DskipTests
 # build and skip performance tests only (recommend)
 mvn clean install -DskipPdtPerformanceTests

To build the PDT release:

 # project root dir
 cd org.elipse.pdt
 # this will produce normalized, signed and packed release, inside eclipse.org infrastructure
 mvn clean install -Prelease
 #this will produce normalized and packed release
 mvn clean install -Prelease -DskipSign


Sonar

Sonar is used in order to track Code Quality:

  1. Sonar dashboard: https://sonarcloud.io/dashboard?id=eclipse-tools.pdt.main
  2. Reports are ganerated based on dedicated build: https://ci.eclipse.org/pdt/job/pdt-sonarcloud

Developer Resources

After setting up PDT source code please have a look at a set of docs we have for our developers on the PDT#Developer_Resources page.


Update help pages

All help pages sitting under plugins/org.eclipse.php.help/docs/source/ in *.md format.

While make install, our build system converting it to *.html files in exactly same structure and also:

  1. Remove ###- part from each *.md file, and fix all internal links.
  2. Regenerate IPHPHelpContextIds interface
  3. Build helpContexts.xml file
  4. Build toc.xml file

Which editor should I use?

You can work with any markdown editor, but because our build system use Mylyn Wikitext, you should install wikitext editor from https://eclipse.org/mylyn/downloads/ to be sure that everything is ok.

Howto register new help context id?

Add this code to markdown file:

 <!--context:your_context_id-->

Copyright © Eclipse Foundation, Inc. All Rights Reserved.