Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add proxy support #8

Closed
behrica opened this issue Jan 15, 2014 · 7 comments
Closed

add proxy support #8

behrica opened this issue Jan 15, 2014 · 7 comments

Comments

@behrica
Copy link
Contributor

behrica commented Jan 15, 2014

I am behind a corporate proxy, so the "distill" method does not manage to download dependencies.

I looked at the code, the aether/resolve-dependencies you use allows to specify a proxy.
So it just need to be passds through.

If I find some time I will fix it and send you a pull request

behrica added a commit to behrica/alembic that referenced this issue Jan 15, 2014
@hugoduncan
Copy link
Member

Maybe we should default the proxy information, in the same way leiningen does

@behrica
Copy link
Contributor Author

behrica commented Jan 15, 2014

I thought about it already.
I'll try

@behrica
Copy link
Contributor Author

behrica commented Jan 16, 2014

As I had the proxy values passing already working, I left it in.
But if no proxy parameter is specified, then it reads it via the method from leiningen.core.classpath path as you suggested.

So the function where the proxy config is the really used looks like this:

(defn resolve-dependencies
  [still dependencies repositories proxy]
  (classlojure/eval-in
   (:alembic-classloader @still)
   `(do
      (require '[leiningen.core.classpath :as ~'cp])
      (mapv
       (fn [dep#]
         (letfn [(apath# [^java.io.File f#] (.getAbsolutePath f#))]
           {:coords dep#
            :jar (-> dep# meta :file apath#)}))
       (keys
        (aether/resolve-dependencies
         :coordinates '~(vec dependencies)
         :repositories ~repositories
         :proxy '~(or proxy (cp/get-proxy-settings)  )))))))

What do you think ?

@behrica
Copy link
Contributor Author

behrica commented Jan 16, 2014

I made as well a version which always uses the environment variables without a way to override the proxy configuration via function parameters.
It's less code changes, so simpler.

Let me know, which version you prefer and I send a new pull request.

@hugoduncan
Copy link
Member

I think I would favour having the default picked up from the environment, and still being able to explicitly overide.

@behrica
Copy link
Contributor Author

behrica commented Jan 16, 2014

OK.
The pull request is updated.

@hugoduncan
Copy link
Member

Fixed in 8ced4ed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants