Skip to content

Commit

Permalink
simplify: get output dir from srcEntries rather than srcDirectories
Browse files Browse the repository at this point in the history
  • Loading branch information
philwalk committed Nov 16, 2017
1 parent 03fb0e9 commit b4d909c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
15 changes: 5 additions & 10 deletions src/main/scala-sbt-0.13/com/typesafe/sbteclipse/core/Eclipse.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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) ++
Expand Down
15 changes: 5 additions & 10 deletions src/main/scala-sbt-1.0/com/typesafe/sbteclipse/core/Eclipse.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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) ++
Expand Down

0 comments on commit b4d909c

Please sign in to comment.