summaryrefslogtreecommitdiff
path: root/project/build/AdditionalResources.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-01-27 20:24:50 +0000
committerPaul Phillips <paulp@improving.org>2011-01-27 20:24:50 +0000
commit330febc72b402aac2460be2cbc212d5860ed205c (patch)
treed43f7039557f0e6261f49f243e52c69f61eac9f6 /project/build/AdditionalResources.scala
parent0d29472c7796ce6462e0893d7f401b56cbad1754 (diff)
downloadscala-330febc72b402aac2460be2cbc212d5860ed205c.tar.gz
scala-330febc72b402aac2460be2cbc212d5860ed205c.tar.bz2
scala-330febc72b402aac2460be2cbc212d5860ed205c.zip
Securing some of the blessings of whitespace fo...
Securing some of the blessings of whitespace for the sbt build. No review.
Diffstat (limited to 'project/build/AdditionalResources.scala')
-rw-r--r--project/build/AdditionalResources.scala40
1 files changed, 20 insertions, 20 deletions
diff --git a/project/build/AdditionalResources.scala b/project/build/AdditionalResources.scala
index b9be967fa6..a347e0dbd1 100644
--- a/project/build/AdditionalResources.scala
+++ b/project/build/AdditionalResources.scala
@@ -11,9 +11,9 @@ trait AdditionalResources {
self : BasicLayer =>
def writeProperties: Option[String] = {
- def write0(steps:List[Step]):Option[String]= steps match{
- case x::xs => x match{
- case c:PropertiesToWrite => {
+ def write0(steps: List[Step]): Option[String] = steps match {
+ case x :: xs => x match {
+ case c: PropertiesToWrite => {
c.writeProperties orElse write0(xs)
}
case _ => write0(xs)
@@ -28,23 +28,23 @@ object AdditionalResources {
/**
* A FileFilter that defines what are the files that will be copied
*/
- lazy val basicFilter = "*.tmpl" | "*.xml"| "*.js"| "*.css" | "*.properties" | "*.swf" | "*.png"
- implicit def stringToGlob(s:String):NameFilter=GlobFilter(s)
+ lazy val basicFilter = "*.tmpl" | "*.xml" | "*.js" | "*.css" | "*.properties" | "*.swf" | "*.png"
+ implicit def stringToGlob(s: String): NameFilter = GlobFilter(s)
}
trait ResourcesToCopy {
self : CompilationStep =>
- def getResources(from:Path,filter:FileFilter):PathFinder = (from ##)** filter
- def getResources(from:Path):PathFinder = getResources(from,AdditionalResources.basicFilter)
+ def getResources(from: Path, filter: FileFilter): PathFinder = (from ##)** filter
+ def getResources(from: Path): PathFinder = getResources(from, AdditionalResources.basicFilter)
- def copyDestination:Path
- def filesToCopy:PathFinder
+ def copyDestination: Path
+ def filesToCopy: PathFinder
def copy = {
log.info("Copying files for "+name)
- try{
- FileUtilities.copy(filesToCopy.get,copyDestination,log)
- }catch{
- case e=>Some(e.toString)
+ try {
+ FileUtilities.copy(filesToCopy.get, copyDestination, log)
+ } catch {
+ case e => Some(e.toString)
}
None
}
@@ -53,29 +53,29 @@ trait ResourcesToCopy {
trait PropertiesToWrite {
self : CompilationStep =>
- def propertyList:List[Tuple2[String,String]]
- def propertyDestination:Path
+ def propertyList: List[(String, String)]
+ def propertyDestination: Path
- def writeProperties:Option[String]={
+ def writeProperties: Option[String] ={
import java.io._
import java.util.Properties
val properties = new Properties
- def insert(list:List[Tuple2[String,String]]):Unit=list match{
+ def insert(list: List[(String, String)]): Unit = list match {
case Nil =>
- case x::xs => {
+ case x :: xs => {
properties setProperty(x._1, x._2)
insert(xs)
}
}
- try{
+ try {
insert(propertyList)
val destFile = propertyDestination.asFile
val stream = new FileOutputStream(destFile)
properties.store(stream, null)
- }catch{
+ } catch {
case e => Some(e.toString)
}
None