I need to update an existing library entry that has been added to a module. I obtain the Library using the LibraryTable from the ModifiableRootModel for the module:
final ModifiableRootModel modifiableModel = ModuleRootManager.getInstance(module).getModifiableModel();
To make the change I delete the library entry from the libraryTable and then create it again:
The problem I am facing with this approach is that the library order and the selection of the library being exported (under module settings -> dependecies) are not retained. The new lib is added at the end of the module dependencies.
Is there a way I can keep these configurations (lib order and export) unchanged or access them and add them to the new library while creating it ?
You can find the exact usage here.