Skip to content

Commit

Permalink
Move to cljc and boot
Browse files Browse the repository at this point in the history
  • Loading branch information
frankiesardo committed Sep 11, 2015
1 parent ebf7791 commit 0854f18
Show file tree
Hide file tree
Showing 20 changed files with 611 additions and 863 deletions.
1 change: 0 additions & 1 deletion .lein-classpath

This file was deleted.

3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 1.2.4
- Move to boot and .cljc files

## 1.2.3
- Equivalence checks for instance of Map first

Expand Down
4 changes: 4 additions & 0 deletions boot.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#https://github.com/boot-clj/boot
#Thu Sep 10 15:11:07 BST 2015
BOOT_CLOJURE_VERSION=1.7.0
BOOT_VERSION=2.2.0
96 changes: 96 additions & 0 deletions build.boot
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
(set-env!
:source-paths #{"src"}
:resource-paths #{"resources"}
:dependencies '[[adzerk/boot-cljs "0.0-3308-0" :scope "test"]
[adzerk/boot-cljs-repl "0.1.9" :scope "test"]
[org.clojure/clojurescript "1.7.58" :scope "test"]
[crisptrutski/boot-cljs-test "0.1.0-SNAPSHOT" :scope "test"]])

(require
'[adzerk.boot-cljs :refer [cljs]]
'[adzerk.boot-cljs-repl :refer [cljs-repl start-repl]]
'[crisptrutski.boot-cljs-test :refer [test-cljs]])

(require '[clojure.java.shell :as shell]
'[clojure.string :as str])

(defn- current-tag []
(let [{:keys [exit out]} (shell/sh "git" "describe" "--tags")]
(when (zero? exit)
(str/trim out))))

(def +version+
(if-let [tag (current-tag)]
(cond-> (second (re-find #"v(.*)" tag))
(.contains tag "-") (str "-SNAPSHOT"))
"0.1.0-SNAPSHOT"))

(task-options!
pom {:project 'frankiesardo/linked
:version +version+
:description "Efficient ordered map and set."
:url "https://github.com/frankiesardo/linked"
:scm {:url "https://github.com/frankiesardo/linked"}
:license {"Eclipse Public License"
"http://www.eclipse.org/legal/epl-v10.html"}})

(deftask deploy []
(comp (pom) (jar) (install)
(push :gpg-sign (not (.endsWith +version+ "-SNAPSHOT")))))

(deftask testing []
(set-env! :source-paths #(conj % "test"))
identity)

(ns-unmap 'boot.user 'test)

(require '[boot.pod :as pod]
'[boot.core :as core])

(def pod-deps
'[[pjstadig/humane-test-output "0.6.0" :exclusions [org.clojure/clojure]]])

(defn init [fresh-pod]
(doto fresh-pod
(pod/with-eval-in
(require '[clojure.test :as t]
'[clojure.java.io :as io]
'[pjstadig.humane-test-output :refer [activate!]])
(activate!)
(defn test-ns* [ns]
(binding [t/*report-counters* (ref t/*initial-report-counters*)]
(let [ns-obj (the-ns ns)]
(t/do-report {:type :begin-test-ns :ns ns-obj})
(t/test-vars (vals (ns-publics ns)))
(t/do-report {:type :end-test-ns :ns ns-obj}))
@t/*report-counters*)))))

(deftask test-clj []
(let [worker-pods (pod/pod-pool (update-in (core/get-env) [:dependencies] into pod-deps) :init init)]
(core/cleanup (worker-pods :shutdown))
(core/with-pre-wrap fileset
(let [worker-pod (worker-pods :refresh)
namespaces (core/fileset-namespaces fileset)]
(if (seq namespaces)
(let [summary (pod/with-eval-in worker-pod
(doseq [ns '~namespaces] (require ns))
(let [ns-results (map test-ns* '~namespaces)]
(-> (reduce (partial merge-with +) ns-results)
(assoc :type :summary)
(doto t/do-report))))]
(when (> (apply + (map summary [:fail :error])) 0)
(throw (ex-info "Some tests failed or errored" summary))))
(println "No namespaces were tested."))
fileset))))

(deftask test []
(comp (testing)
(test-clj)
(test-cljs :js-env :phantom
:exit? true)))

(deftask autotest []
(comp (testing)
(watch)
(test-clj)
(test-cljs :js-env :phantom)))
19 changes: 0 additions & 19 deletions build/leiningen/circle.clj

This file was deleted.

20 changes: 0 additions & 20 deletions build/leiningen/rsync.clj

This file was deleted.

28 changes: 24 additions & 4 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
test:
machine:
java:
version:
oraclejdk8
pre:
- git clone $DOTFILES ~/dotfiles && . ~/dotfiles/init.sh
post:
- lein circle
- wget -O bin/boot https://github.com/boot-clj/boot/releases/download/2.2.0/boot.sh
- chmod 755 bin/boot
- boot -V
environment:
BOOT_JVM_OPTIONS: "-Xmx3g"
test:
override:
- boot test
deployment:
release:
tag: /v.*/
commands:
- git clone $DOTFILES ~/dotfiles && . ~/dotfiles/init.sh
- boot deploy
snapshot:
branch: master
commands:
- git clone $DOTFILES ~/dotfiles && . ~/dotfiles/init.sh
- boot deploy

Loading

0 comments on commit 0854f18

Please sign in to comment.