fix :java-opts in test runner

This commit is contained in:
Sean Corfield 2021-08-02 20:41:43 -07:00
parent 53a9688639
commit 91a2854449
3 changed files with 11 additions and 8 deletions

1
.gitignore vendored
View file

@ -11,6 +11,7 @@
.settings .settings
.socket-repl-port .socket-repl-port
.sw* .sw*
.vscode
*.class *.class
*.jar *.jar
*.swp *.swp

View file

@ -1,5 +1,6 @@
(ns build (ns build
(:require [clojure.tools.build.api :as b])) (:require [clojure.tools.build.api :as b]
[clojure.tools.deps.alpha :as t]))
(def lib 'com.github.seancorfield/next.jdbc) (def lib 'com.github.seancorfield/next.jdbc)
(def version (format "1.2.%s" (b/git-count-revs nil))) (def version (format "1.2.%s" (b/git-count-revs nil)))
@ -8,11 +9,11 @@
(def jar-file (format "target/%s-%s.jar" (name lib) version)) (def jar-file (format "target/%s-%s.jar" (name lib) version))
(defn clean [_] (defn clean [_]
(println "Cleaning target...") (println "\nCleaning target...")
(b/delete {:path "target"})) (b/delete {:path "target"}))
(defn jar [_] (defn jar [_]
(println "Writing pom.xml...") (println "\nWriting pom.xml...")
(b/write-pom {:class-dir class-dir (b/write-pom {:class-dir class-dir
:lib lib :lib lib
:version version :version version
@ -27,10 +28,12 @@
(defn run-tests (defn run-tests
[_] [_]
(let [basis (b/create-basis {:aliases [:test]}) (let [basis (b/create-basis {:aliases [:test]})
cmds (b/java-command {:basis basis combined (t/combine-aliases basis [:test])
:main 'clojure.main cmds (b/java-command {:basis basis
:main-args ["-m" "cognitect.test-runner"]}) :java-opts (:jvm-opts combined)
:main 'clojure.main
:main-args ["-m" "cognitect.test-runner"]})
{:keys [exit]} (b/process cmds)] {:keys [exit]} (b/process cmds)]
(when-not (zero? exit) (when-not (zero? exit)
(throw (ex-info "Tests failed" {}))))) (throw (ex-info "Tests failed" {})))))

View file

@ -22,7 +22,6 @@
<url>https://github.com/seancorfield/next-jdbc</url> <url>https://github.com/seancorfield/next-jdbc</url>
<connection>scm:git:git://github.com/seancorfield/next-jdbc.git</connection> <connection>scm:git:git://github.com/seancorfield/next-jdbc.git</connection>
<developerConnection>scm:git:ssh://git@github.com/seancorfield/next-jdbc.git</developerConnection> <developerConnection>scm:git:ssh://git@github.com/seancorfield/next-jdbc.git</developerConnection>
<tag>v1.2.689</tag>
</scm> </scm>
<dependencies> <dependencies>
<dependency> <dependency>