Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies and add Nix flake #75

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,20 @@ update the `deps.edn` from the project root is:

`clj -A:depify | clj -A:zprint > deps.edn.tmp ; mv deps.edn.tmp deps.edn`

# Development environment using nix

For a reproducible development environment, `geo` provides a `flake.nix`.

On a machine with nix installed:

``` bash
$ nix develop
...

$ clj -T:build ci
$ clj -T:build install
```

# License

This project and many of its dependencies are licensed under the Eclipse Public
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
"Geo build script.

clojure -T:build ci

clojure -T:build install

clojure -T:build deploy"

(:require [clojure.tools.build.api :as b]
[org.corfield.build :as bb]))

(def lib 'Factual/geo)
(def version "3.0.1")

(defn ci "Run the CI pipeline of tests (and build the JAR)." [opts]
(-> opts
(assoc :lib lib :version version)
;(bb/run-tests) ;; Pending move to clojure.test and cljs
(bb/clean)
(bb/jar)))

(defn install "Install the JAR locally." [opts]
(-> opts
(assoc :lib lib :version version)
(bb/install)))

(defn deploy "Deploy the JAR to Clojars." [opts]
(-> opts
(assoc :lib lib :version version)
(bb/install)))
31 changes: 18 additions & 13 deletions deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,26 @@
{:1.7 {:extra-deps #:org.clojure{clojure #:mvn{:version "1.7.0"}}},
:1.8 {:extra-deps #:org.clojure{clojure #:mvn{:version "1.8.0"}}},
:1.9 {:extra-deps #:org.clojure{clojure #:mvn{:version "1.9.0"}}},
:dev {:extra-deps {cheshire #:mvn{:version "5.9.0"},
codox-theme-rdash #:mvn{:version "0.1.2"},
:dev {:extra-deps {cheshire/cheshire #:mvn{:version "5.10.1"},
codox-theme-rdash/codox-theme-rdash #:mvn{:version "0.1.2"},
com.fasterxml.jackson.core/jackson-core #:mvn{:version "2.10.2"},
com.fasterxml.jackson.dataformat/jackson-dataformat-cbor #:mvn{:version "2.10.2"},
com.fasterxml.jackson.dataformat/jackson-dataformat-smile #:mvn{:version "2.10.2"},
criterium #:mvn{:version "0.4.5"},
midje #:mvn{:version "1.9.9"},
org.clojure/clojure #:mvn{:version "1.10.1"}}}},
criterium/criterium #:mvn{:version "0.4.6"},
midje/midje #:mvn{:version "1.10.5"},
org.clojure/clojure #:mvn{:version "1.10.3"}}
:main-opts ["-m"]},
:build {:deps {io.github.seancorfield/build-clj
{:git/tag "v0.6.7" :git/sha "22c2d09"}}
:ns-default build}}},
:deps {ch.hsr/geohash #:mvn{:version "1.4.0"},
com.uber/h3 #:mvn{:version "3.6.3"},
org.clojure/math.numeric-tower #:mvn{:version "0.0.4"},
org.locationtech.jts.io/jts-io-common #:mvn{:version "1.16.1"},
org.locationtech.jts/jts-core #:mvn{:version "1.16.1"},
org.locationtech.proj4j/proj4j #:mvn{:version "1.1.0"},
org.locationtech.spatial4j/spatial4j #:mvn{:version "0.7"},
org.wololo/jts2geojson #:mvn{:version "0.14.3"}},
com.uber/h3 #:mvn{:version "4.1.1"},
org.clojure/math.numeric-tower #:mvn{:version "0.1.0"},
org.locationtech.jts.io/jts-io-common #:mvn{:version "1.19.0"},
org.locationtech.jts/jts-core #:mvn{:version "1.19.0"},
org.locationtech.proj4j/proj4j #:mvn{:version "1.3.0"},
org.locationtech.proj4j/proj4j-epsg #:mvn{:version "1.3.0"},
org.locationtech.spatial4j/spatial4j #:mvn{:version "0.8"},
org.wololo/jts2geojson #:mvn{:version "0.18.1"}},
:mvn/repos {"releases" {:url "https://clojars.org/repo"},
"snapshots" {:url "https://clojars.org/repo"}}}
"snapshots" {:url "https://clojars.org/repo"}}
43 changes: 43 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
description = "Flake to manage clojure workspace";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/master";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};

in {
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
clojure
jdk
leiningen
];
shellHook = ''
export JAVA_HOME=${pkgs.jdk}
PATH="${pkgs.jdk}/bin:$PATH"
'';
};
});
}
23 changes: 12 additions & 11 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,25 @@
:comments "same as Clojure"}
:description "Geospatial operations over points, lines, polys, geohashes, etc."
:dependencies
[[org.clojure/math.numeric-tower "0.0.4"]
[[org.clojure/math.numeric-tower "0.1.0"]
[ch.hsr/geohash "1.4.0"]
[com.uber/h3 "3.6.3"]
[org.locationtech.proj4j/proj4j "1.1.0"]
[org.locationtech.spatial4j/spatial4j "0.7"]
[org.locationtech.jts/jts-core "1.16.1"]
[org.locationtech.jts.io/jts-io-common "1.16.1"]
[org.wololo/jts2geojson "0.14.3"]]
[com.uber/h3 "4.1.1"]
[org.locationtech.proj4j/proj4j "1.3.0"]
[org.locationtech.proj4j/proj4j-epsg "1.3.0"]
[org.locationtech.spatial4j/spatial4j "0.8"]
[org.locationtech.jts/jts-core "1.19.0"]
[org.locationtech.jts.io/jts-io-common "1.19.0"]
[org.wololo/jts2geojson "0.18.1"]]
:codox {:themes [:rdash]}
:profiles {:dev {:global-vars {*warn-on-reflection* true}
:plugins [[lein-midje "3.2.2"]
[lein-codox "0.10.7"]
[lein-project-version "0.1.0"]]
:dependencies [[org.clojure/clojure "1.10.1"]
:dependencies [[org.clojure/clojure "1.10.3"]
[codox-theme-rdash "0.1.2"]
[criterium "0.4.5"]
[cheshire "5.10.0"]
[midje "1.9.9"]]}
[criterium "0.4.6"]
[cheshire "5.10.1"]
[midje "1.10.5"]]}
:1.9 {:dependencies [[org.clojure/clojure "1.9.0"]]}
:1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}
:1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]}}
Expand Down
Loading