diff options
author | Adriaan Moors <adriaan@lightbend.com> | 2016-07-26 11:12:33 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-26 11:12:33 -0700 |
commit | 7102f643a9670e7c1b12a23375eba27e4359d0a0 (patch) | |
tree | a76668307ac45cf115e9b57288c073f2db0a9bc0 | |
parent | 4bc9ca51a4b016bdb9c24a7bcb776ae8d5de9436 (diff) | |
parent | 3205091c5530b41072dc0624a3362809bdadf6ee (diff) | |
download | scala-7102f643a9670e7c1b12a23375eba27e4359d0a0.tar.gz scala-7102f643a9670e7c1b12a23375eba27e4359d0a0.tar.bz2 scala-7102f643a9670e7c1b12a23375eba27e4359d0a0.zip |
Merge pull request #5299 from mpociecha/improve-intellij-integration
Improve sbt-based IntelliJ integration in case of Windows
-rw-r--r-- | build.sbt | 6 | ||||
-rw-r--r-- | project/plugins.sbt | 4 | ||||
-rw-r--r-- | src/intellij/README.md | 2 |
3 files changed, 8 insertions, 4 deletions
@@ -935,7 +935,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, @@ -1014,12 +1014,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) { @@ -1044,6 +1046,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 @@ -1061,6 +1064,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" diff --git a/project/plugins.sbt b/project/plugins.sbt index 98ec8f16ed..0a5b8f3dd4 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -11,9 +11,9 @@ enablePlugins(BuildInfoPlugin) // configure sbt-buildinfo to send the externalDependencyClasspath to the main build, which allows using it for the IntelliJ project config -lazy val buildClasspath = taskKey[String]("Colon-separated list of entries on the sbt build classpath.") +lazy val buildClasspath = taskKey[String]("Colon-separated (or semicolon-separated in case of Windows) list of entries on the sbt build classpath.") -buildClasspath := (externalDependencyClasspath in Compile).value.map(_.data).mkString(":") +buildClasspath := (externalDependencyClasspath in Compile).value.map(_.data).mkString(java.io.File.pathSeparator) buildInfoKeys := Seq[BuildInfoKey](buildClasspath) diff --git a/src/intellij/README.md b/src/intellij/README.md index 650d91e5d1..7bd990288b 100644 --- a/src/intellij/README.md +++ b/src/intellij/README.md @@ -17,7 +17,7 @@ are ignored. ## Dependencies -For every module in the IntelliJ project there is a corresponding `-deps` library, for exmaple `compiler-deps` provides `ant.jar` for the compiler codebase. +For every module in the IntelliJ project there is a corresponding `-deps` library, for example `compiler-deps` provides `ant.jar` for the compiler codebase. The `.jar` files in these `-deps` libraries can be easily kept up-to-date by running `sbt intellij` again. This is necessary whenever the dependencies in the sbt build change, for example when the `starr` version is updated. |