Skip to content

Commit

Permalink
v0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
borkdude committed Jun 1, 2024
1 parent 8475e93 commit 95f99d1
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
cljs-test-runner-out
test/scratch.clj
test/borkdude/scratch.clj
target
64 changes: 64 additions & 0 deletions build.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
(ns build
(:require [clojure.tools.build.api :as b]
[clojure.edn :as edn]))

(def project (-> (edn/read-string (slurp "deps.edn"))
:aliases :neil :project))
(def lib (or (:name project) 'my/lib1))

;; use neil project set version 1.2.0 to update the version in deps.edn

(def version (or (:version project)
"1.2.0"))
(def class-dir "target/classes")
(def basis (b/create-basis {:project "deps.edn"}))
(def uber-file (format "target/%s-%s-standalone.jar" (name lib) version))
(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"]
:pom-data
[[:licenses
[:license
[:name "MIT License"]
[:url "https://opensource.org/license/mit/"]]]]})
(b/copy-dir {:src-dirs ["src" "resources"]
:target-dir class-dir})
(b/jar {:class-dir class-dir
:jar-file jar-file}))

(defn install [_]
(jar {})
(b/install {:basis basis
:lib lib
:version version
:jar-file jar-file
:class-dir class-dir}))

(defn uber [_]
(clean nil)
(b/copy-dir {:src-dirs ["src" "resources"]
:target-dir class-dir})
(b/compile-clj {:basis basis
:src-dirs ["src"]
:class-dir class-dir})
(b/uber {:class-dir class-dir
:uber-file uber-file
:basis basis}))

(defn deploy [opts]
(jar opts)
((requiring-resolve 'deps-deploy.deps-deploy/deploy)
(merge {:installer :remote
:artifact jar-file
:pom-file (b/pom-path {:lib lib :class-dir class-dir})}
opts))
opts)

11 changes: 9 additions & 2 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{:aliases
{:test ;; added by neil
{:neil {:project {:name io.github.borkdude/html
:version "0.1.0"}}
:test ;; added by neil
{:extra-paths ["test"]
:extra-deps {io.github.cognitect-labs/test-runner
{:git/tag "v0.5.0" :git/sha "b3fd0d2"}
Expand All @@ -10,4 +12,9 @@
{:extra-deps {olical/cljs-test-runner {:mvn/version "3.7.0"}
org.clojure/clojurescript {:mvn/version "1.11.132"}}
:extra-paths ["test" "cljs-test-runner-out/gen"]
:main-opts ["-m" "cljs-test-runner.main" "-d" "test"]}}}
:main-opts ["-m" "cljs-test-runner.main" "-d" "test"]}

:build ;; added by neil
{:deps {io.github.clojure/tools.build {:git/tag "v0.10.3" :git/sha "15ead66"}
slipset/deps-deploy {:mvn/version "0.2.2"}}
:ns-default build}}}

0 comments on commit 95f99d1

Please sign in to comment.