Are there some useful ways of triggering complete rebuilds in lein? I'm finding it hard to understand how / when lein reruns/reloads code. Altering files doesn't always seems to result in the changes being applied, and manually requesting recompile for gen-class doesn't always seem to generate files.
Manually deleting files in the target directory doesn't always work, as even if I recompile those files are not always generated so I'll get ClassNotFound errors. How do I have lein properly rebuild everything on each invocation?
edit: most of my confusion was due to not specifying classes created with gen-class in the project.clj file with an :aot directive as suggested in @juan.facorro's comment, e.g.
(defproject
...
:aot [mytestclass.full.packagename.TestClass1 mytestclass.full.packagename.TestClass2 ]
...
)
lein clean
before doing any compilation through any of the other commands (i.e.lein compile
,lein run
,lein repl
) not work?:gen-class
is used to the:aot
option in your leiningenproject.clj
? I can't seems to reproduce the behavior you describe though, doinglein clean
removes the target directory, and adding either(compile 'the.Example)
or:aot [the.Example]
generates thethe/Class.class
file. Can you post the steps you follow when you see this behavior?