             [clojure.set :as set]
             [clojure.string :as string]
             [clojure.walk :as walk])
-  (:import (com.google.template.soy SoyFileSet)
+  (:import (com.google.template.soy SoyFileSet SoyFileSet$Builder)
            (com.google.template.soy.data SanitizedContent$ContentKind
                                          UnsafeSanitizedContentOrdainer)
-           (com.google.template.soy.shared SoyGeneralOptions)))
+           (com.google.template.soy.shared SoyGeneralOptions)
+           (com.google.template.soy.tofu SoyTofu)))
 
 (def ^:private template-cache
   "Default to keeping the 32 most-used templates in cache."

    (string/join (cons (string/lower-case (first uc)) (next uc)))))

(defn- camelize-keys
  [m]
  (let [f (fn [[k v]] (if (keyword? k) [(camel-case k) v] [k v]))]
    ;; only apply to maps
    (walk/postwalk (fn [x] (if (map? x) (into {} (map f x)) x)) m)))


(defn- parse-uncached
  [files]
  (let [^SoyFileSet$Builder builder
        (reduce #(.add ^SoyFileSet$Builder %1 (io/resource %2))
                (SoyFileSet/builder) files)
        opts (SoyGeneralOptions.)]
    (.setStrictAutoescapingRequired opts true)
    (.setGeneralOptions builder opts)
