|
Documentation
Documentation of currently available Counterclockwise's functionalities. All things listed here should work.
Featured
PrerequisitesOn your machine configuration
On yourself reading the present documentation :-)
Install Counterclockwise pluginPre-requisite: an Eclipse version including Java Support (e.g. with the JDT : Java Development Tools, as in Eclipse For Java Developers, Eclipse For RCP/RAP developers, Eclipse for JavaEE developers, etc.) Update site : http://ccw.cgrand.net/updatesite/ There is a central place for installation procedure of all clojure IDEs. You will find the counterclockwise's one here : http://dev.clojure.org/display/doc/Getting+Started+with+Eclipse+and+Counterclockwise As a bonus, you'll have the additional (optional) steps to install a clojure lab in counterclockwise (labrepl). Having issues with the installer ?Unsatisfied dependency ... org.antlr.runtimeSome people reported problems with the eclipse installer. The problem, as stated, is that eclipse can't manage to find the antlr required dependency. One quick option you have is to manually install the missing antlr jar in your eclipse's plugin directory, restart eclipse (maybe with -clean option, but not absolutely necessary in a first try), and then try reinstalling Counterclockwise from the update site, as mentioned above. For your convenience, we have placed the antlr plugin in the downloads section of Counterclockwise site : http://counterclockwise.googlecode.com/files/org.antlr.runtime_3.0.0.v200803061811.jar ( download page: http://code.google.com/p/counterclockwise/downloads/list ) Check that Counterclockwise is correctly installed(optional step, do this if you have any doubt)
Enable Counterclockwise clojure's supportOn a new project
On an existing java project
What does it doA clojure project is just a java project, with an added builder for clojure code. By default, creating/enabling a clojure project will also check if you have clojure in your classpath, and if not, will add a dependency on Counterclockwise plugin's own embedded clojure version. What can I customize ?Everything you want as if you were in a classical java project. But you must of course always have clojure as a dependency of your project, but it can come in as many flavors as eclipse allows :
Launch Clojure codeFrom a specific clojure file
Note: a REPL will also be installed. By default, if the selected file contains a (ns) call, the name of its namespace will be used. A preference can controller whether this feature is active or not. Launch a REPL for the project
A console for the java process is started, and a REPL View is opened where you can type expressions for evaluation. YOU MUST HIT Ctrl+ENTER (CMD+ENTER ON A MAC) to send the expression for evaluation. Notes:
Use the namespace browserThe namespace browser will show you all symbols of all namespaces of the REPL you have launched, and allow you to jump to the source code defining them, if available (double clic on the symbol). It also allows you to search the symbol you want by typing regexps in the "Find :" text zone, and choosing to do the search only on symbols names, or also on symbols documentation. If you let the mouse hover a node in the browser, you will have the documentation, if available.
How does it work ?When you have launched the REPL, Counterclockwise has embedded "server code" in the launched clojure environment. This server code is contacted by Counterclockwise to give information on the running clojure environment. The namespace browser uses this server to provide you with the most possible up to date info on the symbols. Debug clojure code
Edit clojure source codeBy creating a new clojure fileClojure files must be located in normal java source directories. If you place files with the .clj extension outside of a java source directory, then Eclipse will not see it on the classpath of the project, and you will not be able to load it via the REPL, select it as an automatically loaded file in the launcher customization wizard ...
By importing existing codeDo as you would in a classic java project. Just remember to place all clojure files in a java source directory. What features does the editor offer ?Syntax higlighting
Code completion
200 results are proposed, with a warning message at the bottom of the BE AWARE it is still a bit slow for java completion (due to the fact that there is no type to narrow the search, it is done for any class type in the classpath !) This will be enhanced in a future release by allowing gradually more time consuming code completions (first try completion only for those classes imported in the namespace as symbols, and then, on user demand - by pressing space a second time - broaden the search to the entire set of classpath visible class types) Errors reporting
Lots of productivity enabling keyboard shortcutsSee this page: EditorKeyBindingsFeatures Interaction with a launched REPLSee this page: EditorKeyBindingsFeatures Running Tests
<!-- How does this work? Need more detailed description: how to define tests, how to see the run-tests result Currently I see only REPL background changed to yellow and "Tests failed" in statusbar. --> Auto-build featureOnce you have started a REPL for your project, eclipse will use a backdoor connection to this REPL to automatically compile and load the files you edit (if the eclipse Project > Build automatically option is selected, of course). Package your workDistribute as a jar
Create a "fat" executable jar with all dependencies packaged intoIt appears that someone created a useful Eclipse plugin to build executable jars from a java project. Once installed, it also works from a Counterclockwise project out of the box! Install the Fat Jar plugin
To create the executable jar, open the contextual menu of the project, and select the Fat jar menu entry.
Please refer to the Fat Jar plugin homepage for more detail N.B. : there is also out-of-the-box executable jar support in Eclipse, but we encountered problems with it when the main class is not located in the source folders of the project, as is the case when you generate the main class from a clojure namespace. |