{"id":901,"date":"2014-12-03T13:05:35","date_gmt":"2014-12-03T13:05:35","guid":{"rendered":"http:\/\/sdi.thoughtstorms.info\/?p=901"},"modified":"2014-12-03T13:05:35","modified_gmt":"2014-12-03T13:05:35","slug":"clojars","status":"publish","type":"post","link":"https:\/\/blog.thoughtstorms.info\/?p=901","title":{"rendered":"Clojars"},"content":{"rendered":"<p>Well that was surprisingly painless.<br \/>\nI&#8217;m in the process of reorganizing the code for Patterning, my Clojure library that produces (visual) patterns.<br \/>\nPatterning was built using Quil, which is a Clojure wrapper around <a href=\"https:\/\/processing.org\/\">Processing<\/a>. But I wanted to be able to call the library directly from Processing itself (Java version).<br \/>\nIt seemed silly to create an uberjar file containing the whole of Quil and Processing, to be called from &#8230; er &#8230; Processing, so I decided to split the project into the core (pure Clojure, no Quil or Processing dependencies) and a Quil based wrapper.<br \/>\nI&#8217;m also, compiling the library using ClojureScript  to run in the browser. (Called from Javascript). Once again this part doesn&#8217;t want any Quil \/ Processing dependencies.<br \/>\nBut I was a bit stumped with how to manage some of this. My previous experience of projects that rely on other projects (git submodules) has been somewhat painful.<br \/>\nBut it seems the Clojure (via Java) world has actually sorted this. All I needed to do was create an account over on <a href=\"https:\/\/clojars.org\/\">Clojars<\/a> and type :<br \/>\n<code>lein deploy clojars<\/code><br \/>\nto put the JAR for my Patterning library there.<br \/>\nAnd so <a href='https:\/\/clojars.org\/com.alchemyislands\/patterning\/versions\/0.3.0-SNAPSHOT'>here it is<\/a>.<br \/>\nIncluding it in a new project is as simple as referencing it in the project.clj file. There&#8217;s a <a href=\"https:\/\/github.com\/interstar\/Patterning-Quil\">simple test project<\/a> which combines both Patterning and Quil. And here&#8217;s the very simple project.clj file. Note the patterning dependency.<br \/>\n<code><br \/>\n(defproject com.alchemyislands\/patterning_quil \"0.1.0-SNAPSHOT\"<br \/>\n    :description \"Quil Wrapper for Patterning library\"<br \/>\n    :url \"http:\/\/alchemyislands.com\"<br \/>\n    :license {:name \"Eclipse Public License\"<br \/>\n    :url \"http:\/\/www.eclipse.org\/legal\/epl-v10.html\"}<br \/>\n    :dependencies [[org.clojure\/clojure \"1.5.1\"]<br \/>\n                   [org.clojure\/math.numeric-tower \"0.0.4\"]<br \/>\n                   [quil \"1.7.0\"]<br \/>\n                   [com.alchemyislands\/patterning \"0.3.0-SNAPSHOT\"]]<br \/>\n    :aot [patterning_quil.core]<br \/>\n    :main patterning_quil.core<br \/>\n)<br \/>\n<\/code><br \/>\nAnd that&#8217;s more or less it.<br \/>\nIf you want to use Patterning in your own projects, just include it like that. If you still want to be using Quil, then use this as your example.<br \/>\nBTW: the new development for the core Patterning library is now at <a href=\"https:\/\/github.com\/interstar\/Patterning-Core\">https:\/\/github.com\/interstar\/Patterning-Core<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Well that was surprisingly painless. I&#8217;m in the process of reorganizing the code for Patterning, my Clojure library that produces (visual) patterns. Patterning was built using Quil, which is a Clojure wrapper around Processing. But I wanted to be able to call the library directly from Processing itself (Java version). It seemed silly to create [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[67,325,331],"class_list":["post-901","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-clojurescript","tag-package-management","tag-patterning"],"_links":{"self":[{"href":"https:\/\/blog.thoughtstorms.info\/index.php?rest_route=\/wp\/v2\/posts\/901","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.thoughtstorms.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.thoughtstorms.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.thoughtstorms.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.thoughtstorms.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=901"}],"version-history":[{"count":0,"href":"https:\/\/blog.thoughtstorms.info\/index.php?rest_route=\/wp\/v2\/posts\/901\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.thoughtstorms.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=901"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.thoughtstorms.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=901"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.thoughtstorms.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=901"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}