diff --git a/.gitignore b/.gitignore index 2091ad0..f187998 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,9 @@ pom.xml.asc *.class /lib/ /classes/ +/bin/ +/node_modules/ +/.lumo_cache/ /target/ /checkouts/ .lein-deps-sum diff --git a/build.clj b/build.clj new file mode 100644 index 0000000..2b16597 --- /dev/null +++ b/build.clj @@ -0,0 +1,31 @@ +(ns build + (:require [clojure.tools.build.api :as b] + [clojure.java.shell :as sh])) + +(def lib 'net.cgrand/xforms) +(def version "0.19.5" #_(format "0.0.%s" (b/git-count-revs nil))) +(def class-dir "target/classes") +(def basis (b/create-basis {:project "deps.edn"})) +(def jar-file (format "target/%s-%s.jar" (name lib) version)) + +(defn clean [_] + (b/delete {:path "target"})) + +(defn jar [_] + (b/write-pom {:class-dir class-dir + :lib lib + :version version + :basis basis + :src-dirs ["src"]}) + (b/copy-dir {:src-dirs ["src" "resources"] + :target-dir class-dir}) + (b/jar {:class-dir class-dir + :jar-file jar-file})) + +(defn clojars [_] + (sh/sh + "mvn" "deploy:deploy-file" (str "-Dfile=" jar-file) +;target/classes/META-INF/maven/net.cgrand/xforms/pom.xml + (format "-DpomFile=%s/META-INF/maven/%s/%s/pom.xml" + class-dir (namespace lib) (name lib)) + "-DrepositoryId=clojars" "-Durl=https://clojars.org/repo/")) diff --git a/deps.edn b/deps.edn index 93ab2fc..3d6e67b 100644 --- a/deps.edn +++ b/deps.edn @@ -1,4 +1,4 @@ -{:deps {net.cgrand/macrovich {:mvn/version "0.2.1"}} +{:deps {net.cgrand/macrovich {:mvn/version "0.2.2"}} :paths ["src"] :aliases @@ -8,8 +8,7 @@ :cljd {:extra-deps {tensegritics/clojuredart - {:local/root "../../../cljd/open-source/ClojureDart"} - #_{:git/url "https://github.com/tensegritics/ClojureDart.git" + {:git/url "https://github.com/tensegritics/ClojureDart.git" :sha "ae1b485e84ccc35b122f776dfc7cc62198274701"}}} :clj-1-9 @@ -31,9 +30,15 @@ {:extra-paths ["test"]} :kaocha - {:extra-deps {lambdaisland/kaocha {:mvn/version "1.69.1069"}} + {:extra-paths ["test"] + :extra-deps {lambdaisland/kaocha {:mvn/version "1.69.1069"}} :main-opts ["-m" "kaocha.runner"]} :cljs-test-runner - {:extra-deps {olical/cljs-test-runner {:mvn/version "3.8.0"}} - :main-opts ["-m" "cljs-test-runner.main"]}}} + {:extra-paths ["test"] + :extra-deps {olical/cljs-test-runner {:mvn/version "3.8.0"}} + :main-opts ["-m" "cljs-test-runner.main"]} + + :build + {:deps {io.github.clojure/tools.build {:git/tag "v0.9.4" :git/sha "76b78fe"}} + :ns-default build}}} diff --git a/project.clj b/project.clj deleted file mode 100644 index 0c278ac..0000000 --- a/project.clj +++ /dev/null @@ -1,14 +0,0 @@ -(defproject net.cgrand/xforms "0.19.4" - :description "Extra transducers for Clojure" - :url "https://github.com/cgrand/xforms" - :license {:name "Eclipse Public License" - :url "http://www.eclipse.org/legal/epl-v10.html"} - - :plugins [[lein-tools-deps "0.4.5"]] - :middleware [lein-tools-deps.plugin/resolve-dependencies-with-deps-edn] - :lein-tools-deps/config {:config-files [:project]} - - :profiles - {:provided - {:dependencies [[org.clojure/clojure "1.8.0"] - [org.clojure/clojurescript "1.9.293"]]}}) diff --git a/src/net/cgrand/xforms/rfs.cljc b/src/net/cgrand/xforms/rfs.cljc index 9f80c51..8a389d0 100644 --- a/src/net/cgrand/xforms/rfs.cljc +++ b/src/net/cgrand/xforms/rfs.cljc @@ -95,7 +95,7 @@ ([#?(:cljd ^{:tag #/(List? double)} acc :clj ^doubles acc :cljs ^doubles acc)] (when acc (/ (aget acc 1) (aget acc 0)))) ([acc x] (avg acc x 1)) - ([#?(:cljd ^{:tag #/(List? double)} acc :clj ^doubles acc :cljs ^doubles acc) x w] + ([#?(:cljd ^{:tag #/(List? double)} acc :clj ^doubles acc :cljs ^doubles acc) x w] ; weighted mean (let [acc (or acc #?(:cljd (double-array 2) :clj (double-array 2) :cljs #js [0.0 0.0]))] (doto acc (aset 0 (+ (aget acc 0) w))