Fork me on GitHub
#babashka
<
2022-12-18
>
Anssi Kittilä06:12:04

Can I somehow use babashka pods in deps.edn projects?

borkdude07:12:26

Yes, you can add the babashka pods library to a Clojure project

Anssi Kittilä07:12:47

Cool, I was asking because theres this https://github.com/babashka/pod-babashka-go-sqlite3, but could not find similiar one from clojars. Is it babashka-pod only or am I looking from the wrong place?

borkdude09:12:55

What I meant is you can add this dependency in your JVM project: https://github.com/babashka/pods And then use pods you like you do in bb

🙌 1
Ben Lieberman19:12:03

I'm trying to use Google's Java API for Drive and curiously when I import it as (:import [com.google.api.services.drive.Drive]) it returns nil but when I try it with the syntax I understand to be correct (i.e. (:import [com.google.api.services.drive Drive])) it throws an exception saying it cannot resolve the class

borkdude19:12:52

@U03QBKTVA0N The first seems to be a case of not verifying like clojure does:

$ clj -M -e "(ns foo (:import [com.google.api.services.drive.Drive]))"
Syntax error macroexpanding clojure.core/ns at (REPL:1:1).
((:import [com.google.api.services.drive.Drive])) - failed: Extra input spec: :clojure.core.specs.alpha/ns-form
The syntax isn't correct. If you use clj-kondo it will also tell you that:

borkdude19:12:10

The real problem is that babashka doesn't support loading Java classes that are not built-in.

Ben Lieberman19:12:36

oh, that certainly makes sense. This is the first time I've used BB so good to know.

borkdude19:12:39

You may try to use #C029PTWD3HR (Node.js babashka) which doesn't have this limitation: you can use any Node library in it that you want.

borkdude19:12:01

Or just use JVM Clojure

Ben Lieberman19:12:31

I have been wanting to check out nbb too so I'll give that a go, thanks @U04V15CAJ