diff options
author | Christopher Vogt <oss.nsp@cvogt.org> | 2016-04-27 09:55:00 -0400 |
---|---|---|
committer | Christopher Vogt <oss.nsp@cvogt.org> | 2016-04-28 13:34:01 -0400 |
commit | f946be87b81cc9cb040ab5e3f8a5195a915ad1e4 (patch) | |
tree | 2907459834a584fb0f34992c3c3b9af5647a745b /stage1 | |
parent | 7f9380157a5cf95e767f74d6f7c52da24ea8f51f (diff) | |
download | cbt-f946be87b81cc9cb040ab5e3f8a5195a915ad1e4.tar.gz cbt-f946be87b81cc9cb040ab5e3f8a5195a915ad1e4.tar.bz2 cbt-f946be87b81cc9cb040ab5e3f8a5195a915ad1e4.zip |
minor improvements to docs, imports, visibilities
Diffstat (limited to 'stage1')
-rw-r--r-- | stage1/Cache.scala | 2 | ||||
-rw-r--r-- | stage1/MultiClassLoader.scala | 1 | ||||
-rw-r--r-- | stage1/cbt.scala | 2 | ||||
-rw-r--r-- | stage1/resolver.scala | 11 |
4 files changed, 9 insertions, 7 deletions
diff --git a/stage1/Cache.scala b/stage1/Cache.scala index 6e6b9eb..a8036e5 100644 --- a/stage1/Cache.scala +++ b/stage1/Cache.scala @@ -1,6 +1,6 @@ package cbt /** -Caches exactly one value +Caches exactly one value. Is there a less boiler-platy way to achieve this, that doesn't require creating an instance for each thing you want to cache? */ diff --git a/stage1/MultiClassLoader.scala b/stage1/MultiClassLoader.scala index cce4cd5..74e65aa 100644 --- a/stage1/MultiClassLoader.scala +++ b/stage1/MultiClassLoader.scala @@ -1,6 +1,5 @@ package cbt import java.net._ -import scala.util.Try import scala.collection.immutable.Seq // do not make this a case class, required object identity equality diff --git a/stage1/cbt.scala b/stage1/cbt.scala index 01af0d5..7b8b632 100644 --- a/stage1/cbt.scala +++ b/stage1/cbt.scala @@ -2,6 +2,8 @@ package cbt import java.io._ import java.nio.file._ import java.net._ +import scala.collection.immutable.Seq + object `package`{ private val lib = new BaseLib implicit class FileExtensionMethods( file: File ){ diff --git a/stage1/resolver.scala b/stage1/resolver.scala index c2855c5..ad6df23 100644 --- a/stage1/resolver.scala +++ b/stage1/resolver.scala @@ -159,7 +159,7 @@ abstract class Dependency{ noInfo ++ BoundMavenDependency.updateOutdated( hasInfo ).reverse.distinct } - def show: String = this.getClass.getSimpleName + override def show: String = this.getClass.getSimpleName // ========== debug ========== def dependencyTree: String = dependencyTreeRecursion() private def dependencyTreeRecursion(indent: Int = 0): String = ( @@ -296,6 +296,7 @@ case class BoundMavenDependency( import scala.collection.JavaConversions._ private def resolve(suffix: String, hash: Option[String]): File = { + logger.resolver("Resolving "+this) val file = mavenCache ++ basePath ++ "." ++ suffix val urls = repositories.map(_ ++ basePath ++ "." ++ suffix) urls.find( @@ -325,10 +326,10 @@ case class BoundMavenDependency( private object pomCache extends Cache[File] def pom: File = pomCache{ resolve("pom", Some(pomSha1)) } - def pomXml = XML.loadFile(pom.string) + private def pomXml = XML.loadFile(pom.string) // ========== pom traversal ========== - lazy val transitivePom: Seq[BoundMavenDependency] = { + private lazy val transitivePom: Seq[BoundMavenDependency] = { (pomXml \ "parent").collect{ case parent => BoundMavenDependency( @@ -342,7 +343,7 @@ case class BoundMavenDependency( }.flatMap(_.transitivePom) :+ this } - lazy val properties: Map[String, String] = ( + private lazy val properties: Map[String, String] = ( transitivePom.flatMap{ d => val props = (d.pomXml \ "properties").flatMap(_.child).map{ tag => tag.label -> tag.text @@ -352,7 +353,7 @@ case class BoundMavenDependency( } ).toMap - lazy val dependencyVersions: Map[String, (String,String)] = + private lazy val dependencyVersions: Map[String, (String,String)] = transitivePom.flatMap( p => (p.pomXml \ "dependencyManagement" \ "dependencies" \ "dependency").map{ |