-
Notifications
You must be signed in to change notification settings - Fork 14
Getting Started
Updated for version: 0.7
Conjure is written entirely in Java and Clojure. It’s compiled into a self containing and extracting jar file called conjure.jar. To download it, simply visit the Conjure Download section of github.
To create a new Conjure project, simply copy the conjure.jar file to the directory you want the project to live in. Then open a terminal or command prompt and type “java -jar conjure.jar < your project name >”.
For example, if you want to create a project named hello_world in an already created projects directory. Use the following steps:
- Copy or move conjure.jar into the projects directory.
- Open a terminal or command prompt and cd into the projects directory.
- Type: “java -jar conjure.jar hello_world”
Conjure will create a directory called hello_world and extract all of it’s files into that directory.
For a more in depth tutorial on Conjure, see the Hello World Tutorial.
You will need to change the permission on the run.sh script to make it runnable. “chmod u+x run.sh” will update the permission appropriately.
New to Conjure in 0.7, there are now 2 ways to download and create a new project with Conjure. The first is to use the Leiningen plugin and the second involves using the standalone jar as before. Going forward, the Leiningen plugin will be the preferred way to use Conjure.
It doesn’t matter if you start with the Leiningen plugin or the standalone jar. Both methods create nearly identical project directories, and you will be able to switch between them with little work.
For version 0.7, I’ve created a Leiningen plugin which will allow those familiar with Leiningen to easily download Conjure and start a new Conjure project. If you’re not familiar with Leiningen, see the Leiningen project
The rest of this section requires you to have Leiningen installed, and have a basic understanding of how it works.
After creating a new Leiningen project, simply add the Conjure core jar to your dependencies and the Leiningen Conjure plugin to your dev dependencies in your project.clj file.
Hello world project.clj example:
(defproject hello_world "1.0.0-SNAPSHOT" :description "FIXME: write" :dependencies [[org.clojure/clojure "1.1.0"] [org.clojure/clojure-contrib "1.1.0"] [conjure-core "0.7.0-SNAPSHOT"]] :dev-dependencies [[lein-conjure "0.7.0-SNAPSHOT"]])
After updating the project.clj file, run “lein deps” to download the lein-conjure plugin and all of its dependencies.
To convert your project to a new Conjure project, run the following from your command line:
lein conjure new
Conjure will create a bunch of files and directories in your project. You now have a Conjure project ready for you to alter as you see fit.
You can also create a Conjure project using the standalone jar. You can find the standalone jar on the downloads page.
Download the standalone jar and save it in the location you want your project directory to end up in. Then execute the jar with the following command to create a hello-world project:
java -jar conjure-standalone.jar hello-world
You will now see a hello_world directory. In that directory, a basic Conjure project is ready for you to alter.
To run the Conjure scripts, use the conjure.sh or conjure.bat files and simply add the name of the script as the first argument, and the arguments of the script afterward.
For example, to start the conjure server using the server script, type:
./conjure.sh server
If you need to add libraries to your project, simply drop the jar into the lib directory. All of the jars in the lib directory will be automatically picked up by the Conjure scripts.