Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
eed3si9n committed May 5, 2018
1 parent 97f6478 commit a36dd2c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
5 changes: 3 additions & 2 deletions main/src/main/scala/sbt/Cross.scala
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,9 @@ object Cross {
/**
* Parse the given command into a list of aggregate projects and command to issue.
*/
private[sbt] def parseSlashCommand(extracted: Extracted)(
command: String): (Seq[ProjectRef], String) = {
private[sbt] def parseSlashCommand(
extracted: Extracted
)(command: String): (Seq[ProjectRef], String) = {
import extracted._
import DefaultParsers._
val parser = (OpOrID <~ charClass(_ == '/', "/")) ~ any.* map {
Expand Down
28 changes: 18 additions & 10 deletions main/src/main/scala/sbt/internal/CrossJava.scala
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ private[sbt] object CrossJava {
val version: Parser[SwitchTarget] =
(token(
(StringBasic <~ "@").? ~ ((NatBasic) ~ ("." ~> NatBasic).*)
.examples(knownVersions: _*) ~ "!".?) || token(StringBasic))
.examples(knownVersions: _*) ~ "!".?
) || token(StringBasic))
.map {
case Left(((vendor, (v1, vs)), bang)) =>
val force = bang.isDefined
Expand All @@ -101,14 +102,18 @@ private[sbt] object CrossJava {
}
}

private def getJavaHomes(extracted: Extracted,
proj: ResolvedReference): Map[JavaVersion, File] = {
private def getJavaHomes(
extracted: Extracted,
proj: ResolvedReference
): Map[JavaVersion, File] = {
import extracted._
(Keys.fullJavaHomes in proj get structure.data).get
}

private def getCrossJavaVersions(extracted: Extracted,
proj: ResolvedReference): Seq[JavaVersion] = {
private def getCrossJavaVersions(
extracted: Extracted,
proj: ResolvedReference
): Seq[JavaVersion] = {
import extracted._
import Keys._
(crossJavaVersions in proj get structure.data).getOrElse(Nil)
Expand Down Expand Up @@ -235,7 +240,8 @@ private[sbt] object CrossJava {
"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 " +
"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:")
projCrossVersions.foreach {
case (project, versions) => state.log.debug(s"$project: $versions")
Expand All @@ -259,12 +265,14 @@ private[sbt] object CrossJava {
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
// commands with spaces, so revert to running the command on each project one at a time
s"$JavaSwitchCommand $verbose $version" :: projects.map(project =>
s"$project/$aggCommand")
s"$JavaSwitchCommand $verbose $version" :: projects
.map(project => s"$project/$aggCommand")
case (version, projects) =>
// First switch scala version, then use the all command to run the command on each project concurrently
Seq(s"$JavaSwitchCommand $verbose $version",
projects.map(_ + "/" + aggCommand).mkString("all ", " ", ""))
Seq(
s"$JavaSwitchCommand $verbose $version",
projects.map(_ + "/" + aggCommand).mkString("all ", " ", "")
)
}
}

Expand Down

0 comments on commit a36dd2c

Please sign in to comment.