aboutsummaryrefslogtreecommitdiff
path: root/stage2/Lib.scala
diff options
context:
space:
mode:
authorChristopher Vogt <oss.nsp@cvogt.org>2017-03-05 06:30:03 -0500
committerChristopher Vogt <oss.nsp@cvogt.org>2017-03-05 06:30:03 -0500
commita0b8651fee9dca977c22a598d680746f1373e97c (patch)
treec9a405db81db4007150c75487e86e62e4d2e3898 /stage2/Lib.scala
parent5cd8bc68728f6968310d3d1bbb382c14de53b601 (diff)
downloadcbt-a0b8651fee9dca977c22a598d680746f1373e97c.tar.gz
cbt-a0b8651fee9dca977c22a598d680746f1373e97c.tar.bz2
cbt-a0b8651fee9dca977c22a598d680746f1373e97c.zip
improve whitespace readability in proguard plugin
Diffstat (limited to 'stage2/Lib.scala')
-rw-r--r--stage2/Lib.scala11
1 files changed, 11 insertions, 0 deletions
diff --git a/stage2/Lib.scala b/stage2/Lib.scala
index dbcd06f..50b7389 100644
--- a/stage2/Lib.scala
+++ b/stage2/Lib.scala
@@ -540,4 +540,15 @@ final class Lib(val logger: Logger) extends Stage1Lib(logger){
( directory.getParentFile ++ ("/" ++ lib.buildDirectoryName) ).exists
) findOuterMostModuleDirectory(directory.getParentFile) else directory
}
+
+ def transformFiles( files: Seq[File], transform: String => String ): Seq[File] = {
+ files.flatMap{ file =>
+ val string = file.readAsString
+ val replaced = transform( string )
+ if( string != replaced ) {
+ write( file, replaced )
+ Some(file)
+ } else None
+ }
+ }
}