-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
87 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
(ns build | ||
(:require [clojure.tools.build.api :as b] | ||
[deps-deploy.deps-deploy :as dd])) | ||
|
||
(def lib 'com.eldrix/dmd) | ||
(def version (format "0.6.%s" (b/git-count-revs nil))) | ||
(def class-dir "target/classes") | ||
(def jar-basis (b/create-basis {:project "deps.edn"})) | ||
(def uber-basis (b/create-basis {:project "deps.edn" | ||
:aliases [:run]})) | ||
(def jar-file (format "target/%s-%s.jar" (name lib) version)) | ||
(def uber-file (format "target/%s-server-%s.jar" (name lib) version)) | ||
|
||
(defn clean [_] | ||
(b/delete {:path "target"})) | ||
|
||
(defn jar [_] | ||
(clean nil) | ||
(println "Building" lib version) | ||
(b/write-pom {:class-dir class-dir | ||
:lib lib | ||
:version version | ||
:basis jar-basis | ||
:src-dirs ["src"] | ||
:scm {:url "https://github.com/wardle/dmd" | ||
:tag (str "v" version) | ||
:connection "scm:git:git://github.com/wardle/dmd.git" | ||
:developerConnection "scm:git:ssh://[email protected]/wardle/dmd.git"}}) | ||
(b/copy-dir {:src-dirs ["src"] | ||
:target-dir class-dir}) | ||
(b/jar {:class-dir class-dir | ||
:jar-file jar-file})) | ||
|
||
(defn install | ||
"Installs pom and library jar in local maven repository" | ||
[_] | ||
(jar nil) | ||
(println "Installing" lib version) | ||
(b/install {:basis jar-basis | ||
:lib lib | ||
:class-dir class-dir | ||
:version version | ||
:jar-file jar-file})) | ||
|
||
|
||
(defn deploy | ||
"Deploy library to clojars. | ||
Environment variables CLOJARS_USERNAME and CLOJARS_PASSWORD must be set." | ||
[_] | ||
(clean nil) | ||
(jar nil) | ||
(dd/deploy {:installer :remote | ||
:artifact jar-file | ||
:pom-file (b/pom-path {:lib lib | ||
:class-dir class-dir})})) | ||
(defn uber | ||
"Build an executable uberjar file for hermes HTTP server" | ||
[_] | ||
(clean nil) | ||
(b/copy-dir {:src-dirs ["src" "cmd" "resources"] | ||
:target-dir class-dir}) | ||
(b/compile-clj {:basis uber-basis | ||
:src-dirs ["src" "cmd"] | ||
:ns-compile ['com.eldrix.dmd.cli] | ||
:class-dir class-dir}) | ||
(b/uber {:class-dir class-dir | ||
:uber-file uber-file | ||
:basis uber-basis | ||
:main 'com.eldrix.dmd.cli})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters