|
147 | 147 | (setq-local cider-injected-middleware-version "0.49.0")
|
148 | 148 | (setq-local cider-jack-in-nrepl-middlewares '("cider.nrepl/cider-middleware"))
|
149 | 149 | (setq-local cider-jack-in-dependencies-exclusions '())
|
150 |
| - (setq-local cider-enrich-classpath t)) |
| 150 | + (setq-local cider-enrich-classpath t) |
| 151 | + (setq-local cider-enable-nrepl-jvmti-agent t)) |
151 | 152 |
|
152 | 153 | (it "can inject dependencies in a lein project"
|
153 | 154 | (expect (cider-inject-jack-in-dependencies "" "repl :headless" 'lein)
|
|
157 | 158 | (shell-quote-argument "[cider/cider-nrepl \"0.49.0\"]")
|
158 | 159 | " -- update-in :plugins conj "
|
159 | 160 | (shell-quote-argument "[mx.cider/lein-enrich-classpath \"1.19.3\"]")
|
| 161 | + " -- update-in :jvm-opts conj -Djdk.attach.allowAttachSelf" |
160 | 162 | " -- update-in :middleware conj cider.enrich-classpath.plugin-v2/middleware"
|
161 | 163 | " -- repl :headless")))
|
162 | 164 |
|
|
170 | 172 | (shell-quote-argument "[cider/cider-nrepl \"0.49.0\"]")
|
171 | 173 | " -- update-in :plugins conj "
|
172 | 174 | (shell-quote-argument "[mx.cider/lein-enrich-classpath \"1.19.3\"]")
|
| 175 | + " -- update-in :jvm-opts conj -Djdk.attach.allowAttachSelf" |
173 | 176 | " -- update-in :middleware conj cider.enrich-classpath.plugin-v2/middleware"
|
174 | 177 | " -- repl :headless")))
|
175 | 178 |
|
|
182 | 185 | (shell-quote-argument "[cider/cider-nrepl \"0.49.0\"]")
|
183 | 186 | " -- update-in :plugins conj "
|
184 | 187 | (shell-quote-argument "[mx.cider/lein-enrich-classpath \"1.19.3\"]")
|
| 188 | + " -- update-in :jvm-opts conj -Djdk.attach.allowAttachSelf" |
185 | 189 | " -- update-in :middleware conj cider.enrich-classpath.plugin-v2/middleware"
|
186 | 190 | " -- repl :headless")))
|
187 | 191 |
|
|
201 | 205 | (it "can inject dependencies in a gradle project"
|
202 | 206 | (expect (cider-inject-jack-in-dependencies "--no-daemon" ":clojureRepl" 'gradle)
|
203 | 207 | :to-equal (concat "--no-daemon "
|
| 208 | + "-Pjdk.attach.allowAttachSelf " |
204 | 209 | (shell-quote-argument "-Pdev.clojurephant.jack-in.nrepl=nrepl:nrepl:0.9.0,cider:cider-nrepl:0.49.0")
|
205 | 210 | " :clojureRepl "
|
206 | 211 | (shell-quote-argument "--middleware=cider.nrepl/cider-middleware")))))
|
|
221 | 226 | (shell-quote-argument "[cider/cider-nrepl \"0.49.0\"]")
|
222 | 227 | " -- update-in :plugins conj "
|
223 | 228 | (shell-quote-argument "[mx.cider/lein-enrich-classpath \"1.19.3\"]")
|
| 229 | + " -- update-in :jvm-opts conj -Djdk.attach.allowAttachSelf" |
224 | 230 | " -- update-in :middleware conj cider.enrich-classpath.plugin-v2/middleware"
|
225 | 231 | " -- repl :headless")))
|
226 | 232 |
|
|
256 | 262 | (shell-quote-argument "[cider/cider-nrepl \"0.49.0\"]")
|
257 | 263 | " -- update-in :plugins conj "
|
258 | 264 | (shell-quote-argument "[mx.cider/lein-enrich-classpath \"1.19.3\"]")
|
| 265 | + " -- update-in :jvm-opts conj -Djdk.attach.allowAttachSelf" |
259 | 266 | " -- update-in :middleware conj cider.enrich-classpath.plugin-v2/middleware"
|
260 | 267 | " -- repl :headless")))
|
261 | 268 | (it "can concat in a boot project"
|
|
272 | 279 | (it "can concat in a gradle project"
|
273 | 280 | (expect (cider-inject-jack-in-dependencies "--no-daemon" ":clojureRepl" 'gradle)
|
274 | 281 | :to-equal (concat "--no-daemon "
|
| 282 | + "-Pjdk.attach.allowAttachSelf " |
275 | 283 | (shell-quote-argument "-Pdev.clojurephant.jack-in.nrepl=nrepl:nrepl:0.9.0,cider:cider-nrepl:0.49.0")
|
276 | 284 | " :clojureRepl "
|
277 | 285 | (shell-quote-argument "--middleware=cider.nrepl/cider-middleware")))))
|
|
337 | 345 | (shell-quote-argument "[cider/cider-nrepl \"0.49.0\"]")
|
338 | 346 | " -- update-in :plugins conj "
|
339 | 347 | (shell-quote-argument "[mx.cider/lein-enrich-classpath \"1.19.3\"]")
|
| 348 | + " -- update-in :jvm-opts conj -Djdk.attach.allowAttachSelf" |
340 | 349 | " -- update-in :middleware conj cider.enrich-classpath.plugin-v2/middleware"
|
341 | 350 | " -- repl :headless"))))
|
342 | 351 |
|
|
446 | 455 | (it "uses main opts in an alias to prevent other mains from winning"
|
447 | 456 | (setq-local cider-jack-in-dependencies nil)
|
448 | 457 | (setq-local cider-jack-in-nrepl-middlewares '("cider.nrepl/cider-middleware"))
|
449 |
| - (let ((expected (string-join `("clojure -Sdeps " |
| 458 | + (let ((expected (string-join `("clojure -J-Djdk.attach.allowAttachSelf -Sdeps " |
450 | 459 | ,(shell-quote-argument "{:deps {nrepl/nrepl {:mvn/version \"0.9.0\"} cider/cider-nrepl {:mvn/version \"0.49.0\"}} :aliases {:cider/nrepl {:main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[cider.nrepl/cider-middleware]\"]}}}")
|
451 | 460 | " -M:cider/nrepl")
|
452 | 461 | "")))
|
453 | 462 | (setq-local cider-allow-jack-in-without-project t)
|
454 | 463 | (setq-local cider-clojure-cli-command "clojure")
|
455 | 464 | (setq-local cider-inject-dependencies-at-jack-in t)
|
456 | 465 | (setq-local cider-clojure-cli-aliases nil)
|
| 466 | + (setq-local cider-enable-nrepl-jvmti-agent t) |
457 | 467 | (spy-on 'cider-project-type :and-return-value 'clojure-cli)
|
458 | 468 | (spy-on 'cider-jack-in-resolve-command :and-return-value "clojure")
|
459 | 469 | (expect (plist-get (cider--update-jack-in-cmd nil) :jack-in-cmd)
|
460 | 470 | :to-equal expected)))
|
461 | 471 |
|
462 | 472 | (it "allows specifying custom aliases with `cider-clojure-cli-aliases`"
|
463 |
| - (let ((expected (string-join `("clojure -Sdeps " |
| 473 | + (let ((expected (string-join `("clojure -J-Djdk.attach.allowAttachSelf -Sdeps " |
464 | 474 | ,(shell-quote-argument "{:deps {nrepl/nrepl {:mvn/version \"0.9.0\"} cider/cider-nrepl {:mvn/version \"0.49.0\"}} :aliases {:cider/nrepl {:main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[cider.nrepl/cider-middleware]\"]}}}")
|
465 | 475 | " -M:dev:test:cider/nrepl")
|
466 | 476 | "")))
|
|
469 | 479 | (setq-local cider-allow-jack-in-without-project t)
|
470 | 480 | (setq-local cider-clojure-cli-command "clojure")
|
471 | 481 | (setq-local cider-inject-dependencies-at-jack-in t)
|
| 482 | + (setq-local cider-enable-nrepl-jvmti-agent t) |
472 | 483 | (spy-on 'cider-project-type :and-return-value 'clojure-cli)
|
473 | 484 | (spy-on 'cider-jack-in-resolve-command :and-return-value "clojure")
|
474 | 485 | (expect (plist-get (cider--update-jack-in-cmd nil) :jack-in-cmd)
|
|
477 | 488 | (dolist (command '("clojure" "powershell"))
|
478 | 489 | (it (format "should remove duplicates, yielding the same result (for %S command invocation)" command)
|
479 | 490 | ;; repeat the same test for PowerShell too
|
480 |
| - (let ((expected (string-join `("-Sdeps " |
| 491 | + (let ((expected (string-join `("-J-Djdk.attach.allowAttachSelf " |
| 492 | + "-Sdeps " |
481 | 493 | ,(cider--shell-quote-argument "{:deps {cider/cider-nrepl {:mvn/version \"0.49.0\"} nrepl/nrepl {:mvn/version \"0.9.0\"}} :aliases {:cider/nrepl {:main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[cider.nrepl/cider-middleware]\"]}}}"
|
482 | 494 | command)
|
483 | 495 | " -M:dev:test:cider/nrepl")
|
|
487 | 499 | command)
|
488 | 500 | :to-equal expected))))
|
489 | 501 | (it "handles aliases correctly"
|
490 |
| - (let ((expected (string-join `("-Sdeps " |
| 502 | + (let ((expected (string-join `("-J-Djdk.attach.allowAttachSelf " |
| 503 | + "-Sdeps " |
491 | 504 | ,(shell-quote-argument "{:deps {cider/cider-nrepl {:mvn/version \"0.49.0\"} nrepl/nrepl {:mvn/version \"0.9.0\"}} :aliases {:cider/nrepl {:main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[cider.nrepl/cider-middleware]\"]}}}")
|
492 | 505 | " -M:test:cider/nrepl")
|
493 | 506 | ""))
|
|
515 | 528 | (expect (cider-clojure-cli-jack-in-dependencies nil nil deps)
|
516 | 529 | :to-equal expected)))))
|
517 | 530 | (it "allows for global options"
|
518 |
| - (let ((expected (string-join `("-J-Djdk.attach.allowAttachSelf -Sdeps " |
| 531 | + (let ((expected (string-join `("-J-Xverify:none -J-Djdk.attach.allowAttachSelf -Sdeps " |
519 | 532 | ,(shell-quote-argument "{:deps {cider/cider-nrepl {:mvn/version \"0.49.0\"} nrepl/nrepl {:mvn/version \"0.9.0\"}} :aliases {:cider/nrepl {:main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[cider.nrepl/cider-middleware]\"]}}}")
|
520 | 533 | " -M:test:cider/nrepl")
|
521 | 534 | ""))
|
522 | 535 | (deps '(("nrepl/nrepl" "0.9.0"))))
|
523 | 536 | (let ((cider-clojure-cli-aliases ":test"))
|
524 |
| - (expect (cider-clojure-cli-jack-in-dependencies "-J-Djdk.attach.allowAttachSelf" nil deps) |
| 537 | + (expect (cider-clojure-cli-jack-in-dependencies "-J-Xverify:none" nil deps) |
525 | 538 | :to-equal expected))))
|
526 | 539 | (it "allows to specify git coordinate as cider-jack-in-dependency"
|
527 | 540 | (setq-local cider-jack-in-dependencies '(("org.clojure/tools.deps" (("git/sha" . "6ae2b6f71773de7549d7f22759e8b09fec27f0d9")
|
528 | 541 | ("git/url" . "https://github.com/clojure/tools.deps/")))))
|
529 |
| - (let ((expected (string-join `("clojure -Sdeps " |
| 542 | + (let ((expected (string-join `("clojure -J-Djdk.attach.allowAttachSelf -Sdeps " |
530 | 543 | ,(shell-quote-argument "{:deps {nrepl/nrepl {:mvn/version \"0.9.0\"} cider/cider-nrepl {:mvn/version \"0.49.0\"} org.clojure/tools.deps { :git/sha \"6ae2b6f71773de7549d7f22759e8b09fec27f0d9\" :git/url \"https://github.com/clojure/tools.deps/\" }} :aliases {:cider/nrepl {:main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[cider.nrepl/cider-middleware]\"]}}}")
|
531 | 544 | " -M:cider/nrepl")
|
532 | 545 | "")))
|
533 | 546 | (setq-local cider-allow-jack-in-without-project t)
|
534 | 547 | (setq-local cider-clojure-cli-command "clojure")
|
535 | 548 | (setq-local cider-inject-dependencies-at-jack-in t)
|
536 | 549 | (setq-local cider-clojure-cli-aliases nil)
|
| 550 | + (setq-local cider-enable-nrepl-jvmti-agent t) |
537 | 551 | (spy-on 'cider-project-type :and-return-value 'clojure-cli)
|
538 | 552 | (spy-on 'cider-jack-in-resolve-command :and-return-value "clojure")
|
539 | 553 | (expect (plist-get (cider--update-jack-in-cmd nil) :jack-in-cmd)
|
|
0 commit comments