diff src/rlm/general_export.clj @ 0:78a630e650d2

initial import
author Robert McIntyre <rlm@mit.edu>
date Tue, 18 Oct 2011 00:57:08 -0700
parents
children
line wrap: on
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/rlm/general_export.clj	Tue Oct 18 00:57:08 2011 -0700
     1.3 @@ -0,0 +1,34 @@
     1.4 +(ns rlm.general-export
     1.5 +  (:use coderloop.export-files)
     1.6 +  (:use clojure.java.io)
     1.7 +  (:use [clojure.contrib [duck-streams :only [file-str]]])
     1.8 +  (:use [rlm
     1.9 +	 [classpath-utils :only [classpath]]
    1.10 +	 [shell-write :only [sw]]])
    1.11 +  (:require clojure.string)
    1.12 +  (:import java.io.File)
    1.13 +  (:import [org.apache.commons.io FileUtils]))
    1.14 +
    1.15 +
    1.16 +;;(def *nailgun* true)
    1.17 +;;; put standard base-path on the classpath
    1.18 +(def *standard-base-directory* (file-str "~/.clojure-exports/"))
    1.19 +
    1.20 +
    1.21 +(defn clear-directory [dir]
    1.22 +  (FileUtils/forceMkdir standard-base-directory)
    1.23 +  (FileUtils/forceDelete standard-base-directory)
    1.24 +  (FileUtils/forceMkdir standard-base-directory))
    1.25 +
    1.26 +
    1.27 +(defn export-bzip [destination bzip-name namespace src lib]
    1.28 +  (clear-directory *standard-base-directory*)
    1.29 +  (let [new-dir
    1.30 +	(file-str
    1.31 +	 (str (.getCanonicalPath standard-base-directory)
    1.32 +	  (File/separatorChar) bzip-name ))]
    1.33 +    (export-dependencies namespace new-dir src lib)
    1.34 +    (make-run-script namespace new-dir bzip-name src lib)
    1.35 +    (bzip-export-files new-dir destination bzip-name ".tar.bz2" src lib)))
    1.36 +
    1.37 +(defn export-eclipse [target-source-dir target-jar-dir clojure-jar-name namespace])