Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A maven plugin for compiling ClojureScript

branch: develop

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 src
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.md
Octocat-spinner-32 ReleaseNotes.md
Octocat-spinner-32 finish-release.sh
Octocat-spinner-32 pom.xml
Octocat-spinner-32 start-release.sh
README.md

Zi-cljs

Zi-Cljs is a maven plugin for clojurescript.

It uses the maven pom sourceDirectory and testSourceDirectory settings to locate source, which by default means that it uses src/main/clojurescript and src/test/clojurescript.

It requires maven 3.0.3.

This is alpha quality at present.

Philosophy

Why build something that Rich Hickey said he hopes he would never see? The ClojureScript compile runs on the JVM, so jars are the natural packaging for use with it. While support for clojurescript in leiningen would be very nice, it isn't there yet, and it wasn't clear (to me at least) how to add it to the current version.

zi-cljs is intended to be used in module containing just the clojurescript code, so that the classpath is spearate from the classpath of the server side of your project. This also allows a disintiction in the Clojure version used for compiling ClojureScript, and the Clojure version used on the server.

Available goals

  • zi-cljs:compile
  • zi-cljs:browser

Install

Globally installing the plugin allows you to run the goals without modifying a project's pom file.

To globally enable the zi-cljs plugin, you need to add pluginGroup and pluginRepository configuration to your ~/.m2/settings.xml file.

    <pluginGroups>
      <pluginGroup>org.cloudhoist.plugin</pluginGroup>
    </pluginGroups>
    <profiles>
      <profile>
        <id>clojure-dev</id>
        <pluginRepositories>
          <pluginRepository>
            <id>sonatype-snapshots</id>
            <url>http://oss.sonatype.org/content/repositories/releases</url>
          </pluginRepository>
        </pluginRepositories>
      </profile>
    </profiles>

    <activeProfiles>
      <activeProfile>clojure-dev</activeProfile>
    </activeProfiles>

To enable zi-cljs in a project pom, without globally enabling the plugin, you will need to add a pluginRepositories entry to your pom:

    <pluginRepositories>
      <pluginRepository>
        <id>sonatype-snapshots</id>
        <url>http://oss.sonatype.org/content/repositories/releases</url>
      </pluginRepository>
    </pluginRepositories>

Configuration

It uses the maven pom sourceDirectory and testSourceDirectory settings to locate source, which by default means that it uses src/main/clojurescript and src/test/clojurescript.

Goals

compile

The compile goal AOT compiles clojurescript source with the closure compiler..

    <build>
      <plugins>
        <plugin>
          <groupId>org.cloudhoist.plugin</groupId>
          <artifactId>zi-cljs</artifactId>
          <version>0.1.0</version>
          <executions>
            <execution>
              <id>default-compile</id>
              <goals>
                <goal>compile</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </build>

compile

Property Default Description
outputFileName ${project.build.finalName} The target file name
outputDirectory ${project.build.outputDirectory} The output directory
debug true Sets the :optimisation to nil if true (overrides optimize)
optimize false Sets the :optimisation to :advanced if true
verbose false Sets :pretty-print to true
targetVersion Sets :targer to the keywordised value

browser

Start a repl for running on a browser. The goal writes a browser.html file in the target directory, and this should be loaded in the browser to connect to the repl server started by this goal.

Property Default Description
port browser.port The port that the REPL server process should run on
mainNamespace ${project.name} The namespace to be required by the REPL
outputDirectory ${project.build.outputDirectory} The output directory

Zi, the builder

Zi was a builder in northern mythology.

License

Licensed under EPL

Copyright 2011 Hugo Duncan.

Something went wrong with that request. Please try again.