Wiki

Clone wiki

clojuresque / Getting_Started

Getting Started

  • Download and install gradle 1.0-milestone3.
  • Create a project directory. This directory will be henceforth called PROJECT_DIR.
  • Download clojuresque. Put the jar in $PROJECT_DIR/lib/buildscript. Note: To download a different version replace all version numbers in the link.
  • Download the clojuresque runtime library. Put the jar in $PROJECT_DIR/lib/runtime. Note: The version number must match the clojuresque version.
  • Download clojure. Put the jar in $PROJECT_DIR/lib/runtime.
  • Put your clojure sources in $PROJECT_DIR/src/main/clojure following the usual path conventions for namespace translation.
  • Tell gradle that you want to use clojure. Note: The version number of the clojuresque dependency must match the one you downloaded!
        buildscript {
                repositories { flatDir dirs: project.file("lib/buildscript") }
                dependencies { classpath "clojuresque:clojuresque:1.4.1" }
        }

        apply plugin: "clojure"

        repositories {
               flatDir dirs: project.file("lib/runtime")
        }

        dependencies {
            compile "org.clojure:clojure:1.2.1"
        }
  • Build your project – gradle build.

Please refer also to the extensive gradle documentation for general information on how to use gradle to its full power. Questions can be asked on the clojuresque google group. Non-clojuresque specific questions might be better directed to gralde user mailing list. Chances are that there is faster response there for pure gradle questions.

Adding VimClojure Support

  • Add the following to your dependencies section:
        development "vimclojure:server:2.2.0"
  • Then add the following task to start the VimClojure backend:
        task runNailgun(type: JavaExec) {
                classpath = project.files(
                        project.sourceSets.main.clojure.srcDirs,
                        project.sourceSets.main.classesDir,
                        project.sourceSets.test.clojure.srcDirs,
                        project.configurations.testRuntime,
                        project.configurations.development
                )
                main = "vimclojure.nailgun.NGServer"
                args = [ "127.0.0.1" ]
        }

Adding Swank Support

  • Add the following to your dependencies section:
        development "swank-clojure:swank-clojure:1.3.1"
  • Then add the following task to start swank:
        task runSwank(type: clojuresque.ClojureExec) {
                classpath = project.files(
                        project.sourceSets.main.clojure.srcDirs,
                        project.sourceSets.main.classesDir,
                        project.sourceSets.test.clojure.srcDirs,
                        project.configurations.testRuntime,
                        project.configurations.development
                )
                main = "swank.swank/start-repl"
                args = []
        }
  • Finally connect from emacs using M-x slime-connect

Updated