Skip to content

Commit

Permalink
take scala version classifier into account when crossPath is true (fixes
Browse files Browse the repository at this point in the history
 #1)
  • Loading branch information
jrudolph committed Nov 18, 2011
1 parent 7286764 commit 2520dc2
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/main/scala/net/virtualvoid/sbt/graph/Plugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,26 @@ import sbt._
import Keys._

object Plugin extends sbt.Plugin {
val dependencyGraphTask = TaskKey[File]("dependency-graph")
val dependencyGraphTask = TaskKey[File]("dependency-graph")

def graphSettings = Seq(
dependencyGraphTask <<= (projectID, appConfiguration, target, streams) map { (projectID, config, target, streams) =>
def graphSettings = Seq(
dependencyGraphTask <<= (projectID, scalaVersion, appConfiguration, target, streams) map { (projectID, scalaVersion, config, target, streams) =>
val home = config.provider.scalaProvider.launcher.ivyHome
val fileName = "%s/cache/%s-%s-compile.xml" format (home, projectID.organization, projectID.name)

val fileName = "%s/cache/%s-%s-compile.xml" format (home, projectID.organization, crossName(projectID, scalaVersion))

val resultFile = target / "dependencies.graphml"
IvyGraphMLDependencies.transform(fileName, resultFile.getAbsolutePath)
streams.log.info("Wrote dependency graph to '%s'" format resultFile)
resultFile
} dependsOn(deliverLocal)
)

def crossName(moduleId: ModuleID, scalaVersion: String) =
moduleId.name + (
if (moduleId.crossVersion)
"_"+scalaVersion
else
""
)
}

0 comments on commit 2520dc2

Please sign in to comment.