Add ; instead of brackets to xml group

This commit is contained in:
andrzej.jozwik@gmail.com 2014-10-17 22:23:20 +02:00
parent ef74db7319
commit 8c0e400c11
8 changed files with 27 additions and 44 deletions

View File

@ -200,9 +200,7 @@ private[sbt] object XmlContent {
private val DOUBLE_SLASH = "//"
private val OPEN_BRACKET = s" $OPEN_CURLY_BRACKET "
private val CLOSE_BRACKET = " ) "
private val CLOSE_XML_STATEMENT = ";"
/**
*
@ -356,7 +354,7 @@ private[sbt] object XmlContent {
val (correctedStmt, shouldAddCloseBrackets, wasXml, _) = addBracketsIfNecessary(statements)
val closeIfNecessaryCorrectedStmt =
if (shouldAddCloseBrackets && wasXml) {
correctedStmt.head +: CLOSE_BRACKET +: correctedStmt.tail
correctedStmt.head +: CLOSE_XML_STATEMENT +: correctedStmt.tail
} else {
correctedStmt
}
@ -372,7 +370,7 @@ private[sbt] object XmlContent {
val (newShouldAddCloseBracket, newStmtAcc) = if (isXml) {
addOpenBracketIfNecessary(accStmt, shouldAddCloseBracket, prvWasXml, prvStmt)
} else if (shouldAddCloseBracket) {
(false, CLOSE_BRACKET +: accStmt)
(false, CLOSE_XML_STATEMENT +: accStmt)
} else {
(false, accStmt)
}
@ -386,11 +384,7 @@ private[sbt] object XmlContent {
if (prvWasXml) {
(shouldAddCloseBracket, stmtAcc)
} else {
if (areBracketsNecessary(prvStatement)) {
(true, OPEN_BRACKET +: stmtAcc)
} else {
(false, stmtAcc)
}
(areBracketsNecessary(prvStatement), stmtAcc)
}
/**

View File

@ -0,0 +1,16 @@
import sbt._
val scmpom = taskKey[xml.NodeBuffer]("Node buffer")
scmpom := <scm>
<url>git@github.com:mohiva/play-html-compressor.git</url>
<connection>scm:git:git@github.com:mohiva/play-html-compressor.git</connection>
</scm>
<developers>
<developer>
<id>akkie</id>
<name>Christian Kaps</name>
<url>http://mohiva.com</url>
</developer>
</developers>
<a></a>

View File

@ -0,0 +1 @@
scmpom := <a/><b a="rt">OK</b>

View File

@ -0,0 +1,5 @@
import sbt._
val scmpom = taskKey[xml.NodeBuffer]("Node buffer")
scmpom := <a/><b a="rt">OK</b>;

View File

@ -1,17 +0,0 @@
k1 := {}
k2 := {}
k3 := {
val x = "hi"
()
}
k4 := { }; k5 := ()
k1 <<= k1 map {_ => sys.error("k1")}
k4 := { val x = k4.value; () }

View File

@ -1,15 +0,0 @@
k1 := {}
k2 := {}
k3 := {
val x = "hi"
()
}
k4 := (); k5 := ()
k1 <<= k1 map {_ => sys.error("k1")}

View File

@ -2,4 +2,4 @@ import sbt._
val scmpom = taskKey[xml.NodeBuffer]("Node buffer")
scmpom := ( <a/><b a="rt">OK</b> )
scmpom := <a/><b a="rt">OK</b>;