mirror of https://github.com/sbt/sbt.git
logging for packaging
This commit is contained in:
parent
0123351a8f
commit
e0b453225e
|
|
@ -71,7 +71,9 @@ object Package
|
|||
val sources :+: _ :+: manifest :+: HNil = inputs
|
||||
outputChanged(cacheFile / "output") { (outChanged, jar: PlainFileInfo) =>
|
||||
if(inChanged || outChanged)
|
||||
makeJar(sources.toSeq, jar.file, manifest)
|
||||
makeJar(sources.toSeq, jar.file, manifest, log)
|
||||
else
|
||||
log.debug("Jar uptodate: " + jar.file)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -85,13 +87,16 @@ object Package
|
|||
if(main.getValue(version) eq null)
|
||||
main.put(version, "1.0")
|
||||
}
|
||||
def makeJar(sources: Seq[(File, String)], jar: File, manifest: Manifest)
|
||||
def makeJar(sources: Seq[(File, String)], jar: File, manifest: Manifest, log: Logger)
|
||||
{
|
||||
println("Packaging " + jar.getAbsolutePath + " ...")
|
||||
log.info("Packaging " + jar.getAbsolutePath + " ...")
|
||||
IO.delete(jar)
|
||||
log.debug(sourcesDebugString(sources))
|
||||
IO.jar(sources, jar, manifest)
|
||||
println("Done packaging.")
|
||||
log.info("Done packaging.")
|
||||
}
|
||||
def sourcesDebugString(sources: Seq[(File, String)]): String =
|
||||
"Input file mappings:\n\t" + (sources map { case (f,s) => s + "\n\t " + f} mkString("\n\t") )
|
||||
|
||||
implicit def manifestEquiv: Equiv[Manifest] = defaultEquiv
|
||||
implicit def manifestFormat: Format[Manifest] = streamFormat( _ write _, in => new Manifest(in))
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ package sbt
|
|||
sealed trait TestOption
|
||||
object Tests
|
||||
{
|
||||
// (overall result, individual results)
|
||||
type Output = (TestResult.Value, Map[String,TestResult.Value])
|
||||
|
||||
final case class Setup(setup: ClassLoader => Unit) extends TestOption
|
||||
|
|
@ -82,7 +83,6 @@ object Tests
|
|||
testTask(frameworks.values.toSeq, testLoader, tests, setup.readOnly, cleanup.readOnly, log, testListeners.readOnly, arguments)
|
||||
}
|
||||
|
||||
// (overall result, individual results)
|
||||
def testTask(frameworks: Seq[Framework], loader: ClassLoader, tests: Seq[TestDefinition],
|
||||
userSetup: Iterable[ClassLoader => Unit], userCleanup: Iterable[ClassLoader => Unit],
|
||||
log: Logger, testListeners: Seq[TestReportListener], arguments: Map[Framework, Seq[String]]): Task[Output] =
|
||||
|
|
|
|||
Loading…
Reference in New Issue