Hi Phil,

I got it working with the our-classe-only plug-in.
I tested it on my brain damaged project and it kept only the class files
for which a name space exists in the source folder. The target is now
cleaned up of any external class dependencies.

Now, if others need this what do you suggest ? I am not really ready
yet to load this in a public repo, publish it in clojars, ...
Time wise I am squeezed for a week or so.

The life time of this plug in hopefully will not be very long
if a compiler fix makes it in clojure 1.3.

Suggestions ?

Luc P.

lprefonta...@softaddicts.ca wrote ..
> I'll try it today and let you know by the end of today if I can
> manage it :)
> 
> Luc P.
> 
> Phil Hagelberg <p...@hagelb.org> wrote ..
> > On Thu, Aug 26, 2010 at 5:59 PM,  <lprefonta...@softaddicts.ca> wrote:
> > > Instead I decided to experiment a Leiningen plug in, sauberjar to create 
> > > the
> > > target only with the class files and only the ones for which there is a
> > > corresponding source file in the source folder. To start this asap, I 
> > > cloned
> > the
> > > existing jar task however I feel I can confine the modification to a 
> > > single
> > > function.
> > >
> > > I just need to filter the list of files to dump in the jar target before
> > > creating the jar.
> > >
> > > Phil, I would rather see this in the jar task rather than having a 
> > > separate
> > > plug in.
> > 
> > I'm hoping get the problem fixed in Clojure itself rather than working
> > around it in Leiningen. However, in the mean time a better fix could
> > be done in a plugin using hooks. The hook would wrap the compile task
> > to delete all the files you don't want after the compile task has run.
> > It would look something like this (rough sketch, haven't run this,
> > only proven it correct, etc.):
> > 
> > (defn our-classes-only [compile-task project & args]
> >   (apply compile-task project args)
> >   (doseq [f (file-seq (java.io.File. (:compile-path project)))
> >                :when (and (.isFile f) (not (has-corresponding-src? f)))]
> >     (.delete f)))
> > 
> > (add-hook #'leiningen.compile/compile our-classes-only)
> > 
> > -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 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 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