Modifying the project library list

I'm looking into creating a plugin that updates the jars used by a
project. In simple terms it would allow a developer to specify that they
want to use the latest version of library foo and the plugin would keep
the libs up to date. I created a plugin like this for eclipse earlier in
the year now that I'm using intellij more often I would like the same
facilities.

The problem is that I can't see a way of accessing the details of the
libraries being used by the project. Can some one point me in the right
direction?

-k.

1 comment
Comment actions Permalink

Kevin,
sorry for the late response.

Kevin O'Neill wrote:

I'm looking into creating a plugin that updates the jars used by a
project. In simple terms it would allow a developer to specify that they
want to use the latest version of library foo and the plugin would keep
the libs up to date. I created a plugin like this for eclipse earlier in
the year now that I'm using intellij more often I would like the same
facilities.

The problem is that I can't see a way of accessing the details of the
libraries being used by the project. Can some one point me in the right
direction?



Such information is now kept at module level and can be accessed and
modified via ModuleRootManager.

There are "global", "project" and "module" libraries. The former two are
kept in ApplicationLibraryTable and ProjectLibraryTable resp. Modules
reference them by name. The latter are kept in ModuleLibraryTable, which
you can get your hands on via ModifiableRootModel of ModuleRootManager.

You can find out which libraries given module depends on by iterating its
Order (cf ModuleRootManager.getOrder).

Modules included in a project are accessible via ModuleManager.

Hope this helps, do not hesistate to ask further.

Friendly,
Dmitry




--
Dmitry Lomov
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0

Please sign in to leave a comment.