Skip to content

Commit

Permalink
Use POM settings more consistently
Browse files Browse the repository at this point in the history
  • Loading branch information
tsmacdonald committed Feb 20, 2024
1 parent 14527e8 commit f4f3bd4
Showing 1 changed file with 26 additions and 29 deletions.
55 changes: 26 additions & 29 deletions build.clj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[clojure.tools.build.api :as b]
[deps-deploy.deps-deploy :as dd]))

(def lib 'metabase/macaw)
(def lib 'io.github.metabase/macaw)
(def github-url "https://github.com/metabase/macaw")
(def scm-url "[email protected]:metabase/macaw.git")

Expand All @@ -34,33 +34,6 @@

(def basis (delay (b/create-basis {:project "deps.edn"})))

(defn clean [_]
(b/delete {:path target}))

(defn compile [_]
(println "\nCompiling Java files...")
(b/javac {:src-dirs ["java"]
:class-dir class-dir
:basis @basis
:javac-opts ["--release" "11"]}))

(defn jar [_]
(println "\nStarting to build a JAR...")
(compile nil)
(println "\tWriting pom.xml...")
(b/write-pom {:class-dir class-dir
:lib lib
:version version
:basis @basis
:src-dirs ["src"]})
(println "\tCopying source...")
(b/copy-dir {:src-dirs ["src" "resources"]
:target-dir class-dir})
(printf "\tBuilding %s...\n" jar-file)
(b/jar {:class-dir class-dir
:jar-file jar-file})
(println "Done! 🦜"))

(def pom-template
[[:description "A Clojure wrapper for JSqlParser"]
[:url github-url]
Expand All @@ -81,12 +54,36 @@
{:lib lib
:version version
:jar-file jar-file
:basis (b/create-basis {})
:basis @basis
:class-dir class-dir
:target target
:src-dirs ["src" "java"]
:pom-data pom-template})

(defn clean [_]
(b/delete {:path target}))

(defn compile [opts]
(println "\nCompiling Java files...")
(b/javac (merge default-options
opts
{:src-dirs ["java"]
:javac-opts ["--release" "11"]})))

(defn jar [opts]
(println "\nStarting to build a JAR...")
(compile nil)
(println "\tWriting pom.xml...")
(b/write-pom (merge default-options opts))
(println "\tCopying source...")
(b/copy-dir {:src-dirs ["src" "resources"]
:target-dir class-dir})
(printf "\tBuilding %s...\n" jar-file)
(b/jar {:class-dir class-dir
:jar-file jar-file})
(println "Done! 🦜"))


(defn deploy [opts]
(let [opts (merge default-options opts)]
(printf "Deploying %s...\n" jar-file)
Expand Down

0 comments on commit f4f3bd4

Please sign in to comment.