about summary refs log tree commit diff
path: root/boilerplate
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-05-04T11·32+0100
committerWilliam Carroll <wpcarro@gmail.com>2020-05-04T11·32+0100
commit066b1441b29df2d9616eabc8680e912e912cbb07 (patch)
tree906f1a4415a7eff50d26fce39f5c36e309de7c6a /boilerplate
parent7a7c29d46ce1503a57f7a81512d11960ca0f72c8 (diff)
Support //boilerplate/clojure
While this is most likely incomplete or even erroneous, I'd like to start
supporting Clojure in this repository.
Diffstat (limited to 'boilerplate')
-rw-r--r--boilerplate/clojure/.gitignore4
-rw-r--r--boilerplate/clojure/README.md33
-rw-r--r--boilerplate/clojure/dir-locals.nix3
-rw-r--r--boilerplate/clojure/project.clj2
-rw-r--r--boilerplate/clojure/shell.nix7
-rw-r--r--boilerplate/clojure/src/main.clj8
6 files changed, 57 insertions, 0 deletions
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 <briefcase> {};
+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 <nixpkgs> {};
+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))