aboutsummaryrefslogtreecommitdiff
path: root/stage2/LazyDependency.scala
diff options
context:
space:
mode:
authorChristopher Vogt <oss.nsp@cvogt.org>2017-03-19 19:51:38 -0400
committerChristopher Vogt <oss.nsp@cvogt.org>2017-03-20 02:56:26 -0400
commitd6245c8dc5c7b2f885d538b39f685327da252863 (patch)
tree846bdd92ad022dbe5a7a45e0b9d5e75bbf7779c8 /stage2/LazyDependency.scala
parentca099eba708f3618bed75a5940a5a5ae1d10b684 (diff)
downloadcbt-d6245c8dc5c7b2f885d538b39f685327da252863.tar.gz
cbt-d6245c8dc5c7b2f885d538b39f685327da252863.tar.bz2
cbt-d6245c8dc5c7b2f885d538b39f685327da252863.zip
Unify reflectively loading builds from directories.
THis is mostly cleanup and a little bit feature. Before it was done partially in 3 places, BuildBuild, loadRoot and GitDependency. Now DirectoryDependencies also support referencing sub-builds. Also introduce scalariform for the first few files of cbt's core code :).
Diffstat (limited to 'stage2/LazyDependency.scala')
-rw-r--r--stage2/LazyDependency.scala17
1 files changed, 17 insertions, 0 deletions
diff --git a/stage2/LazyDependency.scala b/stage2/LazyDependency.scala
new file mode 100644
index 0000000..afc6263
--- /dev/null
+++ b/stage2/LazyDependency.scala
@@ -0,0 +1,17 @@
+package cbt
+class LazyDependency( _dependency: => Dependency )( implicit logger: Logger, transientCache: java.util.Map[AnyRef, AnyRef], classLoaderCache: ClassLoaderCache ) extends Dependency {
+ lazy val dependency = _dependency
+ def classLoader = dependency.classLoader
+ def dependenciesArray = Array( dependency )
+ def exportedClasspathArray = Array()
+ def lastModified = dependency.lastModified
+ lazy val moduleKey = show
+ def show = s"LazyDependency(${dependency.show})"
+ override def toString = show
+ override def equals( other: Any ) = other match {
+ case d: LazyDependency => d.dependency === dependency
+ case _ => false
+ }
+ def dependencyClasspathArray = dependency.classpath.files.toArray
+ def needsUpdateCompat = false
+}