summaryrefslogtreecommitdiff
path: root/build.sbt
diff options
context:
space:
mode:
authorMichał Pociecha <michal.pociecha@gmail.com>2016-07-22 12:11:55 +0200
committerMichał Pociecha <michal.pociecha@gmail.com>2016-07-22 12:13:23 +0200
commit3205091c5530b41072dc0624a3362809bdadf6ee (patch)
treecb6572a342741ba3e521888b06a92773d1cf4448 /build.sbt
parent6b99dfe746cbb76828db495b58e55db2a0265ee2 (diff)
downloadscala-3205091c5530b41072dc0624a3362809bdadf6ee.tar.gz
scala-3205091c5530b41072dc0624a3362809bdadf6ee.tar.bz2
scala-3205091c5530b41072dc0624a3362809bdadf6ee.zip
Improve sbt-based IntelliJ integration in case of Windows
Use File.pathSeparator when processing classpath instead of just : to don't end up with classpath like "C:\sth\a.jar:C:\sth\b.jar" what was causing problems after split(":"). Display questions first and then wait for user input. I tested on 3 computes and without flush the printed questions were always displayed just after user replied - never before.
Diffstat (limited to 'build.sbt')
-rw-r--r--build.sbt6
1 files changed, 5 insertions, 1 deletions
diff --git a/build.sbt b/build.sbt
index 1d4e208da2..e53f15a332 100644
--- a/build.sbt
+++ b/build.sbt
@@ -936,7 +936,7 @@ intellij := {
val modules: List[(String, Seq[File])] = {
// for the sbt build module, the dependencies are fetched from the project's build using sbt-buildinfo
- val buildModule = ("scala-build", scalabuild.BuildInfo.buildClasspath.split(":").toSeq.map(new File(_)))
+ val buildModule = ("scala-build", scalabuild.BuildInfo.buildClasspath.split(java.io.File.pathSeparator).toSeq.map(new File(_)))
// `sbt projects` lists all modules in the build
buildModule :: List(
moduleDeps(compilerP).value,
@@ -1015,12 +1015,14 @@ intellij := {
var continue = false
if (!ipr.exists) {
scala.Console.print(s"Could not find src/intellij/scala.ipr. Create new project files from src/intellij/*.SAMPLE (y/N)? ")
+ scala.Console.flush()
if (scala.Console.readLine() == "y") {
intellijCreateFromSample((baseDirectory in ThisBuild).value)
continue = true
}
} else {
scala.Console.print("Update library classpaths in the current src/intellij/scala.ipr (y/N)? ")
+ scala.Console.flush()
continue = scala.Console.readLine() == "y"
}
if (continue) {
@@ -1045,6 +1047,7 @@ lazy val intellijFromSample = taskKey[Unit]("Create fresh IntelliJ project files
intellijFromSample := {
val s = streams.value
scala.Console.print(s"Create new project files from src/intellij/*.SAMPLE (y/N)? ")
+ scala.Console.flush()
if (scala.Console.readLine() == "y")
intellijCreateFromSample((baseDirectory in ThisBuild).value)
else
@@ -1062,6 +1065,7 @@ lazy val intellijToSample = taskKey[Unit]("Update src/intellij/*.SAMPLE using th
intellijToSample := {
val s = streams.value
scala.Console.print(s"Update src/intellij/*.SAMPLE using the current IntelliJ project files (y/N)? ")
+ scala.Console.flush()
if (scala.Console.readLine() == "y") {
val basedir = (baseDirectory in ThisBuild).value
val existing = basedir / "src/intellij" * "*.SAMPLE"