 (ns lancet.core
   (:gen-class)
-  (:use [clojure.contrib.except :only (throw-if)]
-        clojure.contrib.shell-out
-        [clojure.contrib.str-utils :only (re-split)])
-  (:import (java.beans Introspector) (java.util.concurrent CountDownLatch)))
+  (:import (java.beans Introspector)
+           (java.util.concurrent CountDownLatch)
+           (org.apache.tools.ant.types Path)))
+
+(def #^{:doc "Dummy ant project to keep Ant tasks happy"}
+  ant-project
+  (let [proj (org.apache.tools.ant.Project.)
+        logger (org.apache.tools.ant.NoBannerLogger.)]
+    (doto logger
+      (.setMessageOutputLevel org.apache.tools.ant.Project/MSG_INFO)
+      (.setEmacsMode true)
+      (.setOutputPrintStream System/out)
+      (.setErrorPrintStream System/err))
+    (doto proj
+      (.init)
+      (.addBuildListener logger))))
 
 (defmulti coerce (fn [dest-class src-inst] [dest-class (class src-inst)]))
 

(defmethod coerce [Boolean/TYPE String] [_ str]
  (contains? #{"on" "yes" "true"} (.toLowerCase str)))
(defmethod coerce :default [dest-cls obj] (cast dest-cls obj))

(defn env [val]
  (System/getenv (name val)))

(defn- build-sh-args [args]
  (concat (re-split #"\s+" (first args)) (rest args)))

(defn system [& args]
  (println (apply sh (build-sh-args args))))

(def
 #^{:doc "Dummy ant project to keep Ant tasks happy"}
 ant-project
 (let [proj (org.apache.tools.ant.Project.)
       logger (org.apache.tools.ant.NoBannerLogger.)]
   (doto logger
     (.setMessageOutputLevel org.apache.tools.ant.Project/MSG_INFO)
     (.setOutputPrintStream System/out)
     (.setErrorPrintStream System/err))
   (doto proj
     (.init)
     (.addBuildListener logger))))

(defn property-descriptor [inst prop-name]
  (first


(define-all-ant-tasks)

;; Newer versions of ant don't have this class:
;; (define-ant-type files org.apache.tools.ant.types.resources.Files)
(define-ant-type fileset org.apache.tools.ant.types.FileSet)

(defn -main [& targs]
