diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c53038e --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +/target +/classes +/checkouts +pom.xml +pom.xml.asc +*.jar +*.class +/.lein-* +/.nrepl-port +.hgignore +.hg/ diff --git a/project.clj b/project.clj new file mode 100644 index 0000000..7d8566d --- /dev/null +++ b/project.clj @@ -0,0 +1,8 @@ +(defproject lein-neo4j "0.1.0" + :description "neo4j server invokable from leiningen" + :url "https://gitea.heevyis.ninja/josha/lein-neo4j" + :license {:name "GPL-3.0" + :url "https://opensource.org/licenses/GPL-3.0"} + :dependencies [[org.neo4j/neo4j "3.4.4"] + [org.neo4j.app/neo4j-server "3.4.4"]] + :eval-in-leiningen true) diff --git a/src/leiningen/neo4j.clj b/src/leiningen/neo4j.clj new file mode 100644 index 0000000..8ab4e2b --- /dev/null +++ b/src/leiningen/neo4j.clj @@ -0,0 +1,15 @@ +(ns leiningen.neo4j + (:import org.neo4j.graphdb.factory.GraphDatabaseFactory + org.neo4j.server.CommunityBootstrapper + java.lang.Runtime + java.lang.Thread + java.util.Optional) + (:require [clojure.java.io :as io])) + +(defn neo4j + [project & args] + (let [path (io/as-file (get-in project [:neo4j :path] "target/neo4j")) + config (get-in project [:neo4j :config] {}) + server (CommunityBootstrapper.)] + (.start server path (Optional/empty) config) + (while true (Thread/sleep 10000))))