Skip to content

Commit

Permalink
Rewrite build to Boot
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-yakushev committed Feb 15, 2018
1 parent a9a7fb0 commit 4960b40
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 8 deletions.
5 changes: 5 additions & 0 deletions boot.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#http://boot-clj.com
#Thu Feb 15 12:38:47 EET 2018
BOOT_CLOJURE_NAME=org.clojure/clojure
BOOT_CLOJURE_VERSION=1.9.0
BOOT_VERSION=2.7.2
44 changes: 44 additions & 0 deletions build.boot
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
(task-options!
pom {:project 'com.grammarly/omniconf
:version "0.3.0-SNAPSHOT"
:description "Configuration library for Clojure that favors explicitness"
:license {"Apache License, Version 2.0"
"http://www.apache.org/licenses/LICENSE-2.0"}
:url "https://github.com/grammarly/omniconf"
:scm {:url "https://github.com/grammarly/omniconf"}})

(def clj-version (or (System/getenv "BOOT_CLOJURE_VERSION") "1.9.0"))

(set-env!
:dependencies `[[org.clojure/clojure ~clj-version :scope "provided"]
[boot/core "2.7.2" :scope "provided"]
[metosin/bat-test "0.4.0" :scope "test"]]
:source-paths #{"src/"}
:test-paths #{"test/"}
:target-path "target/")

(require 'boot.util)

(ns-unmap 'boot.user 'test)
(deftask test
"Run unit tests."
[j junit bool "Produce JUnit XML."]
(set-env! :source-paths #(into % (get-env :test-paths)))
(require 'metosin.bat-test)
(let [reporters (if junit
[:pretty {:type :junit :output-to "target/junit.xml"}]
[:pretty])]
((resolve 'metosin.bat-test/bat-test) :report reporters)))

(deftask build
"Build the JAR file."
[]
(set-env! :resource-paths (get-env :source-paths)
;; Remove unnecessary deps
:dependencies
(fn [deps]
(remove #(let [{:keys [project scope]} (boot.util/dep-as-map %)]
(or (= project 'boot/core)
(= scope "test")))
deps)))
(comp (pom) (jar)))
30 changes: 24 additions & 6 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
test:
override:
- lein test2junit
- lein with-profile 1.7 test
- lein with-profile 1.8 test
- lein cloverage && cp -r target/coverage $CIRCLE_ARTIFACTS
version: 2
jobs:
build:
working_directory: ~/project
docker:
- image: clojure:boot-2.7.2-alpine
steps:
- checkout
- restore_cache:
key: project-{{ checksum "boot.properties" }}-{{ checksum "build.boot" }}
- run: boot test --junit
- store_test_results:
path: target/
- store_artifacts:
path: target/
- save_cache:
paths:
- ~/.m2
- ~/.boot/cache/lib
- ~/.boot/cache/bin
key: project-{{ checksum "boot.properties" }}-{{ checksum "build.boot" }}
environment:
BOOT_JVM_OPTIONS: "-Xms512m -Xmx1024m"
BOOT_WATCHERS_DISABLE: "yes"
4 changes: 2 additions & 2 deletions test/omniconf/core_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
:integer-option {:type :number
:description "parsed as integer"}
:edn-option {:type :edn
:description "read as EDN structure"
:default '(1 2)}
:description "read as EDN structure"
:default '(1 2)}
:file-option {:type :file
:description "read as filename"}
:directory-option {:type :directory
Expand Down

0 comments on commit 4960b40

Please sign in to comment.