From d1a27aed16db521cdc43f57ed5e43773d57c25df Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Thu, 19 Nov 2015 10:33:31 -0800 Subject: [PATCH] Make the tmp file created for jjs scripts be deleted when gradle exits --- .../main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy index a0a6c1cb7bc..013cdcc43ba 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy @@ -151,7 +151,8 @@ class BuildPlugin implements Plugin { /** Runs the given javascript using jjs from the jdk, and returns the output */ private static String runJavascript(Project project, String javaHome, String script) { - File tmpScript = File.createTempFile('es-gradle-tmp', '.js'); + File tmpScript = File.createTempFile('es-gradle-tmp', '.js') + tmpScript.deleteOnExit() tmpScript.setText(script, 'UTF-8') ByteArrayOutputStream output = new ByteArrayOutputStream() project.exec {