Skip to content

Commit

Permalink
fixed build to include compiled java classes
Browse files Browse the repository at this point in the history
  • Loading branch information
slagyr committed Jan 29, 2024
1 parent 1d8f0a5 commit b0a6b67
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 3.4.5

* 3.4.4 was a failed deploy... no compiled java code.

# 3.4.4

* fixes bug where `it` blocks were not executing within the namespace where they were declared.
Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.4.5
31 changes: 23 additions & 8 deletions dev/build.clj
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,16 @@
(def basis (b/create-basis {:project "deps.edn"}))
(def src-dirs (:paths basis))
(def lib (symbol group-name lib-name))
(def version "3.4.4")
(def version (str/trim (slurp "VERSION")))
(def class-dir "target/classes")
(def jar-file (format "target/%s-%s.jar" lib-name version))
(def deploy-config {:coordinates [lib version]
:jar-file jar-file
:pom-file (str/join "/" [class-dir "META-INF/maven" group-name lib-name "pom.xml"])
:repository {"clojars" {:url "https://clojars.org/repo"
:username (System/getenv "CLOJARS_USERNAME")
:password (System/getenv "CLOJARS_PASSWORD")}}
:transfer-listener :stdout})

(defn clean [_]
(println "cleaning")
Expand All @@ -24,8 +31,16 @@
:lib lib
:version version}))

(defn javac [_]
(println "compiling java")
(b/javac {:src-dirs ["src"]
:class-dir class-dir
:basis basis
:javac-opts ["--release" "11"]}))

(defn jar [_]
(clean nil)
(javac nil)
(pom nil)
(println "building" jar-file)
(b/copy-dir {:src-dirs src-dirs
Expand All @@ -42,14 +57,14 @@
(shell/sh "git" "tag" version)
(shell/sh "git" "push" "--tags")))))

(defn install [_]
(jar nil)
(println "installing " (:coordinates deploy-config))
(aether/install deploy-config))

(defn deploy [_]
(tag nil)
(jar nil)
(aether/deploy {:coordinates [lib version]
:jar-file jar-file
:pom-file (str/join "/" [class-dir "META-INF/maven" group-name lib-name "pom.xml"])
:repository {"clojars" {:url "https://clojars.org/repo"
:username (System/getenv "CLOJARS_USERNAME")
:password (System/getenv "CLOJARS_PASSWORD")}}
:transfer-listener :stdout}))
(println "deploying " (:coordinates deploy-config))
(aether/deploy deploy-config))

0 comments on commit b0a6b67

Please sign in to comment.