Delete the class dir when compilation fails

This commit is contained in:
Joshua Suskalo 2024-07-24 14:26:46 -05:00
parent 5799e4f8da
commit fc4307fc1f
No known key found for this signature in database
GPG key ID: 9B6BA586EFF1B9F0

View file

@ -49,11 +49,14 @@
"Compiles java classes required for interop."
[opts]
(.mkdirs (io/file class-dir))
(b/process {:command-args ["javac" "--enable-preview"
"src/java/coffi/ffi/Loader.java"
"-d" class-dir
"-target" "19"
"-source" "19"]})
(let [compilation-result
(b/process {:command-args ["javac" "--enable-preview"
"src/java/coffi/ffi/Loader.java"
"-d" class-dir
"-target" "19"
"-source" "19"]})]
(when-not (zero? (:exit compilation-result))
(b/delete {:path class-dir})))
opts)
(defn- write-pom