Re: Leiningen Local Repositories

2012-02-03 Thread R Daneel
I can't get this to work using lein 1.6.2.  I tried using the exact 
~/.lein/init.clj in the example, but 'lein new foo' just creates a standard 
stub project.clj, without the additional elements.  Is there anything I'm 
missing?  Thanks!

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

2011-10-06 Thread Michał Marczyk
Hi!

Issue #287 [1] seems related to this.

I've posted a description of a possible use of unquote in defproject
for doing things like

(defproject ...
  ;; private-repo-info comes from ~/.lein/init.clj
  :repositories ~(user/private-repo-info))

as a comment on the issue.

Sincerely,
Michał


[1] https://github.com/technomancy/leiningen/issues/287

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

2011-10-05 Thread Rob Wolfe
Dave Sann daves...@gmail.com writes:

 Hey Rob, Thanks for your reply,

 I will try that for my projects

 My use case is slightly different though. I want to be able to build other 
 peoples projects from source (e.g. from github) without editing any of the 
 project.clj files - but still overriding to use my local repository.

 Any ideas?

Quick and dirty hack is adding to init.clj something like this:

;;; ~/.lein/init.clj ;;;

(defn customize
  Customize default repos
  [new-repos]
  (alter-var-root #'leiningen.core/default-repos
  (fn [p] (leiningen.core/repositories-for
   {:omit-default-repositories true
:repositories new-repos}

(customize {releases
http://artifactory/artifactory/libs-release;
snapshots 
http://artifactory/artifactory/libs-snapshot;
local-release 
http://artifactory/artifactory/libs-release-local})
;

I haven't really thought all consequences of this hack through,
so use it on your own risk. ;-)

HTH,
Rob

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

2011-10-05 Thread Phil Hagelberg
On Wed, Oct 5, 2011 at 3:03 PM, Rob Wolfe r...@smsnet.pl wrote:
 Dave Sann daves...@gmail.com writes:

 Hey Rob, Thanks for your reply,

 I will try that for my projects

 My use case is slightly different though. I want to be able to build other
 peoples projects from source (e.g. from github) without editing any of the
 project.clj files - but still overriding to use my local repository.

 Any ideas?

 Quick and dirty hack is adding to init.clj something like this:

This should work, but as you've noticed it's pretty ugly. This
functionality is excluded from Leiningen on purpose because it would
encourage projects that can't build from project.clj alone. There are
a few places where you legitimately need to exclude necessary info
from project.clj (deploy credentials mostly), but in general we want
to avoid Works on My Machine scenarios.

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

2011-10-05 Thread Dave Sann
Hi Phil, I agree - I am not looking for 'builds on my machine' in 
particular.

I want to separate the distinction of my use of a local 
repository/cache/proxy to serve globally available jars from the project.clj 
so that it is portable.

This enables me to have local build and a continuous integration build 
without repeatedly downloading the entire dependency chain. And, at the same 
time, not make the project.clj specific to me.

I see this a slightly different question from 'builds on my machine' which 
is determined by the presence of dependencies in globally available 
repositories. If I were to distribute a project.clj with dependencies that 
were not available, that would definitely be a pain.

Anyway, it is not a major issue for me. Thanks for your input.

Cheers

Dave

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

2011-10-02 Thread Rob Wolfe
Dave Sann daves...@gmail.com writes:

 Hi,

  I run Artifactory as a local repository manager. Currently, I am adding

 :omit-default-repositories true
 :repositories {releases  http://artifactory/artifactory/libs-release;
snapshots 
 http://artifactory/artifactory/libs-snapshot;
local-release 
 http://artifactory/artifactory/libs-release-local}

 To all my project.clj files.

 Does anyone know if you can add this as a default for lein? If so, how?

You can try this:

$ lein version
Leiningen 1.6.1.1 on Java 1.6.0_22 Java HotSpot(TM) 64-Bit Server VM

$ cat ~/.lein/init.clj 

(def settings {:omit-default-repositories true
   :repositories {releases  
  http://artifactory/artifactory/libs-release;
  snapshots 
  http://artifactory/artifactory/libs-snapshot;
  local-release 
  
http://artifactory/artifactory/libs-release-local}})

$ lein new testinit2
Created new project in: /home/rw/src/clojure/test/testinit2

$ cat testinit2/project.clj 
(defproject testinit2 1.0.0-SNAPSHOT
  :description FIXME: write description
  :dependencies [[org.clojure/clojure 1.2.1]]
  :omit-default-repositories true
  :repositories {releases
  http://artifactory/artifactory/libs-release;, 
  snapshots http://artifactory/artifactory/libs-snapshot;, 
local-release http://artifactory/artifactory/libs-release-local})


HTH,
Rob

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

2011-10-01 Thread Dave Sann
Hi,

 I run Artifactory as a local repository manager. Currently, I am adding

:omit-default-repositories true
:repositories {releases  http://artifactory/artifactory/libs-release;
   snapshots 
http://artifactory/artifactory/libs-snapshot;
   local-release 
http://artifactory/artifactory/libs-release-local}

To all my project.clj files.

Does anyone know if you can add this as a default for lein? If so, how?

Thanks

Dave


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