How to package third-party binaries inside deployed plugin?

Hi,

I'm currently the following situation:

One of my plugins uses some third-party binaries (dlv, a deductive database system; binaries for windows and linux), which i want to bundle inside the deployed plugin. Now, thinking of Eclispe (which I was used to, but kinda bored of) allowed me to add such files to the plugin build path which resulted in them being available in the installed plugin afterwards. I'm trying to find something similar for Intellij plugins, but so far, I couldn't figure out how to add such third-party dependencies to the plugin (see below for a rudimentary schematic).


plugin during development

someName
     META-INF
     dlv                         <-- contains the executables and should be added to the deployed plugin as pictured below
          winExec.exe
          uxExec.bin
     lib
     src
     ...

deployed plugin

someName
     classes
     dlv                         <--- ideally contains dlv executables

          winExec.exe
          uxExec.bin


     lib
     META-INF


So far I tried to do it with artifacts, however, I did not suceed. Is there any easy way to get this done?

Thanks in advance,

Phil
10 comments
Comment actions Permalink

Using artifacts is actually one of the correct approaches for customizing the structure of a deployed plugin. Why exactly didn't you succeed?

Another option is to build the zip file of the deployed plugin using an Ant or Gradle build script.

0
Comment actions Permalink

Ok, great! I added a new Artifact of type "other". Next, I add the output root (in this case i select plugin someName from the list of available modules on the right side) to be someName and add a new folder the shall contain the copies of the files. However, I assume this is wrong, as the deployed plugin contains nothing. I think, being stuck at defining how to pack and where to deploy best descirbes my problem.

Thx,

phil

0
Comment actions Permalink

If you have configured an artifact for your plugin, the "Prepare plugin module for deployment" action will not do anything differently from what it normally does. You need to use the "Build Artifacts..." action to build a distributable archive of your plugin.

I've just tried configuring this, and it works correctly. I've attached my artifact configuration.



Attachment(s):
artifactConfiguration.png
0
Comment actions Permalink

hm, the artifact is build, but however, the files are not in the plugin, depsite what
actions i call in which order (Build artifacts included). btw, does adding an artifact mean, that the default pluign build process is not supported anymore? isn't it possible to just add an additional folder in the resulting plugin instead of defining the complete output structure on your own?


phil

0
Comment actions Permalink

Yes. The artifact replaces the standard build process for plugins.

0
Comment actions Permalink

ok, as edited before, the artifact is built but what then? is there any documentation on this? h

0
Comment actions Permalink

Then you upload it to the plugin repository just like you do with a plugin zip file built using the "Prepare plugin for deployment" action.

0
Comment actions Permalink

ok, my artifacts are built, i can also build the plugin, but how do i get the built artifact (and its plugins) into the plugin sandbox to test them? as soon as i hit the run button, an instance is started, my plugins are used, but yet, the folder in question is not there.

0
Comment actions Permalink

For running a plugin inside an IDE, this whole process is not used at all. All you need to do is make sure that your "dlv" directory is under a source root and the extensions of the files in it are included in the list of resource patterns under Settings | Compiler.

0
Comment actions Permalink

hm, thought about that, but didnt i consider as a clean solution. will do it so though. thanks for the help.

0

Please sign in to leave a comment.