Commits

Meikel Brandmeyer committed 9e40ef9

Adapt core to driver and remove dependency on contrib

  • Participants
  • Parent commits d4d1759

Comments (0)

Files changed (2)

File build.gradle

 group = 'cljtags'
 version = '1.0.0-SNAPSHOT'
 
-aotCompile = true
 
 gradleHomeRepo repositories
 clojureSnapshotsRepo repositories
 
 dependencies {
     compile 'net.sf.jopt-simple:jopt-simple:2.4.1'
-    compile 'org.clojure:clojure:1.1.0'
-    compile 'org.clojure:clojure-contrib:1.1.0-master-SNAPSHOT'
+    compile 'org.clojure:clojure:1.+'
 }
 
 defaultTasks 'build'

File src/main/clojure/cljtags/core.clj

 ; THE SOFTWARE.
 
 (ns cljtags.core
-  (:gen-class)
   (:import
-     (java.io File))
-  (:use
-     [clojure.contrib.duck-streams :only (writer)]
-     [clojure.contrib.command-line :only (with-command-line)]))
+     (java.io File FileWriter)))
 
 (defn- mangle-name
   "Replace - with _ in directories and filenames."
                                                           [p nspath file]))))
           line)))
 
-(defn -main
+(defn tags
   "Walk the given namespaces and generate a tags file containing
   all tags for the given namespaces."
-  [& args]
-  (with-command-line args
-    "cljtags -- Generate tags for Clojure sources"
-    [[prefix "Prefix for the source directory" "src"]
-     [output "The output file"                 "tags"]
-     namespaces]
-    (with-open [w (writer (File. output))]
+  [options]
+  (let [{:keys [prefix output namespaces]} options]
+    (with-open [w (FileWriter. (File. output))]
       (binding [*out* w]
         (let [namespaces (map symbol namespaces)]
           (doseq [n namespaces] (require n))