tatut / clj-chrome-devtools

Clojure API for controlling a Chrome DevTools remote
MIT License
130 stars 21 forks source link

can't add latest git version as dependency #21

Closed ysangkok closed 5 years ago

ysangkok commented 5 years ago
Cloning: https://github.com/tatut/clj-chrome-devtools.git
Checking out: https://github.com/tatut/clj-chrome-devtools.git at a2c07289a55afef7c2ea81bf42cc76c70c9ebc63
Error building classpath. Checkout conflict with file: resources/devtools-protocol
org.eclipse.jgit.api.errors.JGitInternalException: Checkout conflict with file: resources/devtools-protocol

I have the following in my deps.edn:

   :aliases {:test {
                 :extra-deps {com.cognitect/test-runner {:git/url "https://github.com/cognitect-labs/test-runner.git"
                                                         :sha "209b64504cb3bd3b99ecfec7937b358a879f55c1"}
                              tatut/clj-chrome-devtools
                                                        {:git/url "https://github.com/tatut/clj-chrome-devtools.git"
                                                         :sha "a2c07289a55afef7c2ea81bf42cc76c70c9ebc63"}
                              }
                 :main-opts ["-m" "cognitect.test-runner"]}}
aviflax commented 5 years ago

FYI (we should probably add this to the README) this library cannot currently be used as a gitlib via tools-deps because most of the API is auto-generated at build time from the devtools protocol spec.

tatut commented 5 years ago

We don't think we actually need to ship the devtools-protocols if we generate all required code in the command namespaces. I could get rid of the submodule. This needs some work.

I want to support deps.edn usage as I think it is important for the future (and I personally like using git coordinates for libraries)

tatut commented 5 years ago

There's new code in master which generates the command namespaces fully (the specs and function defs are part of the code, not simply a macro call).

If this approach works, then the devtools-protocol files aren't needed at runtime anymore. The latest commit has tests passing, but I haven't tested it at all in real use yet.

ysangkok commented 5 years ago

works great now, tested with 58a396f54f469e98b5aae92b9357d65434914228