Skip to content

Commit

Permalink
Make boot work
Browse files Browse the repository at this point in the history
  • Loading branch information
frankiesardo committed May 31, 2016
1 parent dfc19cd commit eacd2d4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion build.boot
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(set-env!
:resource-paths #{"src/java" "src/clojure"}
:resource-paths #{"src"}
:dependencies
'[[org.clojure/clojure "1.7.0"]
[com.google.auto.value/auto-value "1.2-rc1"]
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(ns auto-parcel.extension
(:require [stencil.core :as mustache]))
(:require [stencil.core :as mustache]))

(def template
"package {{& package}};
Expand Down Expand Up @@ -58,21 +58,21 @@ final class {{& class-name}} extends {{& class-to-extend}} {
}")

(defn- ->prop [[k v :as prop]]
{:name k
:cast-type (.toString (.getReturnType v))})
{:name k
:cast-type (.toString (.getReturnType v))})

(defn- add-last? [props]
(cond-> props
(not-empty props) (assoc-in [(dec (count props)) :last?] true)))
(cond-> props
(not-empty props) (assoc-in [(dec (count props)) :last?] true)))

(defn- generate [skeleton]
(mustache/render-string template skeleton))
(mustache/render-string template skeleton))

(defn process [context class-name class-to-extend final?]
(let [skeleton {:package (.packageName context)
:class-name class-name
:class-to-extend class-to-extend
:props (->> (.properties context)
(mapv ->prop)
(add-last?))}]
(generate skeleton)))
(let [skeleton {:package (.packageName context)
:class-name class-name
:class-to-extend class-to-extend
:props (->> (.properties context)
(mapv ->prop)
(add-last?))}]
(generate skeleton)))

0 comments on commit eacd2d4

Please sign in to comment.