Continuous Integration for plugins?

The little bit I've seen about Travis-CI makes me think that it may not work well for IntelliJ plugins (since IntelliJ is huge and the free cacheing seems to not be an option for Travis-CI).

I'd like a way to be notified if IntelliJ changes and my plugin breaks.

11 comments
Comment actions Permalink

Unfortunately right now JetBrains doesn't provide any official continuous integration service for plugin developers. I think your best option is to spin your own VM and to run TeamCity there to build your plugin.

0
Comment actions Permalink

Thanks for the tip, this should help a lot.

0
Comment actions Permalink

If you want to set up Travis CI anyway for your plugin, then let me tell you it can be done. You can for instance use maven and provide a build-script that takes care of everything. An important part to make make it work on Travis is that you have to download the complete IDEA sources everytime you build it on travis.

If you want an example, please look at

https://github.com/halirutan/Mathematica-IntelliJ-Plugin

Cheers
Patrick

0
Comment actions Permalink

Great - that should also be helpful. I have to admit downloading the idea sources every time was what scared me away, but knowing that others are doing it makes it less scary ;\. Also the fact that I probably won't be pushing commits very often helps...

0
Comment actions Permalink

I am using Gradle as an ant wrapper on Jenkins which is working well after some initial problems.

I was also scared away by downloading the IDEA sources for every build as that would take a long itme, so I am using a statically downloaded version. That makes it more susceptible to upgrade bugs but it works for me and provides fast feedback. Here's my build.gradle:

buildscript {   repositories {     mavenCentral()   }   dependencies {     classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '3.0.1')     classpath 'net.saliman:gradle-properties-plugin:1.4.2'   } } repositories {     add buildscript.repositories.getByName("maven-main-cache") } apply plugin: 'java' apply plugin: 'net.saliman.properties' version = '...' group = 'com.example' configurations {   antTask } test {   classpath = project.sourceSets.test.runtimeClasspath + files("${jdk_home}/lib/tools.jar") }
dependencies {   repositories {     mavenCentral()     flatDir dirs: 'lib'   }   compile 'org.jdom:jdom:1.1'   compile fileTree(dir: "${idea_home}/lib", include: '*.jar')   antTask group: 'com.intellij', name: 'javac2', version: '12.1.0'   antTask group: 'com.intellij', name: 'forms_rt', version: '12.1.0'   antTask group: 'com.intellij', name: 'asm-all', version: '12.1.0-idea'   antTask group: 'org.jdom', name: 'jdom', version: '1.1'   testCompile "org.mockito:mockito-core:1.+" } task compileJava(overwrite: true, dependsOn: configurations.compile.getTaskDependencyFromProjectDependency(true, 'jar')) {   doLast {       project.sourceSets.main.output.classesDir.mkdirs()       ant.taskdef name: 'javac2', classname: 'com.intellij.ant.Javac2', classpath: configurations.antTask.asPath       ant.javac2 srcdir: project.sourceSets.main.java.srcDirs.join(':'),       classpath: project.sourceSets.main.compileClasspath.asPath,       destdir: project.sourceSets.main.output.classesDir,       source: sourceCompatibility,       target: targetCompatibility,       includeAntRuntime: false   } } jar {   metaInf {     from ("${rootDir}/META-INF") {       include 'plugin.xml'     }   } }


I am setting the path for the IDEA sources in my gradle.properties:

idea_home=/Applications/IntelliJ\ IDEA\ 14\ CE.app/Contents jdk_home=/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home/ javac2_instrumentation.includeJavaRuntime=false


This is my local configuration and I have another one for my Jenkins server.

Thanks,
Simon

0
Comment actions Permalink

Hi,

You can have a look at the script we are using for the Go plugin.
https://github.com/go-lang-plugin-org/go-lang-idea-plugin/blob/v1.0.0-alpha0/.travis.yml

Usually the builds take around 1 minute to be done, even if we download the whole IDEA community, according to TravisCI: https://travis-ci.org/go-lang-plugin-org/go-lang-idea-plugin/builds

Hope it helps.

0
Comment actions Permalink

Very interesting. While we are talking about it:

It appears that some of the packages were once part of Maven Central (http://mvnrepository.com/artifact/com.intellij) but there have not been any new versions for years. Are there any other repositories that can be used or is the recommended method to just download the tar.gz as Florin has done in the Go build script?

0
Comment actions Permalink

Right now JetBrains doesn't publish the IntelliJ packages to any Maven repository.

0
Comment actions Permalink

Downloading the /latest/ version of IDEA isn't a problem.  That's solved with a wget.  But getting older versions (to keep compatibility) is broken right now.  JetBrains' download site is limiting downloads to the latest release on older code lines. (For example, you can download and build with v14.1.6, but not v14.1.4.  v15.0, 15.0.1, and 15.0.2 are all available right now.)

You can look at http://github.com/tivo/intellij-haxe to see how the Haxe plugin does its continuous integration using Travis CI.  The scripts are all in the root directory.  It's still using Travis' legacy framework, but it works pretty nicely.

0
Comment actions Permalink

Whoops!  Sorry for reviving an old thread.

0
Comment actions Permalink

Don't worry.

Things changed a lot since this happened.
Have a look at https://github.com/go-lang-plugin-org/go-lang-idea-plugin/ or https://github.com/ignatov/intellij-erlang which now use Gradle for testing.
As for older versions of IDEA, I can't speak about, maybe it's worth opening a separate issue on this tracker if the solution from the plugins doesn't work with those older versions?

Hope it helps.

1

Please sign in to leave a comment.