Skip to content

Commit

Permalink
Fix filtering of core libraries when using SBT 0.13.0 and Scala != 2.…
Browse files Browse the repository at this point in the history
…10.2

Before 0.13.0, we *always* used to get JARs from the boot directory; now we
only seem to get these if we use the same Scala version as SBT itself (2.10.2).

This commit relaxes the filtering to handle both naming conventions.
  • Loading branch information
retronym authored and mpeltonen committed Oct 7, 2013
1 parent 67ee9f0 commit 5133642
Show file tree
Hide file tree
Showing 13 changed files with 112 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/scala/org/sbtidea/SbtIdeaModuleMapping.scala
Expand Up @@ -8,7 +8,7 @@ object SbtIdeaModuleMapping {

def toIdeaLib(instance: ScalaInstance) = {
val coreJars = instance.jars.filter { jar =>
Seq("compiler", "library", "reflect").map("scala-%s.jar" format _).exists(_ == jar.getName)
Seq("compiler", "library", "reflect").exists(x => jar.getName.contains(x))
}.toSet
val id = "scala-" + instance.version
IdeaLibrary(id, "SBT: scala:" + instance.version, id, coreJars,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

@@ -0,0 +1,30 @@
<module version="4" type="JAVA_MODULE">
<component name="FacetManager">
<facet name="Scala" type="scala">
<configuration>
<option value="Project" name="compilerLibraryLevel"/>
<option value="SBT: scala:2.10.3" name="compilerLibraryName"/>
<option value="Scala 2.10" name="languageLevel"/>
<option value="true" name="fsc"/>
<option value="" name="compilerOptions"/>
</configuration>
</facet>
</component>
<component inherit-compiler-output="false" name="NewModuleRootManager">
<output url="file://$MODULE_DIR$/../target/scala-2.10/classes"/>
<output-test url="file://$MODULE_DIR$/../target/scala-2.10/test-classes"/>
<exclude-output/>
<content url="file://$MODULE_DIR$/../">
<sourceFolder isTestSource="false" url="file://$MODULE_DIR$/../src/main/scala"/>
<sourceFolder isTestSource="false" url="file://$MODULE_DIR$/../src/main/java"/>
<sourceFolder isTestSource="false" url="file://$MODULE_DIR$/../src/main/resources"/>
<sourceFolder isTestSource="true" url="file://$MODULE_DIR$/../src/test/scala"/>
<sourceFolder isTestSource="true" url="file://$MODULE_DIR$/../src/test/java"/>
<sourceFolder isTestSource="true" url="file://$MODULE_DIR$/../src/test/resources"/>
<excludeFolder url="file://$MODULE_DIR$/../target"/>
</content>
<orderEntry type="inheritedJdk"/>
<orderEntry forTests="false" type="sourceFolder"/>
<orderEntry level="project" name="SBT: org.scala-lang:scala-library:2.10.3" type="library"/>
</component>
</module>
2 changes: 2 additions & 0 deletions src/sbt-test/sbt-idea/simple-project-2.10.3/README.txt
@@ -0,0 +1,2 @@
This project has a different version of Scala to SBT 0.13.0, which
triggers bug #248.
11 changes: 11 additions & 0 deletions src/sbt-test/sbt-idea/simple-project-2.10.3/project/Build.scala
@@ -0,0 +1,11 @@
import org.sbtidea.test.util.AbstractScriptedTestBuild
import sbt._
import sbt.Keys._
import org.sbtidea.SbtIdeaPlugin._

object ScriptedTestBuild extends AbstractScriptedTestBuild("simple-project") {

lazy val root = Project("main", file("."), settings = Defaults.defaultSettings ++ scriptedTestSettings ++ Seq(
scalaVersion := "2.10.3"
))
}
@@ -0,0 +1,2 @@
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.6.0-SNAPSHOT")

2 changes: 2 additions & 0 deletions src/sbt-test/sbt-idea/simple-project-2.10.3/test
@@ -0,0 +1,2 @@
> gen-idea
> assert-expected-xml-files

0 comments on commit 5133642

Please sign in to comment.