From 32a3ef704c198da692c1985bae55aca5130ad9c6 Mon Sep 17 00:00:00 2001 From: Tobias Roeser Date: Wed, 23 Oct 2019 10:37:13 +0200 Subject: Clean old IDEA files after we scuccessfully analyzed the modules That way, we can keep an existing IDEA project in case of a failure. --- scalalib/src/GenIdeaImpl.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scalalib/src/GenIdeaImpl.scala b/scalalib/src/GenIdeaImpl.scala index 5be21de6..9280949d 100755 --- a/scalalib/src/GenIdeaImpl.scala +++ b/scalalib/src/GenIdeaImpl.scala @@ -47,12 +47,14 @@ case class GenIdeaImpl(evaluator: Evaluator, val pp = new scala.xml.PrettyPrinter(999, 4) val jdkInfo = extractCurrentJdk(cwd / ".idea" / "misc.xml").getOrElse(("JDK_1_8", "1.8 (1)")) + ctx.log.info("Analyzing modules ...") + val layout = xmlFileLayout(evaluator, rootModule, jdkInfo, Some(ctx)) + + ctx.log.debug("Cleaning obsolete IDEA project files ...") os.remove.all(cwd/".idea"/"libraries") os.remove.all(cwd/".idea"/"scala_compiler.xml") os.remove.all(cwd/".idea_modules") - ctx.log.info("Analyzing modules ...") - val layout = xmlFileLayout(evaluator, rootModule, jdkInfo, Some(ctx)) ctx.log.info("Writing IDEA project files ...") for((relPath, xml) <- layout) { os.write.over(cwd/relPath, pp.format(xml), createFolders = true) -- cgit v1.2.3