Re: Leiningen 1.3.0 - compile task problem

2010-08-28 Thread lprefontaine
Fine,

I'll post entire project in a tar file this week end and will come back with
the URL before Sunday night. Need to complete urgent work in the garden today :)

Luc P.

Phil Hagelberg p...@hagelb.org wrote ..
 On Fri, Aug 27, 2010 at 8:06 PM,  lprefonta...@softaddicts.ca wrote:
  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.
 
 Well, it may be useful to others who can't immediately upgrade to 1.3
 for whatever reason. If you just post the implementation of the
 has-corresponding-src? function then I can publish it as a plugin once
 I get Leiningen 1.3.1 out. Or some other Leiningen contributor could
 do it.
 
 -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


Re: Leiningen 1.3.0 - compile task problem

2010-08-28 Thread lprefontaine
Hi Phil,

there's a tar file at this url with the entire project skeleton:

http://cid-0bd9c1ec7356c53b.office.live.com/browse.aspx/lein-our-classes-only-0.0.1-SNAPSHOT?Bsrc=GetSharingLinkBpub=SDX.Docs

I added a README file. There is a small twist when building the target.

For those having the same issue and in need of an immediate work around,
I loaded the hook on clojars.

Add this in your dev-dependencies in project.clj:

 [lein-our-classes-only 0.0.1-SNAPSHOT]

And to insure leiningen is picking up the hook:

:hooks [leiningen.hooks.our-classes-only]

The hook has been built against leiningen 1.3.0 with clojure and contrib 1.2

I re-tested here after removing the artifact from archiva to make sure it's
picked up from clojars.

This hook may work with earlier versions of leiningen and clojure but has
not been tested...

Luc P.


lprefonta...@softaddicts.ca wrote ..
 Fine,
 
 I'll post entire project in a tar file this week end and will come back with
 the URL before Sunday night. Need to complete urgent work in the garden today 
 :)
 
 Luc P.
 
 Phil Hagelberg p...@hagelb.org wrote ..
  On Fri, Aug 27, 2010 at 8:06 PM,  lprefonta...@softaddicts.ca wrote:
   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.
  
  Well, it may be useful to others who can't immediately upgrade to 1.3
  for whatever reason. If you just post the implementation of the
  has-corresponding-src? function then I can publish it as a plugin once
  I get Leiningen 1.3.1 out. Or some other Leiningen contributor could
  do it.
  
  -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


Re: Leiningen 1.3.0 - compile task problem

2010-08-27 Thread lprefontaine
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


Re: Leiningen 1.3.0 - compile task problem

2010-08-27 Thread lprefontaine
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


Re: Leiningen 1.3.0 - compile task problem

2010-08-27 Thread Phil Hagelberg
On Fri, Aug 27, 2010 at 8:06 PM,  lprefonta...@softaddicts.ca wrote:
 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.

Well, it may be useful to others who can't immediately upgrade to 1.3
for whatever reason. If you just post the implementation of the
has-corresponding-src? function then I can publish it as a plugin once
I get Leiningen 1.3.1 out. Or some other Leiningen contributor could
do it.

-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


Re: Leiningen 1.3.0 - compile task problem

2010-08-26 Thread lprefontaine
I read the ticket on Assembla and found it risky to try to implement the
patch.

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.

There maybe a need to revert to the current behavior but I think that the
uberjar task is the one to use if you want dependencies in the target.

What do you think ?

Luc P.

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


Re: Leiningen 1.3.0 - compile task problem

2010-08-26 Thread Phil Hagelberg
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


Leiningen 1.3.0 - compile task problem

2010-08-25 Thread lprefontaine
Hi all,

We are completing the migration to clojure and contrib 1.2.
I am working on the packaging this week using leinigen 1.3 for acceptance
tests.

I download artifacts from Clojars and other maven repos using our archiva
server here.
 
I have a problem that I do not understand yet (slowly coming back from
summer vacations...) with the compile task. I end up with .class files
from clojure-contrib in my class folder in one of my projects here.

The src folder does not contain any clojure-contrib stuff though...
Adding the omit-source option removed the .clj files in the target
but still stuffed the .class files from contrib.

Only the alien classes from contrib end up in the target, nothing from clojure
or other dependencies.

It's like if the compile task is picking up source code from the jar
dependency, not just the source code files of the project.

I specified :all instead of enumerating my own name spaces which I will
do right now to see if it clears out the issue.

Any ideas anyone ?

Thank you,

Luc

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


Re: Leiningen 1.3.0 - compile task problem

2010-08-25 Thread Phil Hagelberg
On Wed, Aug 25, 2010 at 5:59 PM, lprefonta...@softaddicts.ca wrote:
 We are completing the migration to clojure and contrib 1.2.
 I am working on the packaging this week using leinigen 1.3 for acceptance
 tests.

 I download artifacts from Clojars and other maven repos using our archiva
 server here.

 I have a problem that I do not understand yet (slowly coming back from
 summer vacations...) with the compile task. I end up with .class files
 from clojure-contrib in my class folder in one of my projects here.

 The src folder does not contain any clojure-contrib stuff though...
 Adding the omit-source option removed the .clj files in the target
 but still stuffed the .class files from contrib.

This is a possibly due to a problem with Clojure's compiler. There is a fix
implemented in this patch:

http://www.assembla.com/spaces/clojure/tickets/322

Hopefully it can be applied soon to Clojure 1.3. Maybe you could try
applying it yourself to see if it solves the problem?

-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