package xsbt.boot
import java.io.File
private object BootConfiguration {
val ScalaOrg = "org.scala-lang"
val CompilerModuleName = "scala-compiler"
val LibraryModuleName = "scala-library"
val JUnitName = "junit"
val JAnsiVersion = "1.11"
val SbtOrg = "org.scala-sbt"
val ConflictManagerName = "latest-revision"
val LocalIvyName = "local"
val LocalPattern = "[organisation]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext]"
def LocalArtifactPattern = LocalPattern
def LocalIvyPattern = LocalPattern
final val FjbgPackage = "ch.epfl.lamp.fjbg."
final val ScalaPackage = "scala."
final val IvyPackage = "org.apache.ivy."
final val SbtBootPackage = "xsbt.boot."
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"
val ScalaDirectoryName = "lib"
val scalaRetrievePattern = ScalaDirectoryName + "/[artifact](-[classifier]).[ext]"
def artifactType(classifier: String) =
classifier match {
case "sources" => "src"
case "javadoc" => "doc"
case _ => "jar"
}
def appRetrievePattern(appID: xsbti.ApplicationID) = appDirectoryName(appID, "/") + "(/[component])/[artifact]-[revision](-[classifier]).[ext]"
val ScalaVersionPrefix = "scala-"
def appDirectoryName(appID: xsbti.ApplicationID, sep: String) = appID.groupID + sep + appID.name + sep + appID.version
def baseDirectoryName(scalaOrg: String, scalaVersion: Option[String]) = scalaVersion match {
case None => "other"
case Some(sv) => (if (scalaOrg == ScalaOrg) "" else scalaOrg + ".") + ScalaVersionPrefix + sv
}
def (: File): Option[String] =
{
val = dir.getName
if (name.contains(ScalaVersionPrefix))
Some(name.substring(name.lastIndexOf(ScalaVersionPrefix) + ScalaVersionPrefix.length))
else
None
}
}
private final class ProxyProperties(
val envURL: String,
val envUser: String,
val envPassword: String,
val sysHost: String,
val sysPort: String,
val sysUser: String,
val sysPassword: String)
private object ProxyProperties {
val http = apply("http")
val https = apply("https")
val ftp = apply("ftp")
def apply(pre: String) = new ProxyProperties(
pre + "_proxy",
pre + "_proxy_user",
pre + "_proxy_pass",
pre + ".proxyHost",
pre + ".proxyPort",
pre + ".proxyUser",
pre + ".proxyPassword"
)
}