gfredericks / seventy-one

71 in Clojure
Eclipse Public License 1.0
39 stars 9 forks source link

ClojureScript support #12

Closed aengelberg closed 9 years ago

aengelberg commented 9 years ago

(Resolves #11 )

Porting the source was indeed as easy as changing the extension to .cljc. However, adding ClojureScript test cases took some more thought.

I added a new clojurescript test file; I would have turned the existing clj into cljc as well, except leiningen does not yet recognize cljc's during "lein test". Added lein-cljsbuild plugin and build settings (all in the dev profile of course), and an HTML file you can open in your browser to run the compiled JS. To run the cljs test cases, run lein cljsbuild once (or auto), then open resources/private/html/unit-test.html in your browser.

gfredericks commented 9 years ago

Now that clojure 1.7 is released I think a .cljc file is a better approach than a duplicate source tree.

I didn't move the tests to .cljc though, and I think most of that work is present in this branch. If you can port it to the new .cljc file I'd be happy to merge.

aengelberg commented 9 years ago

Are the related leiningen issues resolved? That was my reservation for using a cljc test file.

gfredericks commented 9 years ago

I've successfully used leiningen with .cljc tests by making a lein alias that explicitly lists the relevant namespaces. I'm not sure what other issues there were.

aengelberg commented 9 years ago

I have moved the test case to cljc, but please keep in mind:

Were you thinking of a different command to alias? I'm willing to explore that path further if you got it working.

gfredericks commented 9 years ago

I think you just need to drop the :only: https://github.com/gfredericks/exact/blob/master/project.clj#L8-10

aengelberg commented 9 years ago

Thanks, that did it. I've updated the PR and I believe it's ready to merge now.

gfredericks commented 9 years ago

Works great, thanks!