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.
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.
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.
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.
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.
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
com.intellij.openapi.application.ApplicationInfo
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:
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.
Thank you for all of your help :)