From fbd06c94329655346d265574a7a28b103abdec93 Mon Sep 17 00:00:00 2001 From: Christopher Vogt Date: Sun, 19 Feb 2017 09:07:06 +0800 Subject: allow git dependencies on sub builds --- stage2/GitDependency.scala | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'stage2') diff --git a/stage2/GitDependency.scala b/stage2/GitDependency.scala index ecd0ee1..f2ac7a6 100644 --- a/stage2/GitDependency.scala +++ b/stage2/GitDependency.scala @@ -11,12 +11,19 @@ object GitDependency{ val GitUrl = "(git:|https:|file:/)//([^/]+)/(.+)".r } case class GitDependency( - url: String, ref: String, subDirectory: Option[String] = None // example: git://github.com/cvogt/cbt.git# + url: String, ref: String, subDirectory: Option[String] = None, // example: git://github.com/cvogt/cbt.git# + pathToNestedBuild: Seq[String] = Seq() )(implicit val logger: Logger, classLoaderCache: ClassLoaderCache, context: Context ) extends DependencyImplementation{ import GitDependency._ override def lib = new Lib(logger) def classLoaderCache = context.classLoaderCache - def moduleKey = this.getClass.getName ++ "(" ++ url ++ subDirectory.map("/" ++ _).getOrElse("") ++ "#" ++ ref ++ ")" + def moduleKey = ( + this.getClass.getName + ++ "(" ++ url ++ subDirectory.map("/" ++ _).getOrElse("") ++ "#" ++ ref + ++ ", " + ++ pathToNestedBuild.mkString(", ") + ++ ")" + ) def transientCache = context.transientCache // TODO: add support for authentication via ssh and/or https // See http://www.codeaffine.com/2014/12/09/jgit-authentication/ @@ -69,7 +76,8 @@ case class GitDependency( DirectoryDependency( context.copy( workingDirectory = checkout ++ subDirectory.map("/" ++ _).getOrElse("") - ) + ), + pathToNestedBuild: _* ) } -- cgit v1.2.3