Skip to content

Latest commit

 

History

History
90 lines (58 loc) · 5.67 KB

DeveloperGuide.md

File metadata and controls

90 lines (58 loc) · 5.67 KB

Project structure

There are 4 depended projects here:

  1. eclipse-plugin - actual source code for the plugin;
  2. deepcode-feature - description and legal information about plugin, as well as some Eclipse required service wrappers;
  3. deepcode-update-site - "update-site" to be given for Eclipse: Preferences - Install/Update - Available Software Sites;
  4. plugin-test-fragment - tests for plugin.

Read more about Eclipse plugin concepts at official Eclipse Plug-in Development Environment Guide or in quick overview Custom eclipse plugin | Build, create & publish to update site & marketplace or the most recent Eclipse IDE Plug-in Development: Plug-ins, Features, Update Sites and IDE Extensions

Build

  • Clone this repository: git clone https://github.com/DeepCodeAI/eclipse-plugin.git and checkout desired branch;
  • Place java-client-{X.X.X}-all.jar into ..\eclipse-plugin\libs dir (see java-client repository for instruction how to build it);
  • Make sure Eclipse IDE for Eclipse Committers installed along with Java 8 (preferably 11) or above;
  • Open root eclipse-plugin Directory from File - Open Projects from File System... and make sure root dir is unselected as shown below:

Open projects

After all steps in wizard you should have all 4 projects mentioned above opened in your Workbench.

See below correspondent java-client version requirements:

eclipse-plugin java-client
0.0.9 2.0.10
0.0.11 2.0.12
0.0.17 2.0.17
  • Modify .classpath file inside plugin-test-fragment project to provide path to java-client-{X.X.X}-all.jar location;

Now you should be able to:

Run Eclipse

  • update needed texts and version number at deepcode-feature project;
  • Build it all into update-site in deepcode-update-site project;
  • For running tests use plugin-test-fragment project and in Package Explorer select the Run As > JUnit Plug-in Test command:

Run Tests

Running tests

  • To prevent tests be blocked by dialogs in UI (and the annoying Eclipse Window to pop up) during testing make sure the default test configuration is in "headless mode" You'll see some internal Exceptions due to absent of Eclipse GUI components, but all tests should pass correctly.

  • 2 environment variables with already logged Tokens need to be declared:

DEEPCODE_API_KEY - logged at https://www.deepcode.ai Token

DEEPCODE_API_KEY_STAGING - logged at https://www.deepcoded.com Token

Manual plugin Install

Production ready plugin should be available in Eclipse Marketplace (Help - Eclipse Marketplace...).

If you would like to add update-site manually (or add local version of update-site) then use this tutorial and add your local copy of update-site project or recent GitHub stored dev version of it: https://raw.githubusercontent.com/DeepCodeAI/eclipse-plugin/dev/deepcode-update-site

If you need to test modified plugin during development process - use Run As - Eclipse Application at your Eclipse IDE for Eclipse Committers (see here).

If you need to test pure plugin *.jar on another Eclipse IDE instance without updating feature and update-site you can use this trick FAQ How do I install new plug-ins?

JAR Signing

Before publishing following two jar files need to be signed inside deepcode-update-site project with jarsigner tool (see links below please):

deepcode-update-site/features/ai.deepcode.feature_{X.X.X}.jar

deepcode-update-site/plugins/ai.deepcode_{X.X.X}.jar

Example:

keytool -importkeystore -srckeystore ./deepcode.ai.pfx -srcstoretype PKCS12 -destkeystore ./deepcode.ai.jks -deststoretype pkcs12 -trustcacerts
jarsigner -keystore ./deepcode.ai.jks ./deepcode-update-site/features/ai.deepcode.feature_{X.X.X}.dev.jar deepcode.ai
jarsigner -keystore ./deepcode.ai.jks ./deepcode-update-site/plugins/ai.deepcode_{X.X.X}.jar deepcode.ai

Quick signing tutorial

Formal Eclipse doc

Current certificate is issued on 2020-09-09. Make sure you re-issue it every 90 days or buy one with 1-year validity. Certification site

Useful links