From b4d909ced6311b9e81fe3fb2dea745b423b65e10 Mon Sep 17 00:00:00 2001 From: Phil Walker Date: Thu, 16 Nov 2017 12:41:01 -0700 Subject: [PATCH] simplify: get output dir from srcEntries rather than srcDirectories --- .../com/typesafe/sbteclipse/core/Eclipse.scala | 15 +++++---------- .../com/typesafe/sbteclipse/core/Eclipse.scala | 15 +++++---------- 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/src/main/scala-sbt-0.13/com/typesafe/sbteclipse/core/Eclipse.scala b/src/main/scala-sbt-0.13/com/typesafe/sbteclipse/core/Eclipse.scala index d46b5d77..308e045e 100644 --- a/src/main/scala-sbt-0.13/com/typesafe/sbteclipse/core/Eclipse.scala +++ b/src/main/scala-sbt-0.13/com/typesafe/sbteclipse/core/Eclipse.scala @@ -305,16 +305,11 @@ private object Eclipse extends EclipseSDTConfig { srcEntries <- srcEntriesIoSeq.toList.sequence; linkEntries <- srcLinkEntriesIoSeq.toList.sequence ) yield { - val eclipseOutputDirs: Seq[String] = for { - (fa: File, ta: Option[File]) <- srcDirectories - eclipseOutputPath = ta match { - case Some(dd) => relativize(baseDirectory, dd).toString - case None => "" - } - } yield eclipseOutputPath - val classDirectory = eclipseOutputDirs.filter { _.nonEmpty }.distinct match { - case dir :: _ => dir - case _ => "bin" // this is the eclipse default + def classDirectory = srcEntries.flatMap { _.output }.distinct match { + case Nil => + "bin" + case dir :: _ => + dir } val entries = srcEntries ++ linkEntries ++ (projectDependencies map EclipseClasspathEntry.Project) ++ diff --git a/src/main/scala-sbt-1.0/com/typesafe/sbteclipse/core/Eclipse.scala b/src/main/scala-sbt-1.0/com/typesafe/sbteclipse/core/Eclipse.scala index d4ec003d..bc206c14 100644 --- a/src/main/scala-sbt-1.0/com/typesafe/sbteclipse/core/Eclipse.scala +++ b/src/main/scala-sbt-1.0/com/typesafe/sbteclipse/core/Eclipse.scala @@ -305,16 +305,11 @@ private object Eclipse extends EclipseSDTConfig { srcEntries <- srcEntriesIoSeq.toList.sequence; linkEntries <- srcLinkEntriesIoSeq.toList.sequence ) yield { - val eclipseOutputDirs: Seq[String] = for { - (fa: File, ta: Option[File]) <- srcDirectories - eclipseOutputPath = ta match { - case Some(dd) => relativize(baseDirectory, dd).toString - case None => "" - } - } yield eclipseOutputPath - val classDirectory = eclipseOutputDirs.filter { _.nonEmpty }.distinct match { - case dir :: _ => dir - case _ => "bin" // this is the eclipse default + def classDirectory = srcEntries.flatMap { _.output }.distinct match { + case Nil => + "bin" + case dir :: _ => + dir } val entries = srcEntries ++ linkEntries ++ (projectDependencies map EclipseClasspathEntry.Project) ++