summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Roeser <le.petit.fou@web.de>2019-10-23 10:37:13 +0200
committerTobias Roeser <le.petit.fou@web.de>2019-10-23 10:38:14 +0200
commit32a3ef704c198da692c1985bae55aca5130ad9c6 (patch)
tree05a79a07177522b450636df26b39f0b5373285d9
parentc1ee2605a28368ef93e7aeebcb5256f17fca2685 (diff)
downloadmill-32a3ef704c198da692c1985bae55aca5130ad9c6.tar.gz
mill-32a3ef704c198da692c1985bae55aca5130ad9c6.tar.bz2
mill-32a3ef704c198da692c1985bae55aca5130ad9c6.zip
Clean old IDEA files after we scuccessfully analyzed the modules
That way, we can keep an existing IDEA project in case of a failure.
-rwxr-xr-xscalalib/src/GenIdeaImpl.scala6
1 files 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)