I'm not familiar with clj-soy. If it can use templates defined as
strings, then you can consume the BufferedReader returned by
appengine-magic.core/open-resource-stream. appengine-magic already
includes a dependency on Apache Commons IO, so
org.apache.commons.io.IOUtils/toString should work.
One issue I've found so far is that, since I'm using Maven, I have to
re-process the resources and then re-eval the corresponding namespace
whenever I want to make changes to the templates.
Examples at: https://github.com/duck1123/jiksnu/tree/master/src/main/clojure/jiksnu/templates
and https://github.com/duck1123/jiksnu/tree/master/src/main/resources/soy/jiksnu/templates
If this works in both the interactive REPL and in production App
Engine, then I'll gladly accept a patch.
Is there something wrong with using the standard
clojure.java.io/resource function?
- James
Unfortunately, yes.
1. It's implemented in terms of Thread/currentThread, which I'm not
sure works in production App Engine.
2. In the past, just loading clojure.java.io broke because it uses
classes not on the App Engine classloader whitelist. I'm pretty sure
this hasn't changed.