From 066b1441b29df2d9616eabc8680e912e912cbb07 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Mon, 4 May 2020 12:32:50 +0100 Subject: Support //boilerplate/clojure While this is most likely incomplete or even erroneous, I'd like to start supporting Clojure in this repository. --- boilerplate/clojure/.gitignore | 4 ++++ boilerplate/clojure/README.md | 33 +++++++++++++++++++++++++++++++++ boilerplate/clojure/dir-locals.nix | 3 +++ boilerplate/clojure/project.clj | 2 ++ boilerplate/clojure/shell.nix | 7 +++++++ boilerplate/clojure/src/main.clj | 8 ++++++++ 6 files changed, 57 insertions(+) create mode 100644 boilerplate/clojure/.gitignore create mode 100644 boilerplate/clojure/README.md create mode 100644 boilerplate/clojure/dir-locals.nix create mode 100644 boilerplate/clojure/project.clj create mode 100644 boilerplate/clojure/shell.nix create mode 100644 boilerplate/clojure/src/main.clj diff --git a/boilerplate/clojure/.gitignore b/boilerplate/clojure/.gitignore new file mode 100644 index 000000000000..f24c5e393a28 --- /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 000000000000..93ce4c94d042 --- /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 000000000000..498f4b5055f8 --- /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 000000000000..54e34eab7a5d --- /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 000000000000..0ea68aba4608 --- /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 000000000000..f6b60dba404e --- /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)) -- cgit 1.4.1