clojure-maven-plugin
clojure-maven-plugin copied to clipboard
Deleting of dependent files after aot compile
When clojure compiler compiles namespace with gen-class directive it recursively pulls all dependent classes. See CLJ-322
In some maven build environments such behavior could be redundant. The following configuration will delete dependent class files from outputDirecotry after clojure's AOT compile step.
<configuration> <keepNamespaces> <keepNamespace>foo.bar</keepNamespace> </keepNamespaces> </configuration>
Multiple keepNamespace elements are supported and clojure's namespace mangling rules are expected:
- at least to parts separated by '.'
- last part becomes a start of class file
- '-' is translated into '_'
For Counterclockwise's needs, I've written another flavor of this. It adds a config parameter to activate the feature, and just uses what is already configured via <namespaces/>
.
I will create a PR and we can talk about the merits of one and the other and hopefully come up with something that will be integrated.