Adding configuration to idea module scope after upgrade to Gradle 1.12 fails


(John Ahlroos) #1

My build is currently failing to generate proper idea module files after I upgraded to Gradle 1.12.

Here is my simplified build.gradle:

apply plugin: 'idea'
configurations {
        jooq
}
dependencies {
        jooq 'org.jooq:jooq:3.3.2'
}
idea {
    module {
        scopes.put('MYCONF', ['plus': [ project.configurations.jooq ], 'minus': []])
    }
}

Running the ideaModule task I get the following idea module file (.iml) with Gradle 1.11:

<module relativePaths="true" type="JAVA_MODULE" version="4">
  <component name="NewModuleRootManager" inherit-compiler-output="true">
    <exclude-output/>
    <orderEntry type="inheritedJdk"/>
    <content url="file://$MODULE_DIR$/">
      <excludeFolder url="file://$MODULE_DIR$/build"/>
      <excludeFolder url="file://$MODULE_DIR$/.gradle"/>
    </content>
    <orderEntry type="sourceFolder" forTests="false"/>
    <orderEntry type="module-library" scope="MYCONF">
      <library>
        <CLASSES>
          <root url="file://$MODULE_DIR$/unresolved dependency - org.jooq jooq 3.3.2"/>
        </CLASSES>
        <JAVADOC/>
        <SOURCES/>
      </library>
    </orderEntry>
  </component>
  <component name="ModuleRootManager"/>
</module>

And then after upgrading to Gradle 1.12:

<?xml version="1.0" encoding="UTF-8"?>
<module relativePaths="true" type="JAVA_MODULE" version="4">
  <component name="NewModuleRootManager" inherit-compiler-output="true">
    <exclude-output/>
    <orderEntry type="inheritedJdk"/>
    <content url="file://$MODULE_DIR$/">
      <excludeFolder url="file://$MODULE_DIR$/build"/>
      <excludeFolder url="file://$MODULE_DIR$/.gradle"/>
    </content>
    <orderEntry type="sourceFolder" forTests="false"/>
  </component>
  <component name="ModuleRootManager"/>
</module>

As you can see the module file is correctly configured with 1.11 but when moving to 1.12 it fails to add the configuration as an orderEntry. Looks like this is an regression from http://issues.gradle.org/browse/GRADLE-2017.