Fork me on GitHub
#beginners
<
2015-06-19
>
mj_langford03:06:24

for projects not in clojars, but publicly posted on github…how do I specify to use them in my project.clj

niwinz05:06:20

Maybe you can find it useful 😄

mj_langford16:06:20

thanks @niwinz, played with it a bit last night before giving up. Probably easier to fork the project and submit to clojars than try to figure out lein-git-deps any longer

sveri17:06:29

@mj_langford: if you need it only locally you can run "lein install" from the project, this will install it into your local maven rep

shaun-mahood17:06:30

@mj_langford: Have you tried lein install? I found it pretty easy and painless (at least for development purposes)

mj_langford17:06:20

I have a less than complete understanding of the meaning of all the keys in the project.clj dicts. Do you know of anything using that which explains where to put references?

mj_langford17:06:50

will just referring to it by name in dependencies be enough after that?

sveri17:06:43

@mj_langford: I dont understand your last question, however, did you see the big sample project.clj: https://github.com/technomancy/leiningen/blob/master/sample.project.clj

mj_langford17:06:01

I see that, I’ve added it to :repositories [["tabulum" {:url "https://github.com/zclj/tabulam"}]]

mj_langford17:06:18

But then it’s not finding it

mj_langford17:06:29

I don’t see how to link the name up so I can :as it in in the namespace

shaun-mahood17:06:21

@mj_langford: Can you post your project.clj so we can take a look?

mj_langford17:06:47

It’s basically the lein chestnut template default prj

mj_langford17:06:48

tabulam is the library I’m fighting

shaun-mahood17:06:10

First off, you spelled tabulam wrong. See if that fixes it.

shaun-mahood17:06:28

If not, we can get it working with lein install pretty easily

mj_langford17:06:42

fixed, still doesn’t work

mj_langford17:06:50

I’ve already done lein install

mj_langford17:06:59

just didn’t find doc on how to make that available either

mj_langford17:06:12

and instead found doc about specifying repos in :repositories

shaun-mahood17:06:13

Ok, then take it out of the :repositories key and add it to the dependencies as [tabulam "0.1.0-SNAPSHOT"]

shaun-mahood17:06:22

Then you should be able to require it in your other files as [tabulam.core :as tabulam] or however

mj_langford17:06:54

when I run lein repl, I get errors about not finding tabulam in clojars

mj_langford17:06:12

I did lein install by cloning tabulam

mj_langford17:06:16

and running lein install

shaun-mahood17:06:24

What message did you get when you ran lein install?

mj_langford17:06:36

nothing I believe

mj_langford17:06:43

I can certainly try it again 😄

mj_langford17:06:44

Created /Users/mlangford/Projects/tabulam/target/tabulam-0.1.0-SNAPSHOT.jar Wrote /Users/mlangford/Projects/tabulam/pom.xml Installed jar and pom into local repo.

mj_langford17:06:05

Is there another step beyond “lein install” to install it into the maven repo?

mj_langford17:06:16

I feel like I’ve missed reading the doc on this…but I can’t find it

shaun-mahood17:06:32

No, that should work - same type of message I get.

mj_langford17:06:49

“local” repo == this machine?

mj_langford17:06:56

or “this repository"

shaun-mahood17:06:13

I think it means the machine

shaun-mahood17:06:11

Still not working after the last lein install?

mj_langford17:06:20

Just checked the .m2 directory, tabulam is definitely there

shaun-mahood17:06:00

Same error as before? Can you repost the project.clj?

mj_langford17:06:23

trying to check

mj_langford17:06:23

restarting repls: not the fastest thing in the world

shaun-mahood17:06:34

The first time I had to deal with anything beyond the super basic in lein I ran into a bunch of issues too.

mj_langford17:06:29

woo hoo, worked out

mj_langford17:06:31

total summary: lein install, spell name correctly, get version number correctly everywhere, specify name in :dependencies, then call it MOULE.core in the actual :as import

mj_langford17:06:58

I’ll eventually revisit this to figure out how to skip the local maven install, but that was a lot of help folks !

andrew20:06:39

has anyone put together something like clojure koans where the student needs to figure out what part of clojure would be most suitable given a description or a snippet of code? ... like "in this situation a defrecord would be better than deftype" ... and "in that situation you should use a vector instead of a list" ... and maybe the student proceeds with a choice and further down the road discovers and understands the pain if their choice was suboptimal .... ?