Path variable expanded in IML file
Hi All,
I'm working on a multi-module project using IDEA 4.5.3 #2250 (on Windows 2000) and have run into a problem related to path variables.
One of the module files used in the project is maintained by a separate development group and as such is shared on a read-only basis via a source control system (ClearCase).
To facilitate sharing, we have agreed between us to use a path variable, OPSCO_BUILD, to define the root of a particular library URL
Extract from read-only .iml file
In my Path Variables window, I can see the following mapping:
Name Value
OPSCO_BUILD O:\
and in the path.macros.xml config file I have the associated entry:
All seemingly fine so far.....except when I open the project, IDEA generates a succession of prompts to check out the read-only .iml file from the source control system so that it can change it.
With further investigation (using a writeable copy of the .iml file) it seems that IDEA wants to expand the use of the Path Variable as follows:
]]>
Anyone know why IDEA needs to do this especially when the .iml file contains other 'internal' path variables, like $MODULE_DIR$, which remain unaffected ?
Is this a bug ?
Thanks in advance for any help,
Gary Janes
Please sign in to leave a comment.
It seems the problem is how "root-dir" path variables are saved.
I had the same problem until I hacked path.macros.xml by removing the trailing slash: "T:/" => "T:".
Now everything works fine for me. :)
Apparently IDEA adds trailing slash only to "root-dir" variables. That leads to double slashes in expanded path. So IDEA tries to "fix" it and wants to write to the file.
I must have submitted a request to Tracker about the issue but do not remember the ID, sorry. But the same problem (and the same workaround) is described here: http://intellij.net/tracker/idea/viewSCR?publicId=35396
Thanks for your help Dmitry.
The hacking of path.macro.xml seems to work fine for other developers here, but for some reason on my machine IDEA always overwrites the file with a new empty default copy of the file and the only way I can set up path variables is via the GUI.....which of course appends the trailing slash that's causing the original problem.
IDEA's anyone ?
Gary Janes wrote:
It's a long shot, but try shutting down IDEA before editing the
path.macros.xml file.
Ciao,
Gordon
Thanks Gordon, but this was very first thing that sprang to mind.....and it made no difference.
Gary