diff options
Diffstat (limited to 'project/build')
-rw-r--r-- | project/build/AdditionalResources.scala | 16 | ||||
-rw-r--r-- | project/build/BasicLayer.scala | 52 | ||||
-rw-r--r-- | project/build/BuildInfoEnvironment.scala | 4 | ||||
-rw-r--r-- | project/build/Comparator.scala | 10 | ||||
-rw-r--r-- | project/build/Compilation.scala | 2 | ||||
-rw-r--r-- | project/build/CompilationStep.scala | 2 | ||||
-rw-r--r-- | project/build/ForkSBT.scala | 8 | ||||
-rw-r--r-- | project/build/Packer.scala | 18 | ||||
-rwxr-xr-x | project/build/Partest.scala | 72 | ||||
-rw-r--r-- | project/build/PathConfig.scala | 4 | ||||
-rw-r--r-- | project/build/SVN.scala | 8 | ||||
-rw-r--r-- | project/build/ScalaBuildProject.scala | 4 | ||||
-rw-r--r-- | project/build/ScalaSBTBuilder.scala | 66 | ||||
-rw-r--r-- | project/build/ScalaTools.scala | 2 | ||||
-rw-r--r-- | project/build/Scaladoc.scala | 2 |
15 files changed, 135 insertions, 135 deletions
diff --git a/project/build/AdditionalResources.scala b/project/build/AdditionalResources.scala index edb4c4e9a2..d83d45b218 100644 --- a/project/build/AdditionalResources.scala +++ b/project/build/AdditionalResources.scala @@ -9,7 +9,7 @@ import AdditionalResources._ */ trait AdditionalResources { self : BasicLayer => - + def writeProperties: Option[String] = { def write0(steps: List[Step]): Option[String] = steps match { case x :: xs => x match { @@ -29,18 +29,18 @@ 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) + 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 copyDestination: Path def filesToCopy: PathFinder - + def copy = { log.info("Copying files for "+name) try { FileUtilities.copy(filesToCopy.get, copyDestination, log) } @@ -59,12 +59,12 @@ trait PropertiesToWrite { def writeProperties: Option[String] ={ import java.io._ import java.util.Properties - + val properties = new Properties - def insert(list: List[(String, String)]): Unit = + def insert(list: List[(String, String)]): Unit = list foreach { case (k, v) => properties.setProperty(k, v) } - + try { insert(propertyList) val destFile = propertyDestination.asFile diff --git a/project/build/BasicLayer.scala b/project/build/BasicLayer.scala index b03637ad4d..b333131d51 100644 --- a/project/build/BasicLayer.scala +++ b/project/build/BasicLayer.scala @@ -8,18 +8,18 @@ import ScalaBuildProject._ * @author Grégory Moix */ abstract class BasicLayer(val info: ProjectInfo, val versionNumber: String, previousLayer: Option[BasicLayer]) - extends ScalaBuildProject + extends ScalaBuildProject with ReflectiveProject - with AdditionalResources + with AdditionalResources with LayerCompilation - with BuildInfoEnvironment + with BuildInfoEnvironment with ForkSBT { layer => - + // All path values must be lazy in order to avoid initialization issues (sbt way of doing things) def buildInfoEnvironmentLocation: Path = outputRootPath / ("build-"+name+".properties") - + val forkProperty = "scala.sbt.forked" def isDebug = info.logger atLevel Level.Debug def isForked = System.getProperty(forkProperty) != null @@ -30,13 +30,13 @@ abstract class BasicLayer(val info: ProjectInfo, val versionNumber: String, prev lazy val copyright = property[String] lazy val partestVersionNumber = property[Version] - + lazy val nextLayer: Option[BasicLayer] = None - def packingDestination : Path = layerOutput / "pack" + def packingDestination : Path = layerOutput / "pack" lazy val libsDestination = packingDestination/ "lib" lazy val packedStarrOutput = outputRootPath / "pasta" lazy val requiredPluginsDirForCompilation = layerOutput / "misc" / "scala-devel" / "plugins" - + def compilerAdditionalJars: List[Path] = Nil def libraryAdditionalJars: List[Path] = Nil @@ -54,7 +54,7 @@ abstract class BasicLayer(val info: ProjectInfo, val versionNumber: String, prev def buildLayer = externalCompilation orElse writeProperties lazy val build = compile - + lazy val compile = task(buildLayer) dependsOn startLayer /** @@ -64,7 +64,7 @@ abstract class BasicLayer(val info: ProjectInfo, val versionNumber: String, prev * is finished. */ lazy val finishLayer: ManagedTask = task(None) dependsOn compile - + def cleaningList = List( layerOutput, layerEnvironment.envBackingPath, @@ -76,7 +76,7 @@ abstract class BasicLayer(val info: ProjectInfo, val versionNumber: String, prev // We use super.task, so cleaning is done in every case, even when locked lazy val clean: Task = nextLayer match { case Some(next) => super.task(cleanFiles) dependsOn next.clean - case _ => super.task(cleanFiles) + case _ => super.task(cleanFiles) } lazy val cleanBuild = task(cleanFiles orElse buildLayer) dependsOn startLayer @@ -91,13 +91,13 @@ abstract class BasicLayer(val info: ProjectInfo, val versionNumber: String, prev def outputCompilerJar = compilerConfig.packagingConfig.jarDestination def outputLibraryJar = libraryWS.packagingConfig.jarDestination def outputPartestJar = partestConfig.packagingConfig.jarDestination - def outputScalapJar = scalapConfig.packagingConfig.jarDestination + def outputScalapJar = scalapConfig.packagingConfig.jarDestination def scalapOutput = scalapConfig.outputDirectory def swingOutput = swingConfig.outputDirectory def swingSrcDir = swingConfig.srcDir // CONFIGURATION OF THE COMPILATION STEPS - + /** * Configuration of the core library compilation */ @@ -109,7 +109,7 @@ abstract class BasicLayer(val info: ProjectInfo, val versionNumber: String, prev def copyDestination = outputDirectory def filesToCopy = getResources(srcDir) - + def propertyDestination = outputDirectory / "library.properties" def propertyList = ("version.number",versionNumber) :: ("copyright.string", copyright.value) :: Nil } @@ -139,7 +139,7 @@ abstract class BasicLayer(val info: ProjectInfo, val versionNumber: String, prev new PackagingConfiguration(libsDestination / compilerJarName, List(outputDirectory ##), manifest , compilerAdditionalJars) } lazy val starrPackagingConfig = new PackagingConfiguration(packedStarrOutput/compilerJarName, List(outputDirectory ##)) - + } //// ADDTIONNAL LIBRARIES //// @@ -161,7 +161,7 @@ abstract class BasicLayer(val info: ProjectInfo, val versionNumber: String, prev def label = "["+layer.name+"] dbc library" def options: Seq[String] = Seq() def dependencies = libraryConfig :: Nil - + lazy val packagingConfig = new PackagingConfiguration( libsDestination / dbcJarName, List(outputDirectory ##) @@ -207,7 +207,7 @@ abstract class BasicLayer(val info: ProjectInfo, val versionNumber: String, prev def dependencies = libraryConfig :: compilerConfig :: Nil val decoderProperties = (srcDir ## ) / "decoder.properties" - + lazy val packagingConfig = new PackagingConfiguration( libsDestination / scalapJarName, List(outputDirectory ##, decoderProperties) @@ -231,9 +231,9 @@ abstract class BasicLayer(val info: ProjectInfo, val versionNumber: String, prev ("version.number", partestVersionNumber.value.toString), ("copyright.string", copyright.value) ) - - lazy val packagingConfig = new PackagingConfiguration(libsDestination / partestJarName, List(outputDirectory ##)) - + + lazy val packagingConfig = new PackagingConfiguration(libsDestination / partestJarName, List(outputDirectory ##)) + } ///// PLUGINS CONFIGURATION //////// @@ -243,9 +243,9 @@ abstract class BasicLayer(val info: ProjectInfo, val versionNumber: String, prev def projectRoot: Path = pathLayout.projectRoot def sources: Path = pathLayout.srcDir / "continuations" / "plugin" def analysis: Path = pathLayout.analysisOutput / "continuations" / "plugin" - def output: Path = pathLayout.classesOutput / "continuations" / "plugin" + def output: Path = pathLayout.classesOutput / "continuations" / "plugin" } - + new CompilationStep("continuation-plugin", config, log) with ResourcesToCopy with EarlyPackaging { def label = "["+layer.name+"] continuation plugin" def dependencies = libraryConfig :: compilerConfig :: Nil @@ -270,9 +270,9 @@ abstract class BasicLayer(val info: ProjectInfo, val versionNumber: String, prev def projectRoot: Path = pathLayout.projectRoot def sources: Path = pathLayout.srcDir / "continuations" / "library" def analysis: Path = pathLayout.analysisOutput / "continuations" / "library" - def output: Path = pathLayout.classesOutput / "continuations" / "library" + def output: Path = pathLayout.classesOutput / "continuations" / "library" } - + new CompilationStep("continuation-library", config, log) { def label = "["+layer.name+"] continuation library" def dependencies = libraryConfig :: compilerConfig :: continuationPluginConfig :: Nil @@ -287,10 +287,10 @@ abstract class BasicLayer(val info: ProjectInfo, val versionNumber: String, prev // Grouping compilation steps def minimalCompilation = false // It must be true for locker because we do not need to compile everything - + def libraryWS: WrapperStep with Packaging def toolsWS: WrapperStep - lazy val pluginsWS = new WrapperStep(continuationPluginConfig :: continuationLibraryConfig :: Nil) + lazy val pluginsWS = new WrapperStep(continuationPluginConfig :: continuationLibraryConfig :: Nil) lazy val allSteps = new WrapperStep(libraryWS :: compilerConfig :: pluginsWS :: toolsWS :: Nil) } diff --git a/project/build/BuildInfoEnvironment.scala b/project/build/BuildInfoEnvironment.scala index a7f3d4ba96..fc1c436c33 100644 --- a/project/build/BuildInfoEnvironment.scala +++ b/project/build/BuildInfoEnvironment.scala @@ -12,10 +12,10 @@ trait BuildInfoEnvironment { // use the project's Logger for any properties-related logging def log = self.log - // the properties file will be read/stored + // the properties file will be read/stored def envBackingPath = buildInfoEnvironmentLocation // define some properties lazy val lastCompilerVersion: Property[String] = propertyOptional[String]("") - } + } } diff --git a/project/build/Comparator.scala b/project/build/Comparator.scala index 32b1a516c6..7400788ba9 100644 --- a/project/build/Comparator.scala +++ b/project/build/Comparator.scala @@ -26,21 +26,21 @@ object Comparator { val originPaths = filter(origin).get - + val bufferSize = 1024 val originBuffer = new Array[Byte](bufferSize) val destBuffer = new Array[Byte](bufferSize) - + for (originPath <- originPaths.filter(! _.isDirectory)){ log.debug("origin :" + originPath.absolutePath) val destPath = getMappedPath(originPath, dest) log.debug("dest :" + destPath.absolutePath) - var equalNow = true + var equalNow = true val originFile = originPath.asFile val destFile = destPath.asFile if (originFile.canRead && destFile.canRead) { - + val originStream = new FileInputStream(originFile) val destStream = new FileInputStream(destFile) var originRemaining = originStream.read(originBuffer) @@ -63,7 +63,7 @@ object Comparator { } else reportMissing(originFile) - + } if(allEqualNow) None else Some("There were differences between "+origin.absolutePath+ " and "+ dest.absolutePath) } diff --git a/project/build/Compilation.scala b/project/build/Compilation.scala index 9a313cab07..d581b2b736 100644 --- a/project/build/Compilation.scala +++ b/project/build/Compilation.scala @@ -58,7 +58,7 @@ trait Compilation { } /** - * When we finishe to compile a step we want to jar if necessary in order to + * When we finishe to compile a step we want to jar if necessary in order to * be able to load plugins for the associated library */ def earlyPackaging(step: CompilationStep): Option[String] = step match { diff --git a/project/build/CompilationStep.scala b/project/build/CompilationStep.scala index d6310a9646..000dca0234 100644 --- a/project/build/CompilationStep.scala +++ b/project/build/CompilationStep.scala @@ -14,7 +14,7 @@ abstract class CompilationStep(val name: String, val pathConfig: PathConfig, log // Utility methods (for quick access, ...) final def srcDir = pathConfig.sources - + // Methods required for the compilation def log: Logger = logger final def sourceRoots : PathFinder = pathConfig.sources diff --git a/project/build/ForkSBT.scala b/project/build/ForkSBT.scala index 986c2166dc..b30e35e61f 100644 --- a/project/build/ForkSBT.scala +++ b/project/build/ForkSBT.scala @@ -16,7 +16,7 @@ trait ForkSBT { import java.lang.management.ManagementFactory ManagementFactory.getRuntimeMXBean().getInputArguments().toList } - + private var extraJVMArgs: List[String] = Nil def withJVMArgs[T](args: String*)(body: => T): T = { val saved = extraJVMArgs @@ -27,16 +27,16 @@ trait ForkSBT { // Set a property in forked sbts to inhibit possible forking cycles. def markForked = "-D" + forkProperty + "=true" - + /** Forks a new process to run "sbt task task ...": */ def forkTasks(tasks: String*): Boolean = { require (!isForked, "Tried to fork but sbt is already forked: " + tasks.mkString(" ")) - + val sbtJar = System.getProperty("java.class.path") val sbtMain = "xsbt.boot.Boot" // ok, much of anything. val args = jvmArguments ++ Seq(markForked, "-classpath", sbtJar, sbtMain) ++ tasks - + log.info("Forking: " + args.mkString("java ", " ", "")) Fork.java(None, args, StdoutOutput) == 0 } diff --git a/project/build/Packer.scala b/project/build/Packer.scala index fde5a732a9..73db5567b6 100644 --- a/project/build/Packer.scala +++ b/project/build/Packer.scala @@ -7,14 +7,14 @@ import FileUtilities._ object Packer { - + /** * A filter that exclude files that musn't be in a jar file. */ // We must exclude the manifest because we generate it automatically, and when we add multiples other jars, they could have // also a manifest files each, resulting in conflicts for the FileUtilities.jar(..) method def jarPattern(path: PathFinder) = path.descendentsExcept(AllPassFilter, (".*" - ".") || HiddenFileFilter || new ExactFilter("MANIFEST.MF")).get - + def createJar(j: Packaging, log: Logger): Option[String] = createJar(j.packagingConfig, log, jarPattern _, true) def createJar(j: PackagingConfiguration, log: Logger): Option[String] = createJar(j, log, jarPattern _, true) @@ -26,7 +26,7 @@ object Packer { def pack0(content: Iterable[Path])= jar(content.flatMap(filter(_)), j.jarDestination, j.manifest, false, log) j.jarsToInclude match { - case Nil => pack0(j.content) + case Nil => pack0(j.content) case list if addIncludedLibs => { withTemporaryDirectory(log) { tmp: File => val tmpPath = Path.fromFile(tmp) @@ -41,7 +41,7 @@ object Packer { } } case _ => pack0(j.content) - + } } @@ -53,9 +53,9 @@ object Packer { */ trait Packer { self: BasicLayer => - + def libraryToCopy: List[Path] = Nil - + /** * The actual pack task. */ @@ -72,7 +72,7 @@ trait Packer { } def copy0 ={ - copyFile(manifestPath,packingDestination/"META-INF"/"MANIFEST.MF", log) orElse { + copyFile(manifestPath,packingDestination/"META-INF"/"MANIFEST.MF", log) orElse { copy(libraryToCopy, packingDestination , true, true, log) match { case Right(_) => None case Left(e) => Some(e) @@ -91,7 +91,7 @@ class PackagingConfiguration(val jarDestination: Path, val content: Iterable[Pat } trait Packaging extends Step { - def packagingConfig: PackagingConfiguration + def packagingConfig: PackagingConfiguration } trait WrapperPackaging extends Packaging { @@ -106,7 +106,7 @@ trait WrapperPackaging extends Packaging { } } getContent(dependencies.toList, Nil) - } + } } /** diff --git a/project/build/Partest.scala b/project/build/Partest.scala index 78d35ef65c..7771c6f208 100755 --- a/project/build/Partest.scala +++ b/project/build/Partest.scala @@ -12,7 +12,7 @@ class TestSet(val SType: TestSetType.Value, val kind: String, val description: S f.partition((f: File) => files.elements.exists((e: File) => f == e)) } } - + object TestSet { def apply(sType: TestSetType.Value, kind: String, description: String, files: PathFinder)= new TestSet(sType, kind, description, filter(files)) def filter(p: PathFinder): Array[File] =( p --- p **(HiddenFileFilter || GlobFilter("*.obj")||GlobFilter("*.log"))).getFiles.toArray @@ -31,7 +31,7 @@ trait PartestRunner { import Partest.runTest import TestSetType._ - + lazy val testRoot = projectRoot / "test" lazy val testFiles = testRoot / "files" ## lazy val testLibs = testFiles / "lib" @@ -50,7 +50,7 @@ trait PartestRunner { // lazy val negContinuationTest = TestSet(Continuations,"neg", "Compiling continuations files that are expected to fail", testFiles / "continuations-neg" * ("*.scala" || DirectoryFilter)) // lazy val runContinuationTest = TestSet(Continuations,"run", "Compiling and running continuations files", testFiles / "continuations-run" ** ("*.scala" )) - // + // // lazy val continuationScalaOpts = ( // "-Xpluginsdir " + // continuationPluginConfig.packagingConfig.jarDestination.asFile.getParent + @@ -58,9 +58,9 @@ trait PartestRunner { // ) lazy val testSuiteFiles: List[TestSet] = List( - posFilesTest, negFilesTest, runFilesTest, jvmFilesTest, resFilesTest, - buildmanagerFilesTest, - //scalacheckFilesTest, + posFilesTest, negFilesTest, runFilesTest, jvmFilesTest, resFilesTest, + buildmanagerFilesTest, + //scalacheckFilesTest, shootoutFilesTest, scalapFilesTest, specializedFilesTest ) @@ -71,11 +71,11 @@ trait PartestRunner { // + (("continuations-neg",negContinuationTest),("continuations-run", runContinuationTest)) private lazy val partestOptions = List("-failed") - + private lazy val partestCompletionList: Seq[String] = { val len = testFiles.asFile.toString.length + 1 - - filesTestMap.keys.toList ++ partestOptions ++ + + filesTestMap.keys.toList ++ partestOptions ++ (filesTestMap.values.toList flatMap (_.files) map (_.toString take len)) } @@ -85,7 +85,7 @@ trait PartestRunner { outputLibraryJar, (outputLibraryJar +++ outputCompilerJar +++ outputPartestJar +++ outputScalapJar +++ antJar +++ jlineJar +++ (testLibs * "*.jar")).get, testRoot, - tests, + tests, None ) @@ -107,11 +107,11 @@ trait PartestRunner { failedOnly, true, isDebug, log ) } - + def partestDebugProp = if (isDebug) List("-Dpartest.debug=true") else Nil - + lazy val externalPartest = task { args => task { if (isForked) partest(args).run @@ -132,9 +132,9 @@ trait PartestRunner { setOptions(xs, acc) case x :: xs => setOptions(xs, x :: acc) - case _ => acc + case _ => acc } - + def resolveSets(l: List[String], rem: List[String], acc: List[TestSet]): (List[String], List[TestSet]) = { def searchSet(arg: String): Option[TestSet] = filesTestMap get arg @@ -146,13 +146,13 @@ trait PartestRunner { case Nil => (rem, acc) } } - + def resolveFiles(l: List[String], sets: List[TestSet]):(List[String], List[TestSet]) = { def resolve0(filesToResolve: List[File], setsToSearchIn: List[TestSet], setAcc: List[TestSet]):(List[String], List[TestSet])= { filesToResolve match { case Nil => (Nil, setAcc) // If we have no files left to resolve, we can return the list of the set we have case list => { - setsToSearchIn match { + setsToSearchIn match { case Nil => (list.map(_.toString), setAcc)// If we already had search all sets to find a match, we return the list of the files that where problematic and the set we have case x :: xs => { val (found, notFound)= x.splitContent(list) @@ -166,19 +166,19 @@ trait PartestRunner { } } } - + } - + resolve0(l.map(Path.fromString(testFiles, _).asFile), filesTestMap.values.toList, sets) } val keys = setOptions(args.toList, Nil) - + if (keys.isEmpty) { task { runPartest(testSuiteFiles, None, failedOnly) } } else { - val (fileNames, sets) = resolveSets(keys, Nil, Nil) + val (fileNames, sets) = resolveSets(keys, Nil, Nil) val (notFound, allSets) = resolveFiles(fileNames, sets) if (!notFound.isEmpty) log.info("Don't know what to do with : \n"+notFound.mkString("\n")) @@ -191,11 +191,11 @@ trait PartestRunner { // } // this is the case where there were only config options, we will run the standard test suite // } // else { - // val (fileNames, sets) = resolveSets(keys, Nil, Nil) + // val (fileNames, sets) = resolveSets(keys, Nil, Nil) // val (notFound, allSets) = resolveFiles(fileNames, sets) // if (!notFound.isEmpty) // log.info("Don't know what to do with : \n"+notFound.mkString("\n")) - // + // // val (std, continuations) = allSets partition (_.SType == TestSetType.Std) // task { // runPartest(std, None, failedOnly) orElse { @@ -214,7 +214,7 @@ object Partest { javacmd: Option[File], javaccmd: Option[File], scalacOpts: Option[String], - timeout: Option[String], + timeout: Option[String], showDiff: Boolean, showLog: Boolean, runFailed: Boolean, @@ -222,10 +222,10 @@ object Partest { debug: Boolean, log: Logger ): Option[String] = { - + if (debug) log.setLevel(Level.Debug) - + if (config.classpath.isEmpty) return Some("The classpath is empty") @@ -256,14 +256,14 @@ object Partest { } def setFileManagerStringProperty(name: String, value: String) { - log.debug("Setting partest property :"+name+" to :"+value) + log.debug("Setting partest property :"+name+" to :"+value) val setMethod = fileManager.getClass.getMethod(name+"_$eq", Array(classOf[String]): _*) setMethod.invoke(fileManager, Array(value).asInstanceOf[Array[Object]]: _*) } // System.setProperty("partest.srcdir", "files") - + setFileManagerBooleanProperty("showDiff", showDiff) setFileManagerBooleanProperty("showLog", showLog) setFileManagerBooleanProperty("failed", runFailed) @@ -281,7 +281,7 @@ object Partest { type TFSet = (Array[File], String, String) val testFileSets = config.tests - + def resultsToStatistics(results: Iterable[(_, Int)]): (Int, Int) = { val (files, failures) = results map (_._2 == 0) partition (_ == true) def count(i: Iterable[_]): Int ={ @@ -293,7 +293,7 @@ object Partest { } (count(files), count(failures)) } - + def runSet(set: TestSet): (Int, Int, Iterable[String]) = { val (files, name, msg) = (set.files, set.kind, set.description) @@ -311,7 +311,7 @@ object Partest { case (path, 1) => path + " [FAILED]" case (path, 2) => path + " [TIMOUT]" }) - + val r =(succs, fails, failed) config.junitReportDir match { @@ -319,9 +319,9 @@ object Partest { val report = testReport(name, results, succs, fails) scala.xml.XML.save(d/name+".xml", report) } - case None => + case None => } - + r } } @@ -330,7 +330,7 @@ object Partest { val allSuccesses = _results.map (_._1).foldLeft(0)( _ + _ ) val allFailures = _results.map (_._2).foldLeft(0)( _ + _ ) val allFailedPaths = _results flatMap (_._3) - + def f(msg: String): Option[String] = if (errorOnFailed && allFailures > 0) { Some(msg) @@ -346,7 +346,7 @@ object Partest { else "Test suite finished with no failures." f(msg) - + } private def oneResult(res: (String, Int)) = @@ -355,9 +355,9 @@ object Partest { case 0 => scala.xml.NodeSeq.Empty case 1 => <failure message="Test failed"/> case 2 => <failure message="Test timed out"/> - } + } }</testcase> - + private def testReport(kind: String, results: Iterable[(String, Int)], succs: Int, fails: Int) = <testsuite name ={kind} tests ={(succs + fails).toString} failures ={fails.toString}> <properties/> diff --git a/project/build/PathConfig.scala b/project/build/PathConfig.scala index eccd0faf07..3ed56846f9 100644 --- a/project/build/PathConfig.scala +++ b/project/build/PathConfig.scala @@ -1,6 +1,6 @@ import sbt._ -/** +/** * An abstract class for grouping all different paths that are needed to * compile the a CompilationStep * @author Grégory Moix @@ -21,7 +21,7 @@ trait SimpleOutputLayout { def outputDir: Path lazy val classesOutput = outputDir / PathConfig.classes lazy val analysisOutput = outputDir / PathConfig.analysis - + } class PathLayout(val projectRoot: Path, val outputDir: Path) extends SimpleOutputLayout { diff --git a/project/build/SVN.scala b/project/build/SVN.scala index 6a64e727f9..427469eb64 100644 --- a/project/build/SVN.scala +++ b/project/build/SVN.scala @@ -14,7 +14,7 @@ class SVN(root: Path) { * It assumes that svn or git is installed on the running computer. Return 0 if it was not * able to found the revision number */ - def getRevisionNumber: Int = getSvn orElse getGit getOrElse 0 + def getRevisionNumber: Int = getSvn orElse getGit getOrElse 0 def getSvn: Option[Int] = { /** Doing this the hard way trying to suppress the svn error message * on stderr. Could not figure out how to do it simply in sbt. @@ -22,15 +22,15 @@ class SVN(root: Path) { val pb = new java.lang.ProcessBuilder("svn", "info") pb directory root.asFile pb redirectErrorStream true - + Process(pb).lines_! foreach { case GitSvnRegex(rev) => return Some(rev.toInt) case _ => () } None } - - def getGit: Option[Int] = + + def getGit: Option[Int] = try { Some(Process(GitSvnRevTool.toString, root).!!.trim.toInt) } catch { case _: Exception => None } } diff --git a/project/build/ScalaBuildProject.scala b/project/build/ScalaBuildProject.scala index a94206006e..250ad7a429 100644 --- a/project/build/ScalaBuildProject.scala +++ b/project/build/ScalaBuildProject.scala @@ -3,10 +3,10 @@ import ScalaBuildProject._ abstract class ScalaBuildProject extends Project { - lazy val projectRoot = info.projectPath + lazy val projectRoot = info.projectPath lazy val layerOutput = outputRootPath / name lazy val pathLayout = new PathLayout(projectRoot, layerOutput) - + lazy val manifestPath = projectRoot/"META-INF"/"MANIFEST.MF" lazy val lib = projectRoot / "lib" diff --git a/project/build/ScalaSBTBuilder.scala b/project/build/ScalaSBTBuilder.scala index 00e56515e7..81c7860020 100644 --- a/project/build/ScalaSBTBuilder.scala +++ b/project/build/ScalaSBTBuilder.scala @@ -19,15 +19,15 @@ class ScalaSBTBuilder(val info: ProjectInfo) * incremental build, which means sbt doesn't get used at all, so this is better.) */ System.setProperty("sbt.intransitive", "true") - + // Required by BasicDependencyProject def fullUnmanagedClasspath(config: Configuration) = unmanagedClasspath override def dependencies: Iterable[Project] = ( - info.dependencies ++ - locker.dependencies ++ - quick.dependencies ++ - strap.dependencies ++ + info.dependencies ++ + locker.dependencies ++ + quick.dependencies ++ + strap.dependencies ++ libs.dependencies ) override def shouldCheckOutputDirectories = false @@ -52,11 +52,11 @@ class ScalaSBTBuilder(val info: ProjectInfo) lazy val pasta = quick.pasta.describedAs(pastaTaskDescription) lazy val stabilityTest = strap.stabilityTest.describedAs(stabilityTestTaskDescription) lazy val test = quick.externalPartest.describedAs(partestTaskDescription) - + // Non-standard names for tasks chosen earlier which I point at the standard ones. lazy val build = compile lazy val partest = test - + // Top level variables /** @@ -73,7 +73,7 @@ class ScalaSBTBuilder(val info: ProjectInfo) } def getVersion: String = projectVersion.value.toString takeWhile (_ != '-') mkString def getRevision: Int = new SVN(info.projectPath) getRevisionNumber - + getVersion+".r"+getRevision+"-b"+getTimeString } @@ -115,11 +115,11 @@ class ScalaSBTBuilder(val info: ProjectInfo) } else action } - + def deleteLock = FileUtilities.clean(lockFile, log) def createLock = { log.info("locking "+name) - FileUtilities.touch(lockFile, log) + FileUtilities.touch(lockFile, log) } /** @@ -156,13 +156,13 @@ class ScalaSBTBuilder(val info: ProjectInfo) override lazy val packingDestination: Path = outputRootPath /"palo" - override lazy val libraryWS = { + override lazy val libraryWS = { new WrapperStep(libraryConfig :: Nil) with WrapperPackaging { lazy val packagingConfig = new PackagingConfiguration(libsDestination/libraryJarName, jarContent) } } override val minimalCompilation = true - override lazy val pluginsWS: WrapperStep = new WrapperStep(Nil) + override lazy val pluginsWS: WrapperStep = new WrapperStep(Nil) override lazy val toolsWS = new WrapperStep(Nil) } @@ -175,20 +175,20 @@ class ScalaSBTBuilder(val info: ProjectInfo) with Packer with ScalaTools with Scaladoc { override lazy val nextLayer = Some(strap) - + lazy val instantiationCompilerJar = previous.compilerOutput lazy val instantiationLibraryJar = previous.libraryOutput override lazy val packingDestination: Path = outputRootPath/ "pack" - + override def libraryToCopy = jlineJar :: Nil override def compilerAdditionalJars = msilJar :: fjbgJar :: Nil override def libraryAdditionalJars = forkJoinJar :: Nil - + override def cleaningList = packedStarrOutput :: super.cleaningList - + override lazy val libraryWS = new WrapperStep(libraryConfig :: actorsConfig :: dbcConfig :: swingConfig :: Nil) with Packaging { def jarContent = List(libraryConfig , actorsConfig, continuationLibraryConfig).map(_.outputDirectory ##) @@ -213,9 +213,9 @@ class ScalaSBTBuilder(val info: ProjectInfo) createJar(compilerConfig.starrPackagingConfig, log) } lazy val pasta = task { - createNewStarrJar + createNewStarrJar }.dependsOn(build) - + lazy val newStarr = task { val files = (packedStarrOutput ##) * "*.jar" FileUtilities.copy(files.get, lib, true, log) match { @@ -233,7 +233,7 @@ class ScalaSBTBuilder(val info: ProjectInfo) lazy val binQuick = tools(layerOutput / "bin", quickBinClasspath).dependsOn(finishLayer) lazy val binPack = tools(packingDestination / "bin", packBinClasspath).dependsOn(pack) } - + /** * Definition of what is specific to the strap layer @@ -246,7 +246,7 @@ class ScalaSBTBuilder(val info: ProjectInfo) override lazy val libraryWS = new WrapperStep(libraryConfig :: actorsConfig :: dbcConfig :: swingConfig :: Nil) with WrapperPackaging { lazy val packagingConfig = new PackagingConfiguration(libsDestination/libraryJarName, Set()) - + } override lazy val toolsWS = new WrapperStep(scalacheckConfig :: scalapConfig :: partestConfig :: Nil) @@ -260,7 +260,7 @@ class ScalaSBTBuilder(val info: ProjectInfo) lazy val stabilityTest = task { log.warn("Stability test must be run on a clean build in order to yield correct results.") - compare + compare }.dependsOn(finishLayer) } @@ -270,8 +270,8 @@ class ScalaSBTBuilder(val info: ProjectInfo) class LibsBuilder(val info: ProjectInfo) extends ScalaBuildProject with ReflectiveProject with Compilation with BuildInfoEnvironment { override def dependencies = info.dependencies override def watchPaths = info.projectPath / "src" ** ("*.scala" || "*.java" ||AdditionalResources.basicFilter) // Support of triggered execution at project level - - + + def buildInfoEnvironmentLocation: Path = outputRootPath / ("build-"+name+".properties") def instantiationCompilerJar: Path = locker.compilerOutput @@ -285,13 +285,13 @@ class ScalaSBTBuilder(val info: ProjectInfo) val required = "1.6" if (version.startsWith(required)) None else Some("Incompatible java version : required "+required) } - - + + private def simpleBuild(step: CompilationStep with Packaging)= task { import Packer._ compile(step) orElse createJar(step, log) }.dependsOn(locker.finishLayer) - + private def copyJar(step: CompilationStep with Packaging, name: String) = task { FileUtilities.copyFile(step.packagingConfig.jarDestination, lib/name, log) } @@ -309,18 +309,18 @@ class ScalaSBTBuilder(val info: ProjectInfo) override def sources: PathFinder = sourceRoots.descendentsExcept("*.java", ".svn") def dependencies = Seq() def options = Seq() - override def javaOptions = Seq("-target","1.5","-source","1.5","-g") + override def javaOptions = Seq("-target","1.5","-source","1.5","-g") lazy val packagingConfig = new PackagingConfiguration(libsDestination/forkjoinJarName, List(outputDirectory ##)) } - + lazy val fjbgConfig = new CompilationStep("fjbg", pathLayout, log) with Packaging { def label = "new fjbg library" - override def sources: PathFinder = sourceRoots.descendentsExcept("*.java", ".svn") + override def sources: PathFinder = sourceRoots.descendentsExcept("*.java", ".svn") def dependencies = Seq() def options = Seq() override def javaOptions = Seq("-target","1.5","-source","1.4","-g") lazy val packagingConfig = new PackagingConfiguration(libsDestination/fjbgJarName, List(outputDirectory ##)) - + } lazy val msilConfig = new CompilationStep("msil", pathLayout, log) with Packaging { @@ -329,9 +329,9 @@ class ScalaSBTBuilder(val info: ProjectInfo) def dependencies = Seq() override def classpath = super.classpath +++ quick.libraryOutput def options = Seq() - override def javaOptions = Seq("-target","1.5","-source","1.4","-g") + override def javaOptions = Seq("-target","1.5","-source","1.4","-g") lazy val packagingConfig = new PackagingConfiguration(libsDestination/msilJarName, List(outputDirectory ##)) - + } def cleaningList = layerOutput :: layerEnvironment.envBackingPath :: Nil @@ -339,7 +339,7 @@ class ScalaSBTBuilder(val info: ProjectInfo) def cleanFiles = FileUtilities.clean(cleaningList, true, log) lazy val clean: Task = task {cleanFiles}// We use super.task, so cleaning is done in every case, even when locked - + } } object ScalaSBTBuilder { diff --git a/project/build/ScalaTools.scala b/project/build/ScalaTools.scala index 9148177a96..d74639d63a 100644 --- a/project/build/ScalaTools.scala +++ b/project/build/ScalaTools.scala @@ -159,7 +159,7 @@ trait ScalaTools { val fsc = new ToolConfiguration("fsc", destination,"scala.tools.nsc.CompileClient", "",defaultJavaFlags, "", classpath) val scalap = new ToolConfiguration("scalap",destination, "scala.tools.scalap.Main", "",defaultJavaFlags, "", classpath) - + val toolList = scala :: scalac :: scaladoc :: fsc :: scalap :: Nil def process(list: List[ToolConfiguration]): Option[String] = list match { diff --git a/project/build/Scaladoc.scala b/project/build/Scaladoc.scala index eae006c45f..39bcb5226e 100644 --- a/project/build/Scaladoc.scala +++ b/project/build/Scaladoc.scala @@ -32,7 +32,7 @@ trait Scaladoc { } lazy val classpath ={ (antJar +++ jlineJar +++ msilJar +++ fjbgJar +++ forkJoinJar +++ outputLibraryJar +++ outputCompilerJar +++ outputPartestJar +++ outputScalapJar ).get - + } lazy val scaladoc = task(maybeFork(generateScaladoc, "Error generating scaladoc")) dependsOn pack |