A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/boot-clj/boot/commit/1a76579304e816d3407a00c114b0bd4a8b82a549 below:

Expose repl task dependencies · boot-clj/boot@1a76579 · GitHub

File tree Expand file treeCollapse file tree 4 files changed

+48

-20

lines changed

Filter options

Expand file treeCollapse file tree 4 files changed

+48

-20

lines changed Original file line number Diff line number Diff line change

@@ -0,0 +1,8 @@

1 +

(ns boot.repl)

2 + 3 +

(def ^:dynamic *default-dependencies*

4 +

(atom '[[org.clojure/tools.nrepl "0.2.4"]]))

5 + 6 +

(def ^:dynamic *default-middleware*

7 +

(atom ['boot.from.io.aviso.nrepl/pretty-middleware]))

8 + Original file line number Diff line number Diff line change

@@ -1,6 +1,7 @@

1 1

(ns boot.repl-server

2 2

(:require

3 3

[boot.core :as core]

4 +

[boot.repl :as repl]

4 5

[boot.from.io.aviso.nrepl :as pretty]

5 6

[clojure.java.io :as io]

6 7

[clojure.tools.nrepl.server :as server]

@@ -38,8 +39,6 @@

38 39

#'pretty/pretty-middleware

39 40

{:requires #{} :expects #{}})

40 41 41 -

(def ^:dynamic *default-middleware* (atom [#'pretty/pretty-middleware]))

42 - 43 42

(defn ->var

44 43

[thing]

45 44

(if-not (symbol? thing)

@@ -65,7 +64,8 @@

65 64

init-ns (or init-ns 'boot.user)

66 65

init-ns-mw [(wrap-init-ns init-ns)]

67 66

user-mw (->mw-list middleware)

68 -

middleware (concat init-ns-mw *default-middleware* user-mw)

67 +

default-mw (->mw-list @repl/*default-middleware*)

68 +

middleware (concat init-ns-mw default-mw user-mw)

69 69

handler (if handler

70 70

(->var handler)

71 71

(apply server/default-handler middleware))

Original file line number Diff line number Diff line change

@@ -5,6 +5,7 @@

5 5

[clojure.string :as string]

6 6

[boot.pod :as pod]

7 7

[boot.file :as file]

8 +

[boot.repl :as repl]

8 9

[boot.core :as core]

9 10

[boot.main :as main]

10 11

[boot.util :as util]

@@ -169,9 +170,10 @@

169 170

If no port is specified the server will choose a random one and the client

170 171

will read the .nrepl-port file and use that.

171 172 172 -

The #'boot.repl-server/*default-middleware* dynamic var holds a vector of the

173 -

default REPL middleware to be included. You may modify this in your build.boot

174 -

file by calling set! or rebinding the var."

173 +

The *default-middleware* and *default-dependencies* atoms in the boot.repl-server

174 +

namespace contain vectors of default REPL middleware and REPL dependencies to

175 +

be loaded when starting the server. You may modify these in your build.boot

176 +

file."

175 177 176 178

[s server bool "Start REPL server only."

177 179

c client bool "Start REPL client only."

@@ -184,7 +186,7 @@

184 186

p port PORT int "The port to listen on and/or connect to."

185 187

n init-ns NS sym "The initial REPL namespace."

186 188

m middleware SYM [sym] "The REPL middleware vector."

187 -

x handler SYM sym "The REPL handler, when used middleware option is ignored"]

189 +

x handler SYM sym "The REPL handler (overrides middleware options)."]

188 190 189 191

(let [srv-opts (select-keys *opts* [:bind :port :init-ns :middleware :handler])

190 192

cli-opts (-> *opts*

@@ -194,11 +196,10 @@

194 196

:custom-eval eval

195 197

:custom-init init

196 198

:skip-default-init skip-init))

197 -

repl-svr (delay (try (require 'clojure.tools.nrepl.server)

198 -

(catch Throwable _

199 -

(pod/add-dependencies

200 -

(update-in (core/get-env) [:dependencies]

201 -

conj '[org.clojure/tools.nrepl "0.2.4"]))))

199 +

deps (remove pod/dependency-loaded? @repl/*default-dependencies*)

200 +

repl-svr (delay (when (seq deps)

201 +

(pod/add-dependencies

202 +

(assoc (core/get-env) :dependencies deps)))

202 203

(require 'boot.repl-server)

203 204

((resolve 'boot.repl-server/start-server) srv-opts))

204 205

repl-cli (delay (pod/call-worker `(boot.repl-client/client ~cli-opts)))]

Original file line number Diff line number Diff line change

@@ -103,17 +103,36 @@

103 103

first

104 104

(.getInputStream jarfile))))))

105 105 106 -

(defn pom-properties-map

107 -

[prop-or-jarpath]

108 -

(let [prop (if (instance? Properties prop-or-jarpath)

109 -

prop-or-jarpath

110 -

(doto (Properties.) (.load (io/input-stream prop-or-jarpath))))

111 -

gid (.getProperty prop "groupId")

112 -

aid (.getProperty prop "artifactId")]

106 +

(defn- pom-prop-map

107 +

[props]

108 +

(let [gid (.getProperty props "groupId")

109 +

aid (.getProperty props "artifactId")

110 +

ver (.getProperty props "version")]

113 111

{:group-id gid

114 112

:artifact-id aid

115 113

:project (symbol gid aid)

116 -

:version (.getProperty prop "version")}))

114 +

:version ver}))

115 + 116 +

(defn dependency-loaded?

117 +

[[project & _]]

118 +

(let [[aid gid] (util/extract-ids project)]

119 +

(io/resource (format "META-INF/maven/%s/%s/pom.properties" aid gid))))

120 + 121 +

(defn dependency-pom-properties

122 +

[coord]

123 +

(doto (Properties.)

124 +

(.load (io/input-stream (dependency-loaded? coord)))))

125 + 126 +

(defn dependency-pom-properties-map

127 +

[coord]

128 +

(pom-prop-map (dependency-pom-properties coord)))

129 + 130 +

(defn pom-properties-map

131 +

[prop-or-jarpath]

132 +

(pom-prop-map

133 +

(if (instance? Properties prop-or-jarpath)

134 +

prop-or-jarpath

135 +

(doto (Properties.) (.load (io/input-stream prop-or-jarpath))))))

117 136 118 137

(defn pom-xml

119 138

[jarpath]

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4