Skip to content

Commit

Permalink
Merge pull request #355 from philwalk/eclipseOutput
Browse files Browse the repository at this point in the history
extended scope of eclipseOutput setting to override eclipse bin default
  • Loading branch information
benmccann authored Nov 16, 2017
2 parents 4ca826b + b4d909c commit 3d7da89
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ out/

# Mac
.DS_Store

# Vim
*.swp
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,17 @@ private object Eclipse extends EclipseSDTConfig {
srcEntries <- srcEntriesIoSeq.toList.sequence;
linkEntries <- srcLinkEntriesIoSeq.toList.sequence
) yield {
def classDirectory = srcEntries.flatMap { _.output }.distinct match {
case Nil =>
"bin"
case dir :: _ =>
dir
}
val entries = srcEntries ++ linkEntries ++
(projectDependencies map EclipseClasspathEntry.Project) ++
(externalDependencies map libEntry(buildDirectory, baseDirectory, relativizeLibs, state)) ++
(Seq(jreContainer) map EclipseClasspathEntry.Con) ++
(Seq("bin") map EclipseClasspathEntry.Output)
(Seq(classDirectory) map EclipseClasspathEntry.Output)
<classpath>{ entries map (_.toXml) }</classpath>
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,17 @@ private object Eclipse extends EclipseSDTConfig {
srcEntries <- srcEntriesIoSeq.toList.sequence;
linkEntries <- srcLinkEntriesIoSeq.toList.sequence
) yield {
def classDirectory = srcEntries.flatMap { _.output }.distinct match {
case Nil =>
"bin"
case dir :: _ =>
dir
}
val entries = srcEntries ++ linkEntries ++
(projectDependencies map EclipseClasspathEntry.Project) ++
(externalDependencies map libEntry(buildDirectory, baseDirectory, relativizeLibs, state)) ++
(Seq(jreContainer) map EclipseClasspathEntry.Con) ++
(Seq("bin") map EclipseClasspathEntry.Output)
(Seq(classDirectory) map EclipseClasspathEntry.Output)
<classpath>{ entries map (_.toXml) }</classpath>
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/sbt-test/sbteclipse/02-contents/tasks.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ TaskKey[Unit]("verify-classpath-xml-subc") := {
error("""Expected .classpath of subc project to contain <classpathentry kind="con" path="org.scala-ide.sdt.launching.SCALA_CONTAINER"/> """)
if (!(classpath.child contains <classpathentry kind="lib" path="libs/my.jar"/>))
error("""Expected .classpath of subc project to contain <classpathentry kind="lib" path="libs/my.jar"/>!""")
if (!(classpath.child contains <classpathentry kind="output" path=".target" />))
error("""Expected .classpath of subc project to contain <classpathentry kind="output" path=".target" /> """)
if (!(project.child contains <foo bar="baz"/>))
error("""Expected .project of subc project to contain <foo bar="baz"/>!""")
}
Expand Down

0 comments on commit 3d7da89

Please sign in to comment.