Formatting

This commit is contained in:
Eugene Yokota 2018-05-05 15:51:29 -04:00
parent 35e98f51fd
commit a7d85c8724
2 changed files with 21 additions and 12 deletions

View File

@ -101,8 +101,9 @@ object Cross {
/** /**
* Parse the given command into a list of aggregate projects and command to issue. * Parse the given command into a list of aggregate projects and command to issue.
*/ */
private[sbt] def parseSlashCommand(extracted: Extracted)( private[sbt] def parseSlashCommand(
command: String): (Seq[ProjectRef], String) = { extracted: Extracted
)(command: String): (Seq[ProjectRef], String) = {
import extracted._ import extracted._
import DefaultParsers._ import DefaultParsers._
val parser = (OpOrID <~ charClass(_ == '/', "/")) ~ any.* map { val parser = (OpOrID <~ charClass(_ == '/', "/")) ~ any.* map {

View File

@ -77,7 +77,8 @@ private[sbt] object CrossJava {
val version: Parser[SwitchTarget] = val version: Parser[SwitchTarget] =
(token( (token(
(StringBasic <~ "@").? ~ ((NatBasic) ~ ("." ~> NatBasic).*) (StringBasic <~ "@").? ~ ((NatBasic) ~ ("." ~> NatBasic).*)
.examples(knownVersions: _*) ~ "!".?) || token(StringBasic)) .examples(knownVersions: _*) ~ "!".?
) || token(StringBasic))
.map { .map {
case Left(((vendor, (v1, vs)), bang)) => case Left(((vendor, (v1, vs)), bang)) =>
val force = bang.isDefined val force = bang.isDefined
@ -101,14 +102,18 @@ private[sbt] object CrossJava {
} }
} }
private def getJavaHomes(extracted: Extracted, private def getJavaHomes(
proj: ResolvedReference): Map[JavaVersion, File] = { extracted: Extracted,
proj: ResolvedReference
): Map[JavaVersion, File] = {
import extracted._ import extracted._
(Keys.fullJavaHomes in proj get structure.data).get (Keys.fullJavaHomes in proj get structure.data).get
} }
private def getCrossJavaVersions(extracted: Extracted, private def getCrossJavaVersions(
proj: ResolvedReference): Seq[JavaVersion] = { extracted: Extracted,
proj: ResolvedReference
): Seq[JavaVersion] = {
import extracted._ import extracted._
import Keys._ import Keys._
(crossJavaVersions in proj get structure.data).getOrElse(Nil) (crossJavaVersions in proj get structure.data).getOrElse(Nil)
@ -235,7 +240,8 @@ private[sbt] object CrossJava {
"configuration. This could result in subprojects cross building against Java versions that they are " + "configuration. This could result in subprojects cross building against Java versions that they are " +
"not compatible with. Try issuing cross building command with tasks instead, since sbt will be able " + "not compatible with. Try issuing cross building command with tasks instead, since sbt will be able " +
"to ensure that cross building is only done using configured project and Java version combinations " + "to ensure that cross building is only done using configured project and Java version combinations " +
"that are configured.") "that are configured."
)
state.log.debug("Java versions configuration is:") state.log.debug("Java versions configuration is:")
projCrossVersions.foreach { projCrossVersions.foreach {
case (project, versions) => state.log.debug(s"$project: $versions") case (project, versions) => state.log.debug(s"$project: $versions")
@ -259,12 +265,14 @@ private[sbt] object CrossJava {
case (version, projects) if aggCommand.contains(" ") => case (version, projects) if aggCommand.contains(" ") =>
// If the command contains a space, then the `all` command won't work because it doesn't support issuing // If the command contains a space, then the `all` command won't work because it doesn't support issuing
// commands with spaces, so revert to running the command on each project one at a time // commands with spaces, so revert to running the command on each project one at a time
s"$JavaSwitchCommand $verbose $version" :: projects.map(project => s"$JavaSwitchCommand $verbose $version" :: projects
s"$project/$aggCommand") .map(project => s"$project/$aggCommand")
case (version, projects) => case (version, projects) =>
// First switch scala version, then use the all command to run the command on each project concurrently // First switch scala version, then use the all command to run the command on each project concurrently
Seq(s"$JavaSwitchCommand $verbose $version", Seq(
projects.map(_ + "/" + aggCommand).mkString("all ", " ", "")) s"$JavaSwitchCommand $verbose $version",
projects.map(_ + "/" + aggCommand).mkString("all ", " ", "")
)
} }
} }