Permalink
Browse files

Merge branch 'f/useful' into f/depot

Conflicts:
	project.clj
	src/cake/project.clj
  • Loading branch information...
2 parents 213e97f + 4b621ec commit da66907524224f2c7c233c930798b6223b9eb3a0 @amalloy amalloy committed Jun 27, 2011
View
@@ -21,10 +21,9 @@
(def ^{:dynamic true} *errs* nil)
(defn read-config [file]
- (if (.exists file)
- (with-open [f (FileInputStream. file)]
- (into {} (doto (Properties.) (.load f))))
- {}))
+ (into {} (when (.exists file)
+ (with-open [f (FileInputStream. file)]
+ (doto (Properties.) (.load f))))))
(def ^{:dynamic true} *config*
(apply merge (map read-config [(File. (System/getProperty "user.home") ".cake/config")
View
@@ -5,7 +5,6 @@
[uncle "0.2.3"]
[depot "0.1.0"]
[classlojure "0.5.1"]
- [clojure-useful "0.3.8"]
+ [useful "0.4.0"]
[com.jcraft/jsch "0.1.42"]]
:copy-deps true)
-
View
@@ -1,7 +1,8 @@
(ns cake.core
(:use cake cake.task
[cake.file :only [mkdir]]
- [useful :only [update into-map verify merge-in syntax-quote]]
+ [useful.map :only [update into-map merge-in]]
+ [useful.utils :only [verify syntax-quote]]
[clojure.contrib.condition :only [raise]]
[clojure.string :only [join]]
[bake.core :only [force?]])
View
@@ -1,6 +1,6 @@
(ns cake.file
(:use cake
- [useful :only [into-map]]
+ [useful.map :only [into-map]]
[clojure.string :only [join]]
uncle.core)
(:import [org.apache.tools.ant.taskdefs Copy Move Touch Delete Mkdir]
View
@@ -6,7 +6,7 @@
[cake.utils :only [*readline-marker*]]
[cake.project :only [reload reset-classloaders! reset-test-classloader! append-dev-dependencies!]]
[cake.tasks.swank :only [start-swank]]
- [useful :only [on-shutdown]]
+ [useful.java :only [on-shutdown]]
[bake.core :only [debug?]]
[bake.io :only [init-multi-out]]
[bake.reload :only [reload-project-files]]
@@ -7,7 +7,7 @@
[uncle.core :only [fileset-seq]]
[clojure.string :only [split join trim-newline]]
[clojure.java.shell :only [sh]]
- [useful :only [update merge-in into-map absorb]]
+ [useful.map :only [update merge-in into-map]]
[clojure.java.io :only [reader]])
(:import [java.io File]))
@@ -224,4 +224,3 @@
(assoc-path :dev-library-path :library-path "dev")
(assoc-path :ext-library-path :library-path "ext")
(assoc-path :test-compile-path :test-path "classes"))))
-
View
@@ -5,7 +5,7 @@
[clojure.main :only [skip-whitespace]]
[bake.io :only [with-streams]]
[bake.reload :only [reload]]
- [useful :only [if-ns]])
+ [useful.utils :only [if-ns]])
(:require [cake.utils.server-socket :as server-socket]
[bake.complete :as complete])
(:import [java.io File PrintStream InputStreamReader OutputStreamWriter PrintWriter OutputStream
View
@@ -3,7 +3,8 @@
[clojure.set :only [difference]]
[bake.core :only [print-stacktrace log verbose?]]
[cake.file :only [file newer? touch]]
- [useful :only [update verify adjoin]]
+ [useful.utils :only [verify adjoin]]
+ [useful.map :only [update]]
[uncle.core :only [*task-name*]]
[clojure.java.io :only [writer]]
[clojure.contrib.prxml :only [*prxml-indent* prxml]]))
@@ -6,7 +6,7 @@
[cake.project :only [reset-classloaders! with-classloader classpath]]
[bake.core :only [verbose? debug? log os-name os-arch]]
[cake.utils :only [sudo prompt-read]]
- [useful :only [pluralize]])
+ [useful.string :only [pluralize]])
(:import [org.apache.tools.ant.taskdefs Copy Javac Java]))
(declare copy-native)
@@ -5,7 +5,8 @@
[clojure.java.io :only [copy writer]]
[clojure.string :only [join]]
[cake.tasks.compile :only [source-dir]]
- [useful :only [absorb verify into-map]])
+ [useful.utils :only [verify]]
+ [useful.map :only [into-map]])
(:require [clojure.xml :as xml])
(:import [org.apache.tools.ant.taskdefs Jar War Copy Delete Chmod Replace]
[org.apache.tools.ant.types FileSet ZipFileSet]
@@ -28,7 +29,8 @@
"Built-By" (System/getProperty "user.name")
"Build-Jdk" (System/getProperty "java.version")
"Class-Path" (:jar-classpath *project*)
- "Main-Class" (absorb (:main *project*) (-> str (.replaceAll "-" "_")))}))
+ "Main-Class" (when-let [main (:main *project*)]
+ (-> main str (.replaceAll "-" "_")))}))
(defn add-license [task]
(add-fileset task {:file (file "LICENSE")}))
@@ -1,5 +1,5 @@
(ns cake.tasks.ng
- (:use cake cake.core [useful :only [if-ns]]))
+ (:use cake cake.core [useful.utils :only [if-ns]]))
(if-ns (:import vimclojure.nailgun.NGServer)
(do
@@ -3,8 +3,9 @@
[bake.core :only [verbose? debug? log]]
[cake.tasks.jar :only [jarfile uberjarfile warfile]]
[clojure.java.io :only [reader copy]]
- [useful :only [verify assoc-or]]
- [cake.utils :only [prompt-read]])
+ [useful.utils :only [verify]]
+ [useful.map :only [assoc-or]]
+ [cake.utils :only [prompt-read]])
(:import [com.jcraft.jsch JSch ChannelExec Logger UserInfo JSchException UIKeyboardInteractive]
[java.io FileInputStream]))
@@ -16,8 +17,9 @@
(list (if (.startsWith identity "/")
(file identity)
(file "~/.ssh" identity)))
- (for [id (list "id_rsa" "id_dsa" "identity") :let [keyfile (file "~/.ssh" id)] :when (.exists keyfile)]
- keyfile)))
+ (filter #(.exists %)
+ (for [id ["id_rsa" "id_dsa" "identity"]]
+ (file "~/.ssh" id)))))
(defn- log-auth [username host keyfile message]
(when (verbose?)
@@ -85,7 +87,7 @@
(defmacro ssh-session [opts & forms]
`(ssh-session* ~opts ~@(map (partial list 'fn []) forms)))
-(defn log-host [& message]
+(defn log-host [& message]
(apply log (format "[%s]" (.getHost *session*)) message))
(defn copy-to-log [out]
@@ -1,6 +1,6 @@
(ns cake.tasks.swank
(:use cake cake.core
- [useful :only [if-ns]]
+ [useful.utils :only [if-ns]]
[bake.core :only [current-context]])
(:import [java.io StringWriter PrintWriter]))
@@ -2,9 +2,9 @@
(:use cake cake.core uncle.core
[bake.core :only [log]]
[cake.utils :only [ftime]]
- [useful :only [update]]
+ [useful.map :only [update]]
[clojure.string :only [join]]
- [cake.utils :only [git]])
+ [cake.utils :only [git]])
(:import [org.apache.tools.ant.taskdefs Replace]))
(def version-levels [:major :minor :patch])

0 comments on commit da66907

Please sign in to comment.