• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

clojurephant/clojurephant: Clojure and Clojurescript support for Gradle

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

clojurephant/clojurephant

开源软件地址(OpenSource Url):

https://github.com/clojurephant/clojurephant

开源编程语言(OpenSource Language):

Java 58.8%

开源软件介绍(OpenSource Introduction):

clojurephant

Formerly known as "gradle-clojure"

CI cljdoc

What is this?

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

NOTE: clojurephant 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
  • Package an Uberjar (via the Gradle Shadow plugin)
  • AOT compilation
  • Running clojure.test tests (integrated into Gradle's Test task)
  • Running an nREPL server (supports custom middlewares or handler)

ClojureScript Features

NOTE: ClojureScript features are pretty new, so let us know if you run into issues or have ideas for improvement.

  • Packaging Clojure code (or compiled JS) into a JAR or ZIP
  • ClojureScript compilation (multiple builds supported)
  • Figwheel (via figwheel.main)

Why should 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

Create a new Clojure library:

clj -X:new :template clojurephant-clj-lib :name myname/mylib

Create a new Clojure application:

clj -X:new :template clojurephant-clj-app :name myname/myapp

Create a new ClojureScript appliation:

clj -X:new :template clojurephant-cljs-app :name myname/myapp

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 "dev.clojurephant.clojure" version "<version>"
}

// You need to add clojars for the plugin to work.
repositories {
  maven {
    name = 'Clojars' // name can be ommitted, but is helpful in troubleshooting
    url = 'https://repo.clojars.org/'
  }
}

dependencies {
  // requires a version of Clojure with prepl (1.10+)
  implementation 'org.clojure:clojure:1.10.1'
  // and any other dependencies you want on the compile classpath
  // implementation 'group:artifact:version'

  // needed for test integration
  testRuntimeOnly 'org.ajoberstar:jovial:0.3.0'
  // and any other test-specific dependencies
  // testImplementation 'group:artifact:version'

  // dependencies for REPL use only
  devImplementation 'org.clojure:tools.namespace:1.1.0'
}

// needed for test integration
tasks.withType(Test) {
  useJUnitPlatform()
}

See all available options in the docs.

Getting help

Read the online Clojurephant documentation https://clojurephant.dev.

For questions or support, please visit the Clojurephant Discussions, ClojureVerse gradle-clojure channel or the Clojurian's Slack #gradle channel

For bug reports and feature requests, please use the repo's issues.

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).

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

Thanks to all our contributors.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap