mirror of https://github.com/sbt/sbt.git
parent
568d64ef1c
commit
f45a076241
|
|
@ -61,7 +61,7 @@ abstract class ModuleReportExtra {
|
|||
s"\t\t- ${module.revision}\n" +
|
||||
(if (arts.size <= 1) "" else arts.mkString("\t\t\t", "\n\t\t\t", "\n")) +
|
||||
reportStr("status", status) +
|
||||
reportStr("publicationDate", publicationDate map { _.toString }) +
|
||||
reportStr("publicationDate", publicationDate map calendarToString) +
|
||||
reportStr("resolver", resolver) +
|
||||
reportStr("artifactResolver", artifactResolver) +
|
||||
reportStr("evicted", Some(evicted.toString)) +
|
||||
|
|
@ -96,6 +96,11 @@ abstract class ModuleReportExtra {
|
|||
s"\t\t\t$key: $x\n"
|
||||
} getOrElse ""
|
||||
|
||||
private[this] def calendarToString(c: ju.Calendar): String = {
|
||||
import sjsonnew._, BasicJsonProtocol._
|
||||
implicitly[IsoString[ju.Calendar]] to c
|
||||
}
|
||||
|
||||
def retrieve(f: (ModuleID, Artifact, File) => File): ModuleReport =
|
||||
copy(artifacts = artifacts.map { case (art, file) => (art, f(module, art, file)) })
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ class UpdateReportSpec extends FlatSpec with Matchers {
|
|||
| compile:
|
||||
| org:name
|
||||
| - 1.0
|
||||
| publicationDate: 1970-01-01T00:00:00Z
|
||||
| evicted: false
|
||||
|
|
||||
|""".stripMargin.drop(1))
|
||||
|
|
@ -32,10 +33,18 @@ class UpdateReportSpec extends FlatSpec with Matchers {
|
|||
Vector(organizationArtifactReport)
|
||||
)
|
||||
|
||||
lazy val moduleReport =
|
||||
lazy val moduleReport = (
|
||||
ModuleReport(ModuleID("org", "name", "1.0"), Vector.empty, Vector.empty)
|
||||
withPublicationDate Some(epochCalendar)
|
||||
)
|
||||
|
||||
lazy val organizationArtifactReport =
|
||||
OrganizationArtifactReport("org", "name", Vector(moduleReport))
|
||||
|
||||
val epochCalendar: java.util.Calendar = {
|
||||
val utc = java.util.TimeZone getTimeZone "UTC"
|
||||
val c = new java.util.GregorianCalendar(utc, java.util.Locale.ENGLISH)
|
||||
c setTimeInMillis 0L
|
||||
c
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue