Skip to content

Commit

Permalink
Fix class name munging issue
Browse files Browse the repository at this point in the history
for names with dots, fixes #3
  • Loading branch information
taylorwood committed Oct 30, 2018
1 parent 2dd7ce3 commit d97f25a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/clj/native_image.clj
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
(-> (io/file (System/getenv "GRAALVM_HOME") "bin/native-image")
(.getAbsolutePath)))

(defn- munge-class-name [class-name]
(cs/replace class-name "-" "_"))

(defn -main [main & opts]
(let [[nat-img-path & nat-img-opts]
(if (some-> (first opts) (io/file) (.exists)) ;; check first arg is file path
Expand All @@ -57,7 +60,9 @@
(System/exit 1))

(println "Loading" main)
(load (cs/replace main "." File/separator))
(load (-> main
(cs/replace "." File/separator)
(munge-class-name)))

(println "Compiling" main)
(prep-compile-path)
Expand All @@ -66,6 +71,6 @@
(System/exit
(build-native-image
(deps->classpath (merged-deps))
main
(munge-class-name main)
nat-img-path
nat-img-opts))))

0 comments on commit d97f25a

Please sign in to comment.