I've been struggling with leiningen project hooks as I believe that I
need them for my current project.

I am writing an manual with code examples, using a literate programming
technology. The main source is in asciidoc, but I can untangle these to
produce valid clojure, which I can then evaluate and test.

To do this, however, I need to run an external process to generate the
"source" -- i.e. the Clojure files which are not really source in this
case, before I try to load them and test the functions in them. In
Maven, I can do this with the exec plugin by attaching to the initialize
phase.

I thought to try leiningen hooks but as far as I can see this is only
possible within a plugin; so I have tried this...

(defproject take-wing "0.1.0-SNAPSHOT"
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [uk.org.russet/tawny-owl "1.1.1-SNAPSHOT"]]

  :hooks [take.build.gensource]
  )


where "take.build.gensource" is defined in the src directory of the
project (most of the rest of this directory will be generated).

Error: cannot resolve take.build.gensource/activate hook
Error: cannot resolve take.build.gensource/activate hook

The take/build/gensource.clj file exists and it has an "activate"
function.

I am guessing that this is failing because leiningen is not looking in
the project source-path, only it's own classpath. I'm a bit reticient to
write a leiningen plugin for this as a) it would be entirely specific to
this project and b) it would make the build more complex (AFAIK I'd have
to do a pre-build for the plugin, then another for the actual project)
and c) is a pain for anyone else.

So, should hooks work under these circumstances? Or must I go the plugin
route?

Phil

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to