tidying for released

This commit is contained in:
Christophe Grand 2023-07-13 11:20:02 +02:00
parent 3257561937
commit 2079b74271
5 changed files with 46 additions and 21 deletions

3
.gitignore vendored
View file

@ -8,6 +8,9 @@ pom.xml.asc
*.class *.class
/lib/ /lib/
/classes/ /classes/
/bin/
/node_modules/
/.lumo_cache/
/target/ /target/
/checkouts/ /checkouts/
.lein-deps-sum .lein-deps-sum

31
build.clj Normal file
View file

@ -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/"))

View file

@ -1,4 +1,4 @@
{:deps {net.cgrand/macrovich {:mvn/version "0.2.1"}} {:deps {net.cgrand/macrovich {:mvn/version "0.2.2"}}
:paths ["src"] :paths ["src"]
:aliases :aliases
@ -8,8 +8,7 @@
:cljd :cljd
{:extra-deps {:extra-deps
{tensegritics/clojuredart {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"}}} :sha "ae1b485e84ccc35b122f776dfc7cc62198274701"}}}
:clj-1-9 :clj-1-9
@ -31,9 +30,15 @@
{:extra-paths ["test"]} {:extra-paths ["test"]}
:kaocha :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"]} :main-opts ["-m" "kaocha.runner"]}
:cljs-test-runner :cljs-test-runner
{:extra-deps {olical/cljs-test-runner {:mvn/version "3.8.0"}} {:extra-paths ["test"]
:main-opts ["-m" "cljs-test-runner.main"]}}} :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}}}

View file

@ -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"]]}})

View file

@ -95,7 +95,7 @@
([#?(:cljd ^{:tag #/(List? double)} acc :clj ^doubles acc :cljs ^doubles acc)] ([#?(:cljd ^{:tag #/(List? double)} acc :clj ^doubles acc :cljs ^doubles acc)]
(when acc (/ (aget acc 1) (aget acc 0)))) (when acc (/ (aget acc 1) (aget acc 0))))
([acc x] (avg acc x 1)) ([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]))] (let [acc (or acc #?(:cljd (double-array 2) :clj (double-array 2) :cljs #js [0.0 0.0]))]
(doto acc (doto acc
(aset 0 (+ (aget acc 0) w)) (aset 0 (+ (aget acc 0) w))