Skip to content

Commit

Permalink
Replace depstar with tools.build
Browse files Browse the repository at this point in the history
  • Loading branch information
FieryCod committed Oct 22, 2022
1 parent e695797 commit 1275359
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 12 deletions.
3 changes: 1 addition & 2 deletions modules/holy-lambda-template/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?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">
<?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>
<groupId>holy-lambda</groupId>
<artifactId>lein-template</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
;; You can always build your own GraalVM image with enterprise edition
:image "ghcr.io/fierycod/holy-lambda-builder:amd64-java11-22.0.0.2"}

:build {:compile-cmd "clojure -X:uberjar"
:build {:compile-cmd "clojure -T:build uber"
;; Used when either :docker is nil or
;; `HL_NO_DOCKER` environment variable is set to "true"
;; Might be set via `GRAALVM_HOME` environment variable
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
(ns build
(:require
[clojure.tools.build.api :as b]))

(def class-dir "target/classes")
(def basis (b/create-basis {:project "deps.edn"}))

(defn clean [_]
(b/delete {:path "target"})
(b/delete {:path ".holy-lambda/build"}))

(defn uber [_]
(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
:main '{{main-ns}}.core
:basis basis
:uber-file ".holy-lambda/build/output.jar"}))
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
io.github.FieryCod/holy-lambda {:mvn/version "0.6.6"}
com.github.clj-easy/graal-build-time {:mvn/version "0.1.4"}}

:paths ["src" "resources"]

:aliases {:uberjar {:replace-deps {com.github.seancorfield/depstar {:mvn/version "2.1.303"}}
:exec-fn hf.depstar/uberjar
:exec-args {:aot ["{{main-ns}}.core"]
:main-class "{{main-ns}}.core"
:jar ".holy-lambda/build/output.jar"
:jvm-opts ["-Dclojure.compiler.direct-linking=true"
"-Dclojure.spec.skip-macros=true"]}}}}
:paths ["src" "resources"]
:aliases
{:build {:deps {io.github.clojure/tools.build {:git/tag "v0.8.3" :git/sha "0d20256"}}
:ns-default build}}}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
["resources/native-agents-payloads/1.edn" (render* "1.edn")]
["README.md" (render* "README.md")]
["bb.edn" (render* "bb.edn")]
["build.clj" (render* "build.clj")]
["Dockerfile" (render* "Dockerfile")]
["deps.edn" (render* "deps.edn")]
["template.yml" (render* "template.yml")]
Expand Down

0 comments on commit 1275359

Please sign in to comment.