Your SlideShare is downloading. ×
0
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Leiningen 2 - Humane build management for Clojure
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Leiningen 2 - Humane build management for Clojure

1,716

Published on

Developer experience is important and Clojure developers have the pleasure of managing their build process in Clojure with Leiningen.org

Developer experience is important and Clojure developers have the pleasure of managing their build process in Clojure with Leiningen.org

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,716
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
20
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Leiningen 2 Humane build management forClojureMadeSimple.co.uk
  • 2. slideshare.net/jr0cket This slide deck is available to follow along with on slideshare.net
  • 3. of Java buildmanagement
  • 4. ...there was Ant, Ant begat Ivy,Ant begat Maven
  • 5. … and there was much XML all around
  • 6. buildmanagement
  • 7. Human verses Computer readable build jobs
  • 8. Leiningen … more fun than Maven… easy way to kick-start your Clojure addiction
  • 9. Leiningen: Manual installDownload the Leiningen 2 install script from leiningen.orgMove the lein file to an executable location, eg. ~/binMake the install script executable and run the install chmod u+x ~/bin/lein lein
  • 10. Leiningen: package managers● Ubuntu● Debian● Fedora● CentOS
  • 11. Leiningen also staring in Eclipse pluginCounter Clockwise
  • 12. All the usual tasks...lein new ● Create a new clojure projectlein deps ● Download all dependencieslein run ● Run your applicationlein jar ● Deploy your app as a jar
  • 13. ...and then somelein uberjar - Include Clojure & all your dependencies in one jarlein repl - Fire up the dynamic coding environment (REPL) - Hook to start a REPL fromjack-in within Emacs
  • 14. Fire up the REPL REPL: read, evaluate, print loop – dynamiclein repl environment for Clojure and other lisps
  • 15. Typing code into the REPL Develop functions and data structures on the flyREPL: read, evaluate, print loop – dynamic environment for Clojure and other lisps
  • 16. Create a new project lein new my-project cd my-project lein depsLein deps will check your project.clj configuration file anddownload any libraries (jar files) that are required by the project
  • 17. Anatomy of a new projectNote: dashes in project names are converted to underscores to make Java happy!
  • 18. Over-riding defaults
  • 19. Create project with a different templatelein new template-name my-project
  • 20. Example: WebNoir templatelein new noir fpdays2012-web
  • 21. Version your project with Git cd my-project git init Create a repo on github & add it to your project git remote add origin git@github.com/account/project.git git push -u origin masterYou may want to edit your .git-ignore file also
  • 22. Open project in emacscd my-projectemacs project.clj
  • 23. project.clj - project definitionLein deps will check this project.clj configuration file anddownload any libraries (jar files) that are required by the project
  • 24. Group DependenciesUsually a reversed domain name
  • 25. Dev DependenciesDev-dependencies: Add libraries only needed fordevelopment, not packaged when code deployed
  • 26. https://clojars.org/
  • 27. http://search.maven.com
  • 28. Add a REPL sessionREPL: read, evaluate, print, loop – dynamic environment for Clojureand other lisps
  • 29. Add REPL session to all projects~/.lein/profiles.clj
  • 30. Fire up the REPL in Emacs M – x clojure- jack-inM – x represents the keyboard combination of the meta key followed by x.Then the command clojure-jack-in is entered.
  • 31. REPL in Emacs
  • 32. Add web based REPL ~/.lein/profiles.cljREPL: read, evaluate, print, loop – dynamic environment for Clojureand other lisps
  • 33. Leiningen WebRepl plugin
  • 34. Local Repositories (just like Maven)
  • 35. Libraries kept in local .m2 folder
  • 36. Repositorieshttps://github.com/technomancy/leiningen/blob/preview/sample.project.clj
  • 37. Running your project
  • 38. Create a new projectlein runRuns the main function, or specify main with -moption
  • 39. Long running processeslein trampoline run -m my-app.server 5000Web applications - noir - enclojure - ring
  • 40. Running Tests lein tests lein tests my.proj.code lein help testsAutomating test runs ?
  • 41. Deployment
  • 42. Jars & Uber Jarslein jar- package up your project,requires Clojure on the serverlein uberjar- package up everything, evenClojure
  • 43. project.clj for jar / uberjar
  • 44. Clojure code for jar / uberjar
  • 45. Deploy to ClojarsCreate a maven pomlein pomCreate a maven pomscp pom.xml myproject-0.1.0.jarclojars@clojars.org:
  • 46. Deploy to ClojarsOr just use lein-clojarshttps://github.com/ato/lein-clojars
  • 47. Deploying to the Cloud
  • 48. Uses your Leiningen project.clj- Create your account & install the toolbelt- Create your instance- Push your git repo- Fire up your browserblog.raynes.me/blog/2011/11/03/moving-try-clojure-to-heroku/devcenter.heroku.com/articles/clojure-web-application
  • 49. Leiningen Plug-ins
  • 50. Running scripts Copying files DVCS (git) ContinuousIntegration server (Jenkins)
  • 51. Leiningen.org - Tutorials- Github Repository - News - Bug reporting
  • 52. Choose Life...… choose Clojure
  • 53. Thank you @jr0cketClojureMadeSimple.co.ukslideshare.net/jr0cket

×