Skip to content

Commit

Permalink
tidying for released
Browse files Browse the repository at this point in the history
  • Loading branch information
cgrand committed Jul 13, 2023
1 parent 3257561 commit 2079b74
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 21 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ pom.xml.asc
*.class
/lib/
/classes/
/bin/
/node_modules/
/.lumo_cache/
/target/
/checkouts/
.lein-deps-sum
Expand Down
31 changes: 31 additions & 0 deletions build.clj
Original file line number Diff line number Diff line change
@@ -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/"))
17 changes: 11 additions & 6 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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}}}
14 changes: 0 additions & 14 deletions project.clj

This file was deleted.

2 changes: 1 addition & 1 deletion src/net/cgrand/xforms/rfs.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 2079b74

Please sign in to comment.