This repository has been archived by the owner on Jun 2, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f028451
commit dd7a7a4
Showing
9 changed files
with
138 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
(ns cork.screw.deps.git | ||
(:use [clojure.contrib.shell-out] | ||
(:use [clojure.contrib shell-out java-utils] | ||
[cork.screw utils])) | ||
|
||
(defmethod cork.screw.deps/fetch-source-dependency :git | ||
[[name version type url]] | ||
(let [dir (str cork.screw.deps/corkscrew-dir "/git/" name)] | ||
(let [git-dir (str cork.screw.deps/corkscrew-dir "/git/") | ||
dir (str git-dir name)] | ||
(when (or cork.screw.deps/*force-fetch* | ||
(not (.exists (java.io.File. dir)))) | ||
(.mkdirs (java.io.File. dir)) | ||
(with-sh-dir dir | ||
(not (.exists (file dir)))) | ||
(.mkdirs (file git-dir)) | ||
(with-sh-dir git-dir | ||
(sh "git" "clone" url) | ||
(sh "git" "checkout" version))) | ||
dir)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
(ns cork.screw.test.maven | ||
(:use [cork.screw.deps.maven] :recload-all) | ||
(:use [clojure.contrib test-is] | ||
[clojure.xml])) | ||
|
||
(deftest test-pom | ||
(is (= "<?xml version='1.0' encoding='UTF-8'?> | ||
<project xmlns='http://maven.apache.org/POM/4.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd'> | ||
<modelVersion> | ||
4.0.0 | ||
</modelVersion> | ||
<parent> | ||
<artifactId> | ||
clojure-pom | ||
</artifactId> | ||
<groupId> | ||
org.clojure | ||
</groupId> | ||
<version> | ||
1.0-SNAPSHOT | ||
</version> | ||
</parent> | ||
<artifactId> | ||
my-sample | ||
</artifactId> | ||
<name> | ||
my-sample | ||
</name> | ||
<groupId> | ||
my-sample | ||
</groupId> | ||
<version> | ||
1.0 | ||
</version> | ||
<dependencies> | ||
<dependency> | ||
<artifactId> | ||
clojure | ||
</artifactId> | ||
<groupId> | ||
org.clojure | ||
</groupId> | ||
<version> | ||
1.0.0 | ||
</version> | ||
</dependency> | ||
<dependency> | ||
<artifactId> | ||
tagsoup | ||
</artifactId> | ||
<groupId> | ||
tagsoup | ||
</groupId> | ||
<version> | ||
1.2 | ||
</version> | ||
</dependency> | ||
</dependencies> | ||
</project> | ||
" (with-out-str | ||
(emit (pom-for {:name "my-sample" | ||
:version "1.0" | ||
:main 'my-sample | ||
:dependencies [["clojure" "1.0.0" "org.clojure"] | ||
["tagsoup" "1.2"]]})))))) |