Skip to content

Instantly share code, notes, and snippets.

@semperos
Last active September 5, 2019 19:32
Show Gist options
  • Save semperos/8810aca9c846f3308c2d830915e89267 to your computer and use it in GitHub Desktop.
Save semperos/8810aca9c846f3308c2d830915e89267 to your computer and use it in GitHub Desktop.
Clojure deps.edn Workflow
{:aliases {:dev {:extra-deps
{org.clojure/tools.nrepl {:mvn/version "0.2.13"}
cider/cider-nrepl {:mvn/version "0.17.0-SNAPSHOT"}}}
:std {:extra-paths ["resources"]}
:test {:extra-paths ["test"]}}
:mvn/repos {"private-repo" {:url "https://example.com/repository/maven-releases/"}}}
#!/bin/bash
cd "$(dirname $0)/.."
REPL_PORT=8999 clj -C:std -R:std:dev -i $HOME/opt/user.clj -r
#!/bin/bash
cd "$(dirname $0)/.."
MAIN_NS="my.main.ns"
echo "Running $MAIN_NS..."
echo ""
clj -C:std -m $MAIN_NS $*
#!/bin/bash
cd "$(dirname $0)/.."
echo "Running test suite..."
TEST_NS="'my.main.ns-test"
clj -C:std:test -R:std -e "(do (require 'clojure.test $TEST_NS) (clojure.test/run-tests $TEST_NS))"
(ns user
(:require [clojure.tools.nrepl.server :refer [start-server stop-server]]
[cider.nrepl :refer (cider-nrepl-handler)]))
(defonce nrepl-server (start-server :port (Integer/parseInt (or (get (System/getenv) "REPL_PORT") "7888")) :handler cider-nrepl-handler))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment