gradle: reuse io files for init scripts
[idea/community.git] / plugins / gradle / src / org / jetbrains / plugins / gradle / service / task / GradleTaskManager.java
index ab80495306c35701c482449c27cb1ccca9388303..c4bd6f567abf369824c774ef4736a524af2f8d9c 100644 (file)
@@ -107,9 +107,7 @@ public class GradleTaskManager extends AbstractExternalSystemTaskManager<GradleE
 
         if (!initScripts.isEmpty()) {
           try {
-            final File tempFile = FileUtil.createTempFile("init", ".gradle");
-            tempFile.deleteOnExit();
-            FileUtil.writeToFile(tempFile, StringUtil.join(initScripts, SystemProperties.getLineSeparator()));
+            File tempFile = GradleExecutionHelper.writeToFileGradleInitScript(StringUtil.join(initScripts, SystemProperties.getLineSeparator()));
             ContainerUtil.addAll(scriptParameters, GradleConstants.INIT_SCRIPT_CMD_OPTION, tempFile.getAbsolutePath());
           }
           catch (IOException e) {