Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated to use clojure 1.3.0

  • Loading branch information...
commit ec8ad4b86c74d0b240573da59109f2e943740a8a 1 parent 3373694
@zk authored
View
7 project.clj
@@ -1,10 +1,11 @@
(defproject cd-analyzer "0.1.0-SNAPSHOT"
:description "FIXME: write"
:dependencies [[org.clojure/clojure "1.3.0"]
- [org.clojure/clojure-contrib "1.2.0"]
+ [org.clojure/java.jdbc "0.0.6"]
[mysql/mysql-connector-java "5.1.12"]
[org.slf4j/slf4j-api "1.6.1"]
[ch.qos.logback/logback-classic "0.9.24"]
- [clj-stacktrace"0.1.3"]]
- :dev-dependencies [[swank-clojure "1.2.0"]]
+ [clj-stacktrace"0.1.3"]
+ [hiccup "0.3.6"]]
+ :dev-dependencies [[swank-clojure "1.4.0-SNAPSHOT"]]
:main main)
View
2  src/cd_analyzer/clojurecore.clj
@@ -2,7 +2,7 @@
(:use [hiccup.core]
[cd-analyzer.core]
[clojure.contrib.sql]
- [clojure.contrib.pprint])
+ [clojure.pprint :only (pprint)])
(:require [clojure.zip :as zip]))
(declare db)
View
4 src/cd_analyzer/language.clj
@@ -1,8 +1,8 @@
(ns cd-analyzer.language
- (:use [clojure.contrib.pprint]
+ (:use [clojure.pprint :only (pprint)]
[clojure.repl :only (source-fn)]
[clojure.string :only (split-lines trim)])
- (:import [clojure.lang LineNumberingPushbackReader]
+ (:import [clojure.lang LineNumberingPushbackReader Namespace]
[java.io File FileReader StringReader]))
(defn mkfile [& parts]
View
7 src/cd_analyzer/runner.clj
@@ -2,9 +2,8 @@
(:use [cd-analyzer.util]
[cd-analyzer.language]
[cd-analyzer.core]
- [clojure.contrib.pprint]
- [clojure.java.shell]
- [clojure.contrib.except :only (throwf)]))
+ [clojure.pprint :only (pprint)]
+ [clojure.java.shell]))
(defn clone-target-repo [git-url download-to-dir]
@@ -43,7 +42,7 @@
(defn run-update-for [git-url]
(let [start (System/currentTimeMillis)]
- #_ (when (not (.exists (java.io.File. proj-root))) (throwf "Couldn't find project root: %s" proj-root))
+ #_ (when (not (.exists (java.io.File. proj-root))) (throw (Exception. "Couldn't find project root: %s") proj-root))
(reportln (str "Running update for " git-url " on " (java.util.Date.)))
(reportln "-----------------------------------------")
(with-temp-dir tmp-dir
View
15 src/cd_analyzer/util.clj
@@ -1,4 +1,15 @@
-(ns cd-analyzer.util)
+(ns cd-analyzer.util
+ (:use [clojure.java.io :only (delete-file file)]))
+
+(defn delete-file-recursively
+ "Delete file f. If it's a directory, recursively delete all its contents.
+Raise an exception if any deletion fails unless silently is true."
+ [f & [silently]]
+ (let [f (file f)]
+ (if (.isDirectory f)
+ (doseq [child (.listFiles f)]
+ (delete-file-recursively child silently)))
+ (delete-file f silently)))
(defmacro with-temp-dir [dir & body]
`(when-let [temp-file# (java.io.File/createTempFile (.toString (java.util.UUID/randomUUID)) "")]
@@ -7,7 +18,7 @@
(when-let [temp-dir# (.getAbsolutePath temp-file#)]
((fn [~dir]
(let [res# (do ~@body)]
- (clojure.contrib.io/delete-file-recursively temp-dir#)
+ (delete-file-recursively temp-dir#)
res#)) temp-dir#))))
(def *reporting-on* true)
Please sign in to comment.
Something went wrong with that request. Please try again.