6 comments
Comment actions Permalink

Is there a way for plugins to determine the version of idea they are running in at startup?

Don't know for the OpenAPI, but if you have a complete(clean) install,
than in your ${idea.home} there should be a 'build.txt' file with the
build number of the distribution.

Ahmed.

0
Comment actions Permalink

Thanx Ahmed,

I was looking for a way to determine the version at runtime, though. I have a plugin for which i would like to load different adpator classes depending on the version of idea being used so i can create one plugin that supports all versions.

Cheers
Bronwen

0
Comment actions Permalink

com.intellij.openapi.application.ApplicationInfo

0
Comment actions Permalink

Bronwen, I think the best way to do this is to release multiple versions of the
plugin with different since-build and until-build fields in the plugin.xml.

Bronwen Cassidy wrote:

Thanx Ahmed,

I was looking for a way to determine the version at runtime, though. I have a plugin for which i would like to load different adpator classes depending on the version of idea being used so i can create one plugin that supports all versions.

Cheers
Bronwen

0
Comment actions Permalink

Bronwen, I think the best way to do this is to
release multiple versions of the
plugin with different since-build and until-build
fields in the plugin.xml.


Using ApplicationInfo.getInstance().getBuildNumber() to determine which plugin implementation to load can reduce maintenance costs. I used this in a plugin which had to support IDEA 4.0 and 4.5 simultaneously, with quite a lot of common code.

0
Comment actions Permalink

Thank you for all of your help :)

0

Please sign in to leave a comment.