Skip to content

Commit

Permalink
build script
Browse files Browse the repository at this point in the history
  • Loading branch information
onionpancakes committed Feb 22, 2024
1 parent be74393 commit b642f66
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 1 deletion.
48 changes: 48 additions & 0 deletions build/build.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
(ns build
(:require [cognitect.test-runner.api :as tr]
[clojure.tools.build.api :as b]
[deps-deploy.deps-deploy :as dd]))

(def basis
(delay (b/create-basis)))

(def class-dir
"target/classes")

(def lib
'dev.onionpancakes/chassis)

(def version
(format "1.0.%s" (b/git-count-revs nil)))

(def jar-file
(format "target/%s-%s.jar" (name lib) version))

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

(defn jar [_]
(clean nil)
(b/write-pom {:basis @basis
:src-pom "./build/pom.xml"
:src-dirs ["src"]
:class-dir class-dir
:lib lib
:version version})
(b/copy-dir {:src-dirs ["src"]
:target-dir class-dir})
(b/jar {:class-dir class-dir
:jar-file jar-file}))

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

(defn deploy [_]
(jar nil)
(dd/deploy {:installer :remote
:artifact jar-file
:pom-file (b/pom-path {:class-dir class-dir :lib lib})}))
22 changes: 22 additions & 0 deletions build/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<groupId>dev.onionpancakes</groupId>
<artifactId>chassis</artifactId>
<name>chassis</name>
<description>Fast HTML5 serialization for Clojure</description>
<url>https://github.com/onionpancakes/chassis</url>
<licenses>
<license>
<name>MIT License</name>
<url>https://opensource.org/license/mit</url>
</license>
</licenses>
<repositories>
<repository>
<id>clojars</id>
<url>https://repo.clojars.org/</url>
</repository>
</repositories>
</project>
14 changes: 13 additions & 1 deletion deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
enlive/enlive {:mvn/version "1.1.6"}}
:extra-paths ["dev" "test" "resources"]}

:build
{:extra-deps {io.github.cognitect-labs/test-runner {:git/tag "v0.5.1" :git/sha "dfb30dd"}
io.github.clojure/tools.build {:mvn/version "0.9.6"}
slipset/deps-deploy {:mvn/version "0.2.2"}}
:extra-paths ["build" "test"]}

:run-tests
{:extra-deps {io.github.cognitect-labs/test-runner {:git/tag "v0.5.1" :git/sha "dfb30dd"}}
:extra-paths ["test"]
Expand All @@ -22,4 +28,10 @@
selmer/selmer {:mvn/version "1.12.59"}
enlive/enlive {:mvn/version "1.1.6"}}
:extra-paths ["dev" "test" "resources"]
:exec-fn user/run-gen-bench-all}}}
:exec-fn user/run-gen-bench-all}

:deploy
{:extra-deps {io.github.cognitect-labs/test-runner {:git/tag "v0.5.1" :git/sha "dfb30dd"}
io.github.clojure/tools.build {:mvn/version "0.9.6"}
slipset/deps-deploy {:mvn/version "0.2.2"}}
:extra-paths ["build" "test"]}}}

0 comments on commit b642f66

Please sign in to comment.