There are 4 depended projects here:
eclipse-plugin
- actual source code for the plugin;deepcode-feature
- description and legal information about plugin, as well as some Eclipse required service wrappers;deepcode-update-site
- "update-site" to be given for Eclipse: Preferences - Install/Update - Available Software Sites;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
- 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 fromFile - Open Projects from File System...
and make sure root dir is unselected as shown below:
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 insideplugin-test-fragment
project to provide path tojava-client-{X.X.X}-all.jar
location;
Now you should be able to:
- modify and run plugin itself at
eclipse-plugin
project:
- 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 theRun As > JUnit Plug-in Test
command:
-
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
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?
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
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
- official Eclipse Platform Plug-in Developer Guide, in particular:
- official Eclipse Plug-in Development Environment Guide
- The Official Eclipse FAQs