[GRADLE-984] Invalid relative path in IDEA iml on Windows when user home drive != project drive Created: 16/Jun/10  Updated: 04/Jan/13  Resolved: 24/Nov/10

Status: Resolved
Project: Gradle
Affects Version/s: 0.9
Fix Version/s: 0.9-rc-3

Type: Bug
Reporter: Brian Sanders Assignee: Hans Dockter
Resolution: Fixed Votes: 1


 Description   

In building the library references in an IDEA .iml (module) file, org.gradle.plugins.idea.model.Path attempts to build a relative path from the project directory to the user's .gradle/cache directory.
On Windows, when the drive specs of the two paths differ (C: vs. D: ) no relative path can be constructed.

Example:
User home directory is c:\Users\userx\.gradle
Project directory is d:\Projects\MyProject

Expected outcome:
Module file should contain library entries of the form:

<library>
  <CLASSES>
    <root url="jar://c:/Users/userx/.gradle/cache/com.foo/bar/jars/bar-1.0.jar!/"/>
  </CLASSES>
  <JAVADOC/>
  <SOURCES/>
</library>

Current outcome:
Module file contains (invalid) relative references:

<library>
  <CLASSES>
    <root url="jar://$MODULE_DIR$/../../Users/userx/.gradle/cache/com.foo/bar/jars/bar-1.0.jar!/"/>
  </CLASSES>
  <JAVADOC/>
  <SOURCES/>
</library>

Generated at Wed Jun 30 11:43:55 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.