Is there a way to build a plugin with a script (ant, gradle)

Hi,

I would like to prepare a plugin to be packaged. I know there is an UI action for that "Build > Prepare Plugin Module ..."
However I would like to be able to run a script instead.

There are several reason for that,
- one is to be able to compile the project with some continuous integration server,
- another is that I need to package in zip file native libs, which is not supported by IntelliJ IDEA.

Thanks in advance for any information.

5 comments
Comment actions Permalink

It is just a ZIP file so you can use the script of your choice (we use maven at work). Just put all jars inside yourpluginname/lib in the ZIP file and make sure that META-INF/plugin.xml ends up in one of your jars.

If you use IntelliJ UI forms in your plugin you will have to compile them with the javac2 task. Example with maven/ant:

    <taskdef name="javac2" classname="com.intellij.uiDesigner.ant.Javac2" classpathref="plugin.classpath" />
    <javac2 srcdir="${basedir}/src" destdir="${basedir}/target/classes" classpathref="plugin.classpath" />

0
Comment actions Permalink

Hello,

you can use Build | 'Generate Ant Build' action to generate a build.xml file for your project. The generated ant script will contain a target to build
the plugin jar.

--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

Here is the one I use to build mine.

I just hacked it together. It isn't an example of a well written build file, but maybe it will help you write yours.

https://bitbucket.org/sylvanaar2/lua-for-idea/src/de1d5558bd07/idlua-8-15.xml

0
Comment actions Permalink

That's great, thanks.

Now that gralde is out, that would be nice to have gradle support as well.
Anyway thanks for the help :)

Brice

0
Comment actions Permalink

By the way, here's my custom build script. It's based on the generated file from IntelliJ (OSX).

https://bitbucket.org/bric3/jd-intellij/src/4d206b67f8af/jd-intellij.xml
https://bitbucket.org/bric3/jd-intellij/src/4d206b67f8af/module_jd-intellij.xml

https://bitbucket.org/bric3/jd-intellij/src

I will probably customize it further, in order to be able to use it on Windows and Linux as well.

Thanks for the help :)

0

Please sign in to leave a comment.