diff --git a/boilerplate/clojure/.gitignore b/boilerplate/clojure/.gitignore new file mode 100644 index 000000000..f24c5e393 --- /dev/null +++ b/boilerplate/clojure/.gitignore @@ -0,0 +1,4 @@ +/.lein-repl-history +/target +/? +/.nrepl-port \ No newline at end of file diff --git a/boilerplate/clojure/README.md b/boilerplate/clojure/README.md new file mode 100644 index 000000000..93ce4c94d --- /dev/null +++ b/boilerplate/clojure/README.md @@ -0,0 +1,33 @@ +# Clojure Boilerplate + +This boilerplate uses `lein` to manage the project. + +## Files to change + +To use this boilerplate, run the following in a shell: + +```shell +$ cp ~/briefcase/boilerplate/clojure path/to/new-project +``` + +After running the above command, change the following files to remove the +placeholder values: + +- `README.md`: Change the title; change the description; drop "Files to change"; + keep "Getting started" +- `project.clj`: Change title +- `src/project.clj`: Change `:doc`; drop `main/foo` + +## Getting started + +From a shell, run: + +```shell +$ lein repl +``` + +From Emacs, navigate to a source code buffer and run: + +``` +M-x cider-jack-in +``` diff --git a/boilerplate/clojure/dir-locals.nix b/boilerplate/clojure/dir-locals.nix new file mode 100644 index 000000000..498f4b505 --- /dev/null +++ b/boilerplate/clojure/dir-locals.nix @@ -0,0 +1,3 @@ +let + briefcase = import {}; +in briefcase.utils.nixBufferFromShell ./shell.nix diff --git a/boilerplate/clojure/project.clj b/boilerplate/clojure/project.clj new file mode 100644 index 000000000..54e34eab7 --- /dev/null +++ b/boilerplate/clojure/project.clj @@ -0,0 +1,2 @@ +(defproject boilerplate "0.0.1" + :dependencies [[org.clojure/clojure "1.8.0"]]) diff --git a/boilerplate/clojure/shell.nix b/boilerplate/clojure/shell.nix new file mode 100644 index 000000000..0ea68aba4 --- /dev/null +++ b/boilerplate/clojure/shell.nix @@ -0,0 +1,7 @@ +let + pkgs = import {}; +in pkgs.mkShell { + buildInputs = with pkgs; [ + leiningen + ]; +} diff --git a/boilerplate/clojure/src/main.clj b/boilerplate/clojure/src/main.clj new file mode 100644 index 000000000..f6b60dba4 --- /dev/null +++ b/boilerplate/clojure/src/main.clj @@ -0,0 +1,8 @@ +(ns ^{:doc "Top-level module." + :author "William Carroll"} + main) + +(declare main) + +(defn foo [a b] + (+ a b))