summaryrefslogtreecommitdiff
path: root/project/build/AdditionalResources.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-01-27 23:26:19 +0000
committerPaul Phillips <paulp@improving.org>2011-01-27 23:26:19 +0000
commit4bc1fae32f8e1ae640e85ed15a577c557e18e385 (patch)
treedb254d3d71020d9b999d33360974a2259b58867d /project/build/AdditionalResources.scala
parent1c537ba1b3b68007e613a6c90d27cdae3f262c77 (diff)
downloadscala-4bc1fae32f8e1ae640e85ed15a577c557e18e385.tar.gz
scala-4bc1fae32f8e1ae640e85ed15a577c557e18e385.tar.bz2
scala-4bc1fae32f8e1ae640e85ed15a577c557e18e385.zip
A bunch of work on the sbt build. No review.
Diffstat (limited to 'project/build/AdditionalResources.scala')
-rw-r--r--project/build/AdditionalResources.scala24
1 files changed, 10 insertions, 14 deletions
diff --git a/project/build/AdditionalResources.scala b/project/build/AdditionalResources.scala
index a347e0dbd1..edb4c4e9a2 100644
--- a/project/build/AdditionalResources.scala
+++ b/project/build/AdditionalResources.scala
@@ -34,18 +34,18 @@ object AdditionalResources {
trait ResourcesToCopy {
self : CompilationStep =>
+
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 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
}
}
@@ -62,21 +62,17 @@ trait PropertiesToWrite {
val properties = new Properties
- def insert(list: List[(String, String)]): Unit = list match {
- case Nil =>
- case x :: xs => {
- properties setProperty(x._1, x._2)
- insert(xs)
- }
- }
+ def insert(list: List[(String, String)]): Unit =
+ list foreach { case (k, v) => properties.setProperty(k, v) }
try {
insert(propertyList)
val destFile = propertyDestination.asFile
val stream = new FileOutputStream(destFile)
properties.store(stream, null)
- } catch {
- case e => Some(e.toString)
+ }
+ catch {
+ case e: Exception => Some(e.toString)
}
None
}