From a5e7f42a264622244ba6adfa5165c09dac54b91f Mon Sep 17 00:00:00 2001 From: "dziltener@lyrion.ch" Date: Wed, 30 Aug 2017 11:58:57 +0000 Subject: [PATCH] Preparing next minor version --- project.clj | 6 +++--- src/clojurefx/clojurefx.clj | 9 +++++---- src/clojurefx/controllergen.clj | 4 +++- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/project.clj b/project.clj index 871373f..cdde3fa 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject clojurefx/clojurefx "0.3.0" +(defproject clojurefx/clojurefx "0.3.1-SNAPSHOT" :description "A Clojure wrapper for JavaFX." :license "Like Clojure." :url "https://www.bitbucket.org/zilti/clojurefx" @@ -10,8 +10,8 @@ [com.taoensso/timbre "4.7.4" :exclusions [com.taoensso/carmine]] [net.openhft/compiler "2.3.0"] [clojure-jsr-223 "0.1.0"]] - ;; :profiles {:uberjar {:aot :all}} :profiles {:test {:source-paths ["test"] - :resource-paths ["test-resources"]}} + :resource-paths ["test-resources"]} + :uberjar {:aot :all}} :source-paths ["src"] :java-source-paths ["src"]) diff --git a/src/clojurefx/clojurefx.clj b/src/clojurefx/clojurefx.clj index c3c235a..c6bd27e 100644 --- a/src/clojurefx/clojurefx.clj +++ b/src/clojurefx/clojurefx.clj @@ -20,12 +20,13 @@ (let [iface-ref (reflect/type-reflect interface) bogus (debug "iface-ref:" iface-ref) methods (filter #(instance? clojure.reflect.Method %) (:members iface-ref)) - bogus (debug "methods:" (pr-str methods)) - method-sym (:name (first methods))] + functional-method (filter (fn [x] (some #(= % :abstract) (:flags x))) methods) + bogus (debug "methods:" (pr-str functional-method)) + method-sym (:name (first functional-method))] (debug "method-sym:" method-sym) - (when-not (= (count methods) 1) - (throw (new Exception (str "can't take an interface with more than one method:" (pr-str methods))))) + (when-not (= (count functional-method) 1) + (throw (new Exception (str "can't take an interface with more than one method:" (pr-str functional-method))))) (debug (pr-str `(proxy [~interface] [] (~method-sym ~args ~@code)))) diff --git a/src/clojurefx/controllergen.clj b/src/clojurefx/controllergen.clj index 4fd8efb..4b7aab0 100644 --- a/src/clojurefx/controllergen.clj +++ b/src/clojurefx/controllergen.clj @@ -106,7 +106,9 @@ ;; Plumber (defn gen-fx-controller-class [fxmlpath clj-fn] - (let [fxmlzip (zip-tree-seq (xml/parse (io/input-stream fxmlpath))) + (let [clj-fn (if (symbol? clj-fn) + (str (namespace clj-fn) "/" (name clj-fn))) + fxmlzip (zip-tree-seq (xml/parse (io/input-stream fxmlpath))) clazz (get-controller-class fxmlzip) [pkg classname] (reverse (map str/reverse (str/split (str/reverse clazz) #"\." 2))) cljvec (str/split clj-fn #"/")]