aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTyler Wardhaugh <tyler.wardhaugh@gmail.com>2022-01-14 17:14:11 -0800
committerTyler Wardhaugh <tyler.wardhaugh@gmail.com>2022-01-14 17:14:11 -0800
commit25513b91fa5ea9a6801605ef1dd795550e521b8b (patch)
tree0f2dccacd7027a051065cb2df4f05649bdd8bf6e
parente9411bdc7658179af3f23d3ada7970323547a7d7 (diff)
downloadperlweeklychallenge-club-25513b91fa5ea9a6801605ef1dd795550e521b8b.tar.gz
perlweeklychallenge-club-25513b91fa5ea9a6801605ef1dd795550e521b8b.tar.bz2
perlweeklychallenge-club-25513b91fa5ea9a6801605ef1dd795550e521b8b.zip
Ch147 (Clojure): prep for challenge
-rw-r--r--challenge-147/tyler-wardhaugh/clojure/README.md24
-rw-r--r--challenge-147/tyler-wardhaugh/clojure/build.clj19
-rw-r--r--challenge-147/tyler-wardhaugh/clojure/deps.edn8
3 files changed, 29 insertions, 22 deletions
diff --git a/challenge-147/tyler-wardhaugh/clojure/README.md b/challenge-147/tyler-wardhaugh/clojure/README.md
index ea5ea9467a..d024ca4c86 100644
--- a/challenge-147/tyler-wardhaugh/clojure/README.md
+++ b/challenge-147/tyler-wardhaugh/clojure/README.md
@@ -1,34 +1,22 @@
-# c146
+# c147
-The Weekly Challenge — #146 — Tyler Wardhaugh
+The Weekly Challenge — #147 — Tyler Wardhaugh
## Usage
Clojure ([installation instructions](https://clojure.org/guides/getting_started#_clojure_installer_and_cli_tools)) required for `clojure` commands; Babashka ([installation instructions](https://github.com/babashka/babashka#quickstart)) required for the `bb` commands.
-Run Task #1 (implemented with a sieve):
+Run Task #1:
$ clojure -M:t1
# ... or ...
$ bb run task-1
- # Alternatively, to run it via Babashka:
- $ bb run task-1-bb
-
-Run Task #1b (implemented using JVM's BigInteger library):
-
- $ clojure -M:t1b
- # ... or ...
- $ bb run task-1b
-
- # Alternatively, to run it via Babashka:
- $ bb run task-1b-bb
-
-Run Task #2 with input:
+Run Task #2:
- $ clojure -M:t2 M
+ $ clojure -M:t2
# ... or ...
- $ bb run task-2 M
+ $ bb run task-2
# Alternatively, to run it via Babashka:
$ bb run task-2-bb
diff --git a/challenge-147/tyler-wardhaugh/clojure/build.clj b/challenge-147/tyler-wardhaugh/clojure/build.clj
new file mode 100644
index 0000000000..d38810e3b5
--- /dev/null
+++ b/challenge-147/tyler-wardhaugh/clojure/build.clj
@@ -0,0 +1,19 @@
+(ns build
+ (:refer-clojure :exclude [test])
+ (:require [org.corfield.build :as bb]))
+
+(def lib 'net.clojars.c147/c147)
+(def version "0.1.0-SNAPSHOT")
+(def main 'c147.c147)
+
+(defn test "Run the tests." [opts]
+ (bb/run-tests opts))
+
+(def clean bb/clean)
+
+(defn ci "Run the CI pipeline of tests (and build the uberjar)." [opts]
+ (-> opts
+ (assoc :lib lib :version version :main main)
+ (bb/run-tests)
+ (bb/clean)
+ (bb/uber)))
diff --git a/challenge-147/tyler-wardhaugh/clojure/deps.edn b/challenge-147/tyler-wardhaugh/clojure/deps.edn
index 247ad7b44d..ebc13b0949 100644
--- a/challenge-147/tyler-wardhaugh/clojure/deps.edn
+++ b/challenge-147/tyler-wardhaugh/clojure/deps.edn
@@ -1,9 +1,9 @@
{:paths ["src" "resources"]
- :deps {org.clojure/clojure {:mvn/version "1.10.3"}}
+ :deps {org.clojure/clojure {:mvn/version "1.11.0-alpha4"}
+ com.hypirion/primes {:mvn/version "0.2.2"}}
:aliases
- {:t1 {:main-opts ["-m" "c146.t1"]}
- :t1b {:main-opts ["-m" "c146.t1b"]}
- :t2 {:main-opts ["-m" "c146.t2"]}
+ {:t1 {:main-opts ["-m" "c147.t1"]}
+ :t2 {:main-opts ["-m" "c147.t2"]}
:build {:deps {io.github.seancorfield/build-clj
{:git/tag "v0.6.3" :git/sha "9b8e09b"
;; since we're building an app uberjar, we do not