summaryrefslogtreecommitdiff
path: root/crashbox-server/src/main/scala/io/crashbox/ci/Git.scala
diff options
context:
space:
mode:
authorJakob Odersky <jakob@odersky.com>2017-03-18 01:58:01 -0400
committerJakob Odersky <jakob@odersky.com>2017-03-18 01:58:01 -0400
commitdff97b40df39e5eb391e1fc30ca47180384f1747 (patch)
tree76d1a4d3af4c8a0b8b316a151d40493e8f22957b /crashbox-server/src/main/scala/io/crashbox/ci/Git.scala
parent3f00b87a022e92e3bf341d40d05d81b5538e4974 (diff)
downloadcrashbox-ci-dff97b40df39e5eb391e1fc30ca47180384f1747.tar.gz
crashbox-ci-dff97b40df39e5eb391e1fc30ca47180384f1747.tar.bz2
crashbox-ci-dff97b40df39e5eb391e1fc30ca47180384f1747.zip
Refactor trait-based dependencies to constructor parametersnocake
Diffstat (limited to 'crashbox-server/src/main/scala/io/crashbox/ci/Git.scala')
-rw-r--r--crashbox-server/src/main/scala/io/crashbox/ci/Git.scala21
1 files changed, 21 insertions, 0 deletions
diff --git a/crashbox-server/src/main/scala/io/crashbox/ci/Git.scala b/crashbox-server/src/main/scala/io/crashbox/ci/Git.scala
new file mode 100644
index 0000000..db39891
--- /dev/null
+++ b/crashbox-server/src/main/scala/io/crashbox/ci/Git.scala
@@ -0,0 +1,21 @@
+package io.crashbox.ci
+
+import java.io.File
+import java.net.URL
+
+import scala.concurrent.Future
+
+import org.eclipse.jgit.api.{Git => JGit}
+
+object Git {
+
+ def fetchSource(from: URL, to: File)(implicit core: Core): Future[File] = {
+ import core._
+ Future {
+ log.debug(s"Cloning git repo from $from to $to")
+ JGit.cloneRepository.setURI(from.toURI.toString).setDirectory(to).call()
+ to
+ }(blockingDispatcher)
+ }
+
+}