More robustness when using the tasks and settings command

This commit is contained in:
David Perez 2015-09-01 14:16:41 +02:00
parent d27c7f40c2
commit 1e2617a807
1 changed files with 10 additions and 1 deletions

View File

@ -16,6 +16,7 @@ import StandardMain._
import java.io.File
import java.net.URI
import java.util.Locale
import scala.util.control.NonFatal
/** This class is the entry point for sbt.*/
final class xMain extends xsbti.AppMain {
@ -177,7 +178,15 @@ object BuiltinCommands {
val extracted = Project.extract(s)
import extracted._
val index = structure.index
index.keyIndex.keys(Some(currentRef)).toSeq.map(index.keyMap).distinct
index.keyIndex.keys(Some(currentRef)).toSeq.map { key =>
try
Some(index.keyMap(key))
catch {
case NonFatal(ex) =>
s.log error ex.getMessage
None
}
}.collect { case Some(s) => s }.distinct
}
def sortByLabel(keys: Seq[AttributeKey[_]]): Seq[AttributeKey[_]] = keys.sortBy(_.label)