Use same system property to avoid deleting module file in JPS and Gradle

This commit is contained in:
Alexey Tsvetkov
2018-08-01 00:12:29 +03:00
parent d3dbcae7a4
commit d09629972a
3 changed files with 7 additions and 13 deletions
@@ -111,15 +111,10 @@ internal class GradleCompilerRunner(private val project: Project) : KotlinCompil
args.destination = null
}
var deleteBuildFile = true
try {
val res = runCompiler(K2JVM_COMPILER, args, environment)
deleteBuildFile = (res == ExitCode.OK || System.getProperty("kotlin.compiler.leave.module.file.on.error") == null)
return res
}
finally {
if (deleteBuildFile) {
return runCompiler(K2JVM_COMPILER, args, environment)
} finally {
if (System.getProperty(DELETE_MODULE_FILE_PROPERTY) != "false") {
buildFile.delete()
}
}