I have a testing tool called midje. Here's the project file for a trivial use 
of it:

    (defproject midje-aot "1.0.0-SNAPSHOT"
      :description "FIXME: write"
      :dependencies [[org.clojure/clojure "1.2.0"]
                     [org.clojure/clojure-contrib "1.2.0"]
                     [midje "1.2-alpha3"]]
      :dev-dependencies [[swank-clojure "1.2.1"]]
      :aot [midje-aot.core])
    
Here's the code:

    (ns midje-aot.core
      (:use midje.sweet))
    
    (defn do-something [n]
      (inc n))

I compile the project like this, under either Clojure 1.2.0 or 1.2.1:

    923 $ lein compile
    Compiling midje-aot.core
    924 $ 

This creates a classes/midje/ directory full of class files. (QUESTION: Why 
create a bunch of class files when Midje is in lib/ as a jar file?)

When I run the repl in this project, I can load some but not all of the Midje 
classes:

    503 $ lein repl
    REPL started; server listening on localhost:32259.
    user=> (require 'midje.checkers.simple)
    nil
    user=> (require 'midje.fakes)
    java.lang.ExceptionInInitializerError (NO_SOURCE_FILE:0)
    user=> (require 'midje.fakes)
    java.lang.NoClassDefFoundError: Could not initialize class 
midje.fakes__init (NO_SOURCE_FILE:0)
    user=> 

Note that the identical `require` statement failed in two different ways. 

I can't see any obvious differences between the class files generated from the 
two Clojure source files. (They both have *__init.class and 
*__4410__auto__.class) You can see the list of files here: 
https://gist.github.com/1040887

The two files both look pretty ordinary to me:

https://github.com/marick/Midje/blob/v.1.2-alpha3/src/midje/checkers/simple.clj
https://github.com/marick/Midje/blob/v.1.2-alpha3/src/midje/fakes.clj

Any ideas for either preventing AOT compiling for the jar file or fixing this 
problem some other way?

-----
Brian Marick, Artisanal Labrador
Contract programming in Ruby and Clojure
Occasional consulting on Agile
www.exampler.com, www.twitter.com/marick

-- 
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

Reply via email to