diff --git a/src/main/scala/sbtbuildinfo/ScalaRenderer.scala b/src/main/scala/sbtbuildinfo/ScalaRenderer.scala index 2be9568..b992837 100644 --- a/src/main/scala/sbtbuildinfo/ScalaRenderer.scala +++ b/src/main/scala/sbtbuildinfo/ScalaRenderer.scala @@ -23,6 +23,8 @@ abstract class ScalaRenderer extends BuildInfoRenderer { case TypeExpression("sbt.librarymanagement.ModuleID", Nil) => Some("String") case TypeExpression("sbt.librarymanagement.Resolver", Nil) => Some("String") + case TypeExpression("sbt.internal.util.Attributed", Seq(TypeExpression("java.io.File", Nil))) => Some("java.io.File") + case TypeExpression("scala.Option", Seq(arg)) => tpeToReturnType(arg) map { x => s"scala.Option[$x]" } case TypeExpression("scala.collection.Seq", Seq(arg)) => @@ -52,6 +54,7 @@ abstract class ScalaRenderer extends BuildInfoRenderer { case op: Option[_] => op map { x => "scala.Some(" + quote(x) + ")" } getOrElse {"scala.None"} case url: java.net.URL => "new java.net.URL(%s)" format quote(url.toString) case file: java.io.File => "new java.io.File(%s)" format quote(file.toString) + case attr: sbt.Attributed[_] => quote(attr.data) case s => "\"%s\"" format encodeStringLiteral(s.toString) } diff --git a/src/sbt-test/sbt-buildinfo/simple/build.sbt b/src/sbt-test/sbt-buildinfo/simple/build.sbt index def2e76..00b674d 100644 --- a/src/sbt-test/sbt-buildinfo/simple/build.sbt +++ b/src/sbt-test/sbt-buildinfo/simple/build.sbt @@ -6,6 +6,7 @@ lazy val root = (project in file(".")). name := "helloworld", version := "0.1", scalaVersion := "2.11.8", + TaskKey[Classpath]("someCp") := Seq(Attributed.blank(file("/tmp/f.txt"))), buildInfoKeys := BuildInfoKey.ofN( name, BuildInfoKey.map(version) { case (n, v) => "projectVersion" -> v.toDouble }, @@ -18,6 +19,7 @@ lazy val root = (project in file(".")). "year" -> 2012, "sym" -> 'Foo, BuildInfoKey.action("buildTime") { 1234L }, + TaskKey[Classpath]("someCp"), target ), buildInfoPackage := "hello", @@ -57,6 +59,8 @@ lazy val root = (project in file(".")). """ val sym: scala.Symbol = 'Foo""" :: """ /** The value is 1234L. */""" :: """ val buildTime: scala.Long = 1234L""" :: + """ /** The value is scala.collection.Seq(new java.io.File("/tmp/f.txt")). */""" :: + """ val someCp: scala.collection.Seq[java.io.File] = scala.collection.Seq(new java.io.File("/tmp/f.txt"))""" :: targetInfoComment :: targetInfo :: // """ """ override val toString: String = {""" ::