Last active
May 3, 2017 11:48
-
-
Save pjullah/745e6e957c2d31f4f4765034429f6fa0 to your computer and use it in GitHub Desktop.
Notes on Clojure development environment configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; https://stuartsierra.com/2016/clojure-how-to-ns.html | |
;; ns cheatsheet https://gist.github.com/ghoseb/287710/ | |
;; Work with library in REPL - example Cheshire | |
(boot.core/set-env! :dependencies #(conj % '[cheshire "5.5.0"])) | |
(require '[cheshire.core]) | |
;; add dependency | |
(set-env! :dependencies #(conj % '[foo/bar "1.2.3"])) | |
;;start repl in project namespace | |
(task-options! | |
repl {:init-ns 'cli.core | |
:eval '(print "Welcome \n")} | |
;; Make changes to files available to repl without restart | |
(require '[clojure.tools.namespace.repl :refer [refresh]]) | |
(apply clojure.tools.namespace.repl/set-refresh-dirs (boot.core/get-env :directories)) | |
boot.core => (clojure.tools.namespace.repl/refresh) | |
; for some reason, required to provide namespace despite previous require | |
;; Changes to files available to repl automatically | |
(deftask dev | |
"" | |
[] | |
(comp | |
(repl :port repl-port ) | |
(watch) | |
(speak) | |
(refresh))) | |
; then start a seperate REPL client | |
boot repl -c --port 5600 | |
;; Add dependency without a REPL restart | |
boot.core => (set-env! :dependencies '[[group-id/artifact-id version-string]]) | |
boot.core => (require '[dep :refer :all]) | |
;; TODO Execute tests from within REPL | |
;; TODO Execute all tests when files change | |
;; TODO Only execute tests related to the changed files | |
(merge-env! :dependencies '[[foo/bar "1.0"] [baz "2.0"]]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment