I have a javadoc folder I'm trying to attach to an intellij plugin. ModuleRootManager is a class that supports manipulation of the module dependencies.
I managed to get it auto attaching using the ModuleRootManager and creating a path with addRoot("file://$MODULE_DIR$/javadoc-folder/",JavadocOrderRootType.getInstance()) on an instance of Library.ModifiableModel. This adds to the IML:
<root url="file://$MODULE_DIR$/javadoc-folder/" />
It works well on absolute paths, however, when I use $MODULE_DIR$, it doesn't behave as I'd expect. If you look at the attached javadoc, it says that the path is to the literal text $MODULE_DIR$ until you reload intellij. $MODULE_DIR$ doesn't get refreshed / populated with the actual relative module path until intellij is reloaded. Is there any way to force this process under the hood?
(I want to avoid absolute paths in case the user of my plugin commits their project file to source control)
Any thoughts / ideas / help would be greatly appreciated!