|
49 | 49 | :target-path :target-exe :classpath :native-image-xmx |
50 | 50 | :entry-class]}] |
51 | 51 | (status/line :head "Graal native-image compile AOT") |
52 | | - (let [full-target-exe (fs/which target-exe)] |
53 | | - (when (fs/exists? full-target-exe) |
54 | | - (fs/delete full-target-exe))) |
55 | | - (let [native-image-cmd [graal-native-image |
56 | | - (str "-H:Path=" target-path) |
57 | | - (str "-H:Name=" target-exe) |
58 | | - "--features=clj_easy.graal_build_time.InitClojureClasses" |
59 | | - "-O1" ;; basic optimization for faster build |
60 | | - (str "-H:ReflectionConfigurationFiles=" reflection-config) ;; to support unsafe yaml test |
61 | | - "-H:+ReportExceptionStackTraces" |
62 | | - "--verbose" |
63 | | - "--no-fallback" |
64 | | - "-cp" classpath |
65 | | - (str "-J-Xmx" native-image-xmx) |
66 | | - entry-class]] |
67 | | - (t/shell native-image-cmd))) |
| 52 | + (let [full-path-target-exe (str (fs/file target-path target-exe))] |
| 53 | + (when-let [exe (fs/which full-path-target-exe)] |
| 54 | + (status/line :detail "Deleting existing %s" exe) |
| 55 | + (fs/delete exe)) |
| 56 | + (let [native-image-cmd [graal-native-image |
| 57 | + "-o" full-path-target-exe |
| 58 | + "--features=clj_easy.graal_build_time.InitClojureClasses" |
| 59 | + "-O1" ;; basic optimization for faster build |
| 60 | + (str "-H:ReflectionConfigurationFiles=" reflection-config) ;; to support unsafe yaml test |
| 61 | + "-H:+ReportExceptionStackTraces" |
| 62 | + "--verbose" |
| 63 | + "--no-fallback" |
| 64 | + "-cp" classpath |
| 65 | + (str "-J-Xmx" native-image-xmx) |
| 66 | + entry-class]] |
| 67 | + (t/shell native-image-cmd)))) |
68 | 68 |
|
69 | 69 | (defn humanize-bytes [bytes] |
70 | 70 | (let [units ["bytes" "KB" "MB" "GB"] |
|
0 commit comments