title: Intellij & Gradle module file name
body: <p>I'm trying to move an existing project to gradle from ant. I'm using Intellij 13, and I've managed to get one module running under gradle by deleting the iml file. However, it insists on writing an iml file that has a name that matches the directory name not the module name. </p>
  
  <p>I recognize that this is probably not a problem for folks who work alone or on a single team in a large company where the IDE and version is handed down from on high. However this project involves a variety of contractors from several companies who all supply their own IDE's. Intellij's licensing model makes it impractical to supply the IDE to outside contractors because most work is done off site and there is no way to take back or de-authorize the license key once you give it out.</p>
  
  <p>Since upgrading Intellij is not free, it's nearly impossible to coordinate everyone to upgrade at once and so I use the file based project format, with a project file named <code>ourproject.ij12.ipr1</code> and another named <code>ourproject.ij13.ipr</code> and the iml files for the module in the directory <code>foo</code> are <code>foo.ij12.iml</code> and <code>foo.ij13.iml</code> </p>
  
  <p>This works great, and the policy is that everyone has until 14 comes out to get off of 12 so that we don't get an infinite number of versions going, but we don't have to synchronize our upgrades too the nanosecond either.</p>
  
  <p>Unfortunately, as soon as I try to use build.gradle in the <code>foo</code> directory in intellij, it writes <code>foo.iml</code> which totally breaks the forgoing conventions. Furthermore, it adds another module (without asking) and that leads to two modules in the same directory and the ide won't let you change either one because two modules in the same directory are an error.</p>
  
  <p>Can anyone tell me how to influence the file name that Intellij writes for the iml file when using gradle? obviously having separate directory names is not going to do it unless I get very elaborate with symlinks and ant.symlinks task, and that won't work if anyone trys to run it natively on windows.</p>
  
  <p><strong>EDIT:</strong> Since folks seem to be in the habit of deleting their unaccepted answers, let me clarify. I am aware of the gradle idea eclipse plugins. I am not asking for a guide to IDE agnosticism. I find there are things of value in IDE setups, and want to share them among others using the same IDE (where "same" includes the version, cross version sharing is not expected, but more than one version at a time is). </p>
  
  <p>To be more specific, I am looking for one of these:</p>
  
  <ul>
  <li>A configuration or trick that allows me to control the file names of iml files</li>
  <li>Another way to maintain two versions of ide files, that is not too byzantine. </li>
  <li>Confirmation from one of the JetBrains folks who participates in SO that there is no longer a way accomplish my goal with IDEA.</li>
  </ul>
  
  <p><strong>EDIT2:</strong> Solutions involving gradle generating the files are not going to work. Intellij 13 <strong>changes</strong> the file name to match the directory name not the module name, which is the soruce of the problem. I need a solution that convinces <em>Intellij</em> not to do that. <strong>I had no problems before the upgrade to 13.</strong></p>