diff options
author | Christopher Vogt <oss.nsp@cvogt.org> | 2016-02-06 13:03:36 -0500 |
---|---|---|
committer | Christopher Vogt <oss.nsp@cvogt.org> | 2016-03-04 15:06:30 -0500 |
commit | 974942db43ff2d1fa7ba71ad60f9bb9eae2d8631 (patch) | |
tree | d7235df9d4d6a67753dc2a20ab6bfcb7a24dc74c /stage2/dependencies.scala | |
download | cbt-974942db43ff2d1fa7ba71ad60f9bb9eae2d8631.tar.gz cbt-974942db43ff2d1fa7ba71ad60f9bb9eae2d8631.tar.bz2 cbt-974942db43ff2d1fa7ba71ad60f9bb9eae2d8631.zip |
CBT Version 1.0-BETA
Diffstat (limited to 'stage2/dependencies.scala')
-rw-r--r-- | stage2/dependencies.scala | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/stage2/dependencies.scala b/stage2/dependencies.scala new file mode 100644 index 0000000..8ed36eb --- /dev/null +++ b/stage2/dependencies.scala @@ -0,0 +1,36 @@ +package cbt +import java.io.File +import scala.collection.immutable.Seq +/* +sealed abstract class ProjectProxy extends Ha{ + protected def delegate: ProjectMetaData + def artifactId: String = delegate.artifactId + def groupId: String = delegate.groupId + def version: String = delegate.version + def exportedClasspath = delegate.exportedClasspath + def dependencies = Seq(delegate) +} +*/ +trait TriggerLoop extends Dependency{ + def triggerLoopFiles: Seq[File] +} +/** You likely want to use the factory method in the BasicBuild class instead of this. */ +case class BuildDependency(context: Context) extends TriggerLoop{ + override def show = this.getClass.getSimpleName + "("+context.cwd+")" + final override lazy val logger = context.logger + final override lazy val lib: Lib = new Lib(logger) + private val root = lib.loadRoot( context.copy(args=Seq()) ) + lazy val build = root.finalBuild + def exportedClasspath = ClassPath(Seq()) + def exportedJars = Seq() + def dependencies = Seq(build) + def triggerLoopFiles = root.triggerLoopFiles + final val updated = build.updated +} +/* +case class DependencyOr(first: BuildDependency, second: MavenDependency) extends ProjectProxy with BuildDependencyBase{ + val isFirst = new File(first.context.cwd).exists + def triggerLoopFiles = if(isFirst) first.triggerLoopFiles else Seq() + protected val delegate = if(isFirst) first else second +} +*/
\ No newline at end of file |