Getting started writing plugins

How does one get started writing plugins? The docs seem sparse, at best, and mostly from 2002-2003. I found the plugin dev kit, but it's for 4.5.4, and I want to build for Irida.

I also found the plugin ant script which is supposed to handle setting things up for you, but it doesn't look like it's been updated in a couple of years and the "Plugin" module type in Irida seems to handle a lot of this for you.

Is there a guide somewhere I should be reading to get started?

0
10 comments
Avatar
Permanently deleted user

Jason,


I suggest you follow those steps :

0/ use Irida (the EAP)
(it will let you develop a plugin for 4.5 if you wish)

1/ install the DevKit SDK
- download and unzip the IDEA-XXX.dev.zip from
http://www.intellij.net/eap/products/idea/download.jsp
- copy the unzipped dir contents to IDEA_HOME, in the dir with the
same name
/help/* --> /help/ , etc.. => it will install the javadoc and source for the plugin openAPI. 2/ define a plugin JDK (!! it's necessary to compile plugin projects) - IDE settings + (JDK & Global libraries) - select "Add IntelliJ IDEA SDK + point to your IDEA home - select a sandbox directory (can be anywhere) (choose a name like "sandbox-3211") note: later, you'll define one for IDEA 4.5 the same way) 3/ download the source of a plugin that : - is very simple - contains the whole DevKit project (=>]]> you can simply unzip + open
the project + run).

Example:
http://intellij.org/twiki/bin/view/Main/LysosomePlugin
http://intellij.org/twiki/bin/view/Main/ColorChooserPlugin
http://intellij.org/twiki/bin/view/Main/LineUpAndDownMoverPlugin
http://intellij.org/twiki/bin/view/Main/StringEditorPlugin



4/ Compile
(You'll get an error, about the JDK: just choose the one you defined
in 2/ above, and recompile)


5/ create a plugin run config (to launch the plugin in a 2nd instance of
IDEA)

- Menu: Run.Edit Config.Plugin
- click on the
- name the config "launch 2nd instance"


6/ run the plugin config you've just defined

note 1: if you chose /Debug/ rather than /Run/, you'll be able to debug
the plugin, while it's running in the 2nd instance)
note 2: It's Hotswappeable => while the 2nd instance in running, you can
change (some) the code of the plugin, and recompile => hotswap => no
need to interrupt the 2nd instance to refresh.



Alain

0
Avatar
Permanently deleted user

note that the plugin sdk does not work on intellij installations that do
not contain a JRE (e.g. the .zip/.tar.gz distributions).

This is because the plugin SDK searches for the ]]>/jre and will
not find it.

Alain - is this issue known to you? Is there an override?

Alain Ravet wrote:

Jason,


I suggest you follow those steps :

0/ use Irida (the EAP)
(it will let you develop a plugin for 4.5 if you wish)

1/ install the DevKit SDK
- download and unzip the IDEA-XXX.dev.zip from
http://www.intellij.net/eap/products/idea/download.jsp
- copy the unzipped dir contents to IDEA_HOME, in the dir with the
same name
<unzipped>/help/* --> <IDEA_HOME>/help/
, etc..
=> it will install the javadoc and source for the plugin openAPI.


2/ define a plugin JDK
(!! it's necessary to compile plugin projects)
- IDE settings + (JDK & Global libraries)
- select "Add IntelliJ IDEA SDK + point to your IDEA home
- select a sandbox directory (can be anywhere)
(choose a name like "sandbox-3211")

note: later, you'll define one for IDEA 4.5 the same way)


3/ download the source of a plugin that :
- is very simple
- contains the whole DevKit project (=> you can simply unzip + open
the project + run).

Example:
http://intellij.org/twiki/bin/view/Main/LysosomePlugin
http://intellij.org/twiki/bin/view/Main/ColorChooserPlugin
http://intellij.org/twiki/bin/view/Main/LineUpAndDownMoverPlugin
http://intellij.org/twiki/bin/view/Main/StringEditorPlugin



4/ Compile
(You'll get an error, about the JDK: just choose the one you defined in
2/ above, and recompile)

5/ create a plugin run config (to launch the plugin in a 2nd instance of
IDEA)

- Menu: Run.Edit Config.Plugin
- click on the
- name the config "launch 2nd instance"


6/ run the plugin config you've just defined

note 1: if you chose /Debug/ rather than /Run/, you'll be able to debug
the plugin, while it's running in the 2nd instance)
note 2: It's Hotswappeable => while the 2nd instance in running, you can
change (some) the code of the plugin, and recompile => hotswap => no
need to interrupt the 2nd instance to refresh.



Alain

0

Thanks you VERY much! Exactly what I was looking for...

0
Avatar
Permanently deleted user

Arik

note that the plugin sdk does not work on intellij installations that
do not contain a JRE (e.g. the .zip/.tar.gz distributions).
This is because the plugin SDK searches for the <IDEA_HOME>/jre and
will not find it.
Alain - is this issue known to you? Is there an override?

>

Sorry, I don't know.
I'm on Mac, so I don't have this problem (the JRE is preinstalled in a
standard location).

Alain

0
Avatar
Permanently deleted user

Alain Ravet wrote:

Arik

>> note that the plugin sdk does not work on intellij installations that
>> do not contain a JRE (e.g. the .zip/.tar.gz distributions).
>> This is because the plugin SDK searches for the /jre and >> will not find it. >> Alain - is this issue known to you? Is there an override? >>]]>


Sorry, I don't know.
I'm on Mac, so I don't have this problem (the JRE is preinstalled in a
standard location).

Alain


oh.

perhaps someone from JB can comment on this?

0
Avatar
Permanently deleted user


>

I suggest you follow those steps :

>

JB, please make a screencast of this.


Alain

0
Avatar
Permanently deleted user

Arik Kfir wrote:

note that the plugin sdk does not work on intellij installations that do
not contain a JRE (e.g. the .zip/.tar.gz distributions).

This is because the plugin SDK searches for the <IDEA_HOME>/jre and will
not find it.


Bug report is here: http://www.jetbrains.net/jira/browse/IDEA-1640

Bas

0

Hi Alain,

I'm trying to get this going, and it seems to be set up ok, but when I go to run the plugin it says that tools.jar is not in the classpath and make sure the JAVA_HOME points at the JDK, not the JRE. I looked at the classpath it built from pointing the SDK JVM configuration at the home of the Idea 3316 install and it's got tools.jar in there, so I'm not sure what the problem is. Do I need to set the JAVA_HOME environment variable to point at my Idea 3316 directory?

0
Avatar
Permanently deleted user

This is a bug in 3316, and it's marked as fixed for the next released EAP
build. As a workaround, copy IDEA/jre/lib/tools.jar into IDEA/lib - this
works for me.

Hi Alain,

I'm trying to get this going, and it seems to be set up ok, but when I
go to run the plugin it says that tools.jar is not in the classpath
and make sure the JAVA_HOME points at the JDK, not the JRE. I looked
at the classpath it built from pointing the SDK JVM configuration at
the home of the Idea 3316 install and it's got tools.jar in there, so
I'm not sure what the problem is. Do I need to set the JAVA_HOME
environment variable to point at my Idea 3316 directory?




0

Please sign in to leave a comment.