Skip to content

anolivetree/gradle-clojure

This branch is 382 commits behind clojurephant/clojurephant:main.

Folders and files

NameName
Last commit message
Last commit date
Nov 12, 2017
Nov 12, 2017
Nov 12, 2017
Nov 12, 2017
Aug 12, 2017
Aug 12, 2017
Nov 13, 2017
Aug 10, 2017
Nov 13, 2017
Nov 12, 2017
Aug 12, 2017
Aug 12, 2017
Aug 24, 2017

Repository files navigation

gradle-clojure

Bintray Travis GitHub license

What is this?

A Gradle plugin providing support for the Clojure and Clojurescript languages.

NOTE: gradle-clojure should not be considered stable until 1.0.0. Until then, minor versions (e.g. 0.1.0 to 0.2.0) will likely contain breaking changes.

Clojure Features

  • Packaging Clojure code (and/or AOT compiled classes) into a JAR
  • AOT compilation
  • Running clojure.test tests (integrated into Gradle's Test task)
  • Running an nREPL server

ClojureScript Features

Coming soon

Why should do you care?

The goal is to provide the same creature comforts that Leiningen and Boot do for Clojure/Clojurescript development, while also leveraging Gradle's unique features:

  • Strong support for polyglot projects
  • Strong support for multi-project builds
  • Large plugin ecosystem

Usage

See the Release Notes for available versions, compatibility with Gradle, Java, and Clojure, and detailed change notes.

This plugin assumes you're using a sane layout for your Clojure code - namespaces corresponding to your source code layout, and one namespace per file. The plugin uses the filenames to calculate the namespaces involved, it does not parse the files looking for ns forms.

Quick Start

Download the sample project for the basic structure.

Common Commands

  • ./gradlew test Executes your clojure.test tests (and any other JUnit tests in your build).
  • ./gradlew clojureRepl Starts an nREPL server (on a random port by default).

build.gradle

plugins {
  id "gradle-clojure.clojure" version "<version>"
}

dependencies {
  // whatever version of clojure you prefer (older versions may not be compatible)
  compile 'org.clojure:clojure:1.8.0'
  // and any other dependencies you want on the compile classpath
  // compile 'group:artifact:version'

  // needed for test integration
  testCompile 'junit:junit:4.12'
  // and any other test-specific dependencies
  // testCompile 'group:artifact:version'

  // dependencies for REPL use only
  dev 'org.clojure:tools.namespace:0.3.0-alpha4'
}

See all available options in the docs.

Getting help

Please use the repo's issues for all questions, bug reports, and feature requests.

Contributing

See the guidelines for details on how you can contribute.

Acknowledgements

This project started from the cursive.clojure plugin by Colin Fleming (@cmf, original author) and Piotrek Bzdyl (@pbzdyl).

Also thanks to John Szakmeister (@jszakmeister) for organizing a call with Gradle to get us started in the right direction.

About

Clojure and Clojurescript support for Gradle

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 54.8%
  • Clojure 45.2%