mpdairy / posh

A luxuriously simple and powerful way to make front-ends with DataScript and Reagent in Clojure.
Eclipse Public License 1.0
460 stars 45 forks source link

posh.plugin-base not included in jar file? #20

Open markaddleman opened 7 years ago

markaddleman commented 7 years ago

I'm trying to write a posh binding to rum and discovered that posh.plugin-base is not included in the posh jar file v0.5.5 from clojars. I don't see anything obviously wrong in the project.clj. In fact, when I generate the jar locally, the plugin-base is there.

alexandergunnarson commented 7 years ago

That's likely because posh.plugin-base is on master but hasn't been released as part of an artifact :) You could release your own artifact like [markzorkman/posh "0.5.6"] ?

... though maybe @mpdairy wants to prep another release?

mpdairy commented 7 years ago

@alexandergunnarson Oh, yes! I really need to get it set up on CircleCI. Do you have any example circleCI configs I could work off of? Or maybe it's easy enough just by looking at their docs...

alexandergunnarson commented 7 years ago

I have a CircleCI file I usually use — let me paste it in here.

alexandergunnarson commented 7 years ago

circle.yml:

test:
  override:
    - case $CIRCLE_NODE_INDEX in 0) echo "lein test-clj" && lein test-clj ;; 1) echo "lein test-cljs" && lein test-cljs ;; esac:
        parallel: true

That tests Clojure and ClojureScript builds in parallel. If you want to do it serially, that's simple too, but it's nice to have them separable, I think.

lein test-clj for CLJ is easy enough, but to have CLJS support you need something like the following in your project.clj:

:aliases {"test-clj"  ["with-profile" "+test" "test"]
          "test-cljs" ["with-profile" "+test" "doo" "phantom" "test" "once"]}

This in turn requires [lein-doo "0.1.7"] in :profiles > :dev > :plugins.

Then, also for CLJS support, in some sort of central test namespace, you should have e.g.:

(ns posh.tests
  (:require [doo.runner :refer-macros [doo-tests doo-all-tests]]
            #_"Require *all* your test namespaces here for CLJS's sake"))

#?(:cljs (doo-all-tests #"posh.+-test"))

Let me know if you have any other questions!

mpdairy commented 7 years ago

Ok, thanks! I'll get started on it later today.

alexandergunnarson commented 7 years ago

No problem! Let me know how I can help, if needed/wanted.

mpdairy commented 7 years ago

Ok, I didn't get to it today but I will try to set it up earlier tomorrow.

alexandergunnarson commented 7 years ago

No problem at all!

mpdairy commented 7 years ago

Do you know how to automatically have it deploy to Clojars?

mpdairy commented 7 years ago

Oh nevermind, I think I can just do it with ENV variables and lein deploy clojars

alexandergunnarson commented 7 years ago

Yup :)

mpdairy commented 7 years ago

Ok, what about version number auto-incrementing?

mpdairy commented 7 years ago

Maybe the version numbers should remain manual for now. I tried to get the autodeploy working by copying this guy's example: https://raw.githubusercontent.com/gmorpheme/lein-githooks/master/circle.yml And I set the CLOJARS_USERNAME and _PASSWORD env variables. But I get this terrible error:

lein deploy clojars
Created /home/ubuntu/posh/target/posh-0.5.6.jar
Wrote /home/ubuntu/posh/pom.xml
Could not sign /home/ubuntu/posh/target/posh-0.5.6.jar
gpg: no default secret key: secret key not available
gpg: signing failed: secret key not available

See `lein help gpg` for how to set up gpg.
If you don't expect people to need to verify the authorship of your jar, you
can add `:sign-releases false` to the relevant `:deploy-repositories` entry.

lein deploy clojars returned exit code 1

Action failed: lein deploy clojars
alexandergunnarson commented 7 years ago

Ah yes, the infamous GPG error — the one reason why I rarely deploy to Clojars haha (I set up a Clojars workflow on a different computer but not my current one and I haven't really recovered from it since). You have to use some sort of GPG agent to get it to work. Something like MacGPG. I don't remember the exact sequence of magic incantations to get Clojars to stop complaining but basically MacGPG makes it run smoothly.

Also about version numbers — yeah, probably those are best left manual just in case? Also you can try tagged releases on GitHub but I've never played around with those. I often use just the GitHub hash in place of version numbers (semantic versioning is so misleading) but it breaks the mold and is unfamiliar to users so maybe you wouldn't want to do that :)

mpdairy commented 7 years ago

Oh dang. Maybe there's some lein clojars command-line option I can do.

alexandergunnarson commented 7 years ago

Well actually — the GPG guide seems to have significantly improved since I last read it. https://github.com/technomancy/leiningen/blob/master/doc/GPG.md#debian-based-distributions

alexandergunnarson commented 7 years ago

CircleCI uses Ubuntu (Debian-based Linux) so you can follow those directions to achieve what you want. Sorry I'm not more help right now — just in the middle of something is all!