Skip to content

Commit

Permalink
Tidy up build process.
Browse files Browse the repository at this point in the history
Add deps.edn alias for testing and building an uberjar. For latter add AOT compilation, build instructions in README, and a 'Hello World' entry point.
  • Loading branch information
wardle committed Sep 9, 2020
1 parent dc8e0b3 commit da5c7f1
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.cpcache/
.idea/
classes/
target/
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# hermes

`hermes` is a clojure-based suite of terminology tools including a fast server with full-text search functionality.

It replaces previous similar tools written in java and golang and is designed to fit into a wider architecture
with identifier resolution, mapping and semantics as first-class abstractions.

#### Run from the command-line

```
clj -m com.eldrix.hermes.core
```

#### Running tests
```
clj -A:test
```

#### Building uberjar

Perform ahead-of-time (AOT) compilation (see [https://clojure.org/guides/deps_and_cli#aot_compilation](https://clojure.org/guides/deps_and_cli#aot_compilation))
```
clj -e "(compile 'app.core)"
```

This will generate class files to create a runnable jar. Now you can build an uberjar:

```
clojure -A:uberjar
```
18 changes: 14 additions & 4 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
{:deps {org.clojure/data.csv {:mvn/version "1.0.0"}
org.clojure/core.async {:mvn/version "1.3.610"}
org.clojure/tools.logging {:mvn/version "1.1.0"}}
:paths ["src"]}
{:deps {org.clojure/clojure {:mvn/version "1.10.1"}
org.clojure/data.csv {:mvn/version "1.0.0"}
org.clojure/core.async {:mvn/version "1.3.610"}
org.clojure/tools.logging {:mvn/version "1.1.0"}}
:paths ["src" "classes"]

:aliases {:test {:extra-paths ["test"]
:extra-deps {com.cognitect/test-runner {:git/url "https://github.com/cognitect-labs/test-runner.git"
:sha "6ec7f8eef509cd14d831e8cc16e856b31327a862"}}
:main-opts ["-m" "cognitect.test-runner"]}
:uberjar {:extra-deps {uberdeps/uberdeps {:mvn/version "1.0.0"}}
:main-opts ["-m" "uberdeps.uberjar"
"--target" "target/hermes-0.1.0.jar"
"--main-class" "com.eldrix.hermes.core"]}}}
4 changes: 4 additions & 0 deletions src/com/eldrix/hermes/core.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(ns com.eldrix.hermes.core (:gen-class))

(defn -main [& args]
(println "Hello world"))

0 comments on commit da5c7f1

Please sign in to comment.