How To Move Module Dependencies Up Programmatically

Does any one know how to move dependencies up (like can be done on the gui under ProjectSettings->Modules->Dependencies->Move Up (or Down).

I have be able to add modules to the library no problem, I just can't move them up in the classpath.

I have tried using Library.ModifiableModel.moveRootUp(String,OrderRootType.CLASSES), but it does not seem to do anything.

Your help is greatly appreciated.

Darren

2 comments
Comment actions Permalink

Hello Darren,

Does any one know how to move dependencies up (like can be done on the
gui under ProjectSettings->Modules->Dependencies->Move Up (or Down).

I have be able to add modules to the library no problem, I just can't
move them up in the classpath.

I have tried using
Library.ModifiableModel.moveRootUp(String,OrderRootType.CLASSES), but
it does not seem to do anything.

Your help is greatly appreciated.


The correct API to use is ModuleRootManager.getInstance(module).getModifiableModel().rearrangeOrderEntries().

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Thanks,

This did not work exactly as I wanted but it did point me in the right direction. I ended up using the rearrangeOrderEntries from the modifiableRootModel that is passed into my class (it extends JavaModuleBuilder).

Darren

0

Please sign in to leave a comment.