/* sbt -- Simple Build Tool * Copyright 2009, 2010 Mark Harrah */ package xsbt.boot import java.io.File // // scala-/ [baseDirectoryName] // lib/ [ScalaDirectoryName] // -/ [appDirectoryName] // // see also ProjectProperties for the set of constants that apply to the build.properties file in a project private object BootConfiguration { // these are the Scala module identifiers to resolve/retrieve val ScalaOrg = "org.scala-lang" val CompilerModuleName = "scala-compiler" val LibraryModuleName = "scala-library" val JUnitName = "junit" val SbtOrg = "org.scala-sbt" /** The Ivy conflict manager to use for updating.*/ val ConflictManagerName = "latest-revision" /** The name of the local Ivy repository, which is used when compiling sbt from source.*/ val LocalIvyName = "local" /** The pattern used for the local Ivy repository, which is used when compiling sbt from source.*/ val LocalPattern = "[organisation]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext]" /** The artifact pattern used for the local Ivy repository.*/ def LocalArtifactPattern = LocalPattern /** The Ivy pattern used for the local Ivy repository.*/ def LocalIvyPattern = LocalPattern final val FjbgPackage = "ch.epfl.lamp.fjbg." /** The class name prefix used to hide the Scala classes used by this loader from the application */ final val ScalaPackage = "scala." /** The class name prefix used to hide the Ivy classes used by this loader from the application*/ final val IvyPackage = "org.apache.ivy." /** The class name prefix used to hide the launcher classes from the application. * Note that access to xsbti classes are allowed.*/ final val SbtBootPackage = "xsbt.boot." /** The prefix for JLine resources.*/ final val JLinePackagePath = "jline/" /** The loader will check that these classes can be loaded and will assume that their presence indicates * the Scala compiler and library have been downloaded.*/ val TestLoadScalaClasses = "scala.Option" :: "scala.tools.nsc.Global" :: Nil val ScalaHomeProperty = "scala.home" val UpdateLogName = "update.log" val DefaultChecksums = "sha1" :: "md5" :: Nil val DefaultIvyConfiguration = "default" private val ScalaDirectoryName = "lib" /** The name of the directory within the boot directory to retrieve scala to. * scalaOrg is appended if non-standard scala is used. * * The reason for this inconsistency is backward compatiblity and * relatively infrequent use of non-standard scalaOrg */ def scalaDirectoryName(scalaOrg: String) = scalaOrg match { case ScalaOrg => ScalaDirectoryName case _ => ScalaDirectoryName + "-" + scalaOrg } /** The Ivy pattern to use for retrieving the scala compiler and library. It is relative to the directory * containing all jars for the requested version of scala. */ def scalaRetrievePattern(scalaOrg: String) = scalaDirectoryName(scalaOrg) + "/[artifact](-[classifier]).[ext]" def artifactType(classifier: String) = classifier match { case "sources" => "src" case "javadoc" => "doc" case _ => "jar" } /** The Ivy pattern to use for retrieving the application and its dependencies. It is relative to the directory * containing all jars for the requested version of scala. */ def appRetrievePattern(appID: xsbti.ApplicationID) = appDirectoryName(appID, "/") + "(/[component])/[artifact]-[revision](-[classifier]).[ext]" val ScalaDirPrefix = "scala-" /** The name of the directory to retrieve the application and its dependencies to.*/ def appDirectoryName(appID: xsbti.ApplicationID, sep: String) = appID.groupID + sep + appID.name + sep + appID.version /** The name of the directory in the boot directory to put all jars for the given version of scala in.*/ def baseDirectoryName(scalaVersion: Option[String]) = scalaVersion match { case None => "other" case Some(sv) => ScalaDirPrefix + sv } def extractScalaVersion(dir: File): Option[String] = { val name = dir.getName if(name.startsWith(ScalaDirPrefix)) Some(name.substring(ScalaDirPrefix.length)) else None } } private object ProxyProperties { val HttpProxyEnv = "http_proxy" val HttpProxyUser = "http_proxy_user" val HttpProxyPassword = "http_proxy_pass" val ProxyHost = "http.proxyHost" val ProxyPort = "http.proxyPort" val ProxyUser = "http.proxyUser" val ProxyPassword = "http.proxyPassword" }