sbt/sbt-slash

Name: sbt-slash

Owner: sbt

Description: unified slash syntax for both shell and build.sbt

Created: 2017-06-26 13:20:23.0

Updated: 2017-08-15 05:58:45.0

Pushed: 2017-06-26 13:36:54.0

Homepage: null

Size: 142

Language: Scala

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

sbt-slash

sbt-slash is a sbt plugin that introduces unified slash syntax to both the sbt shell and build.sbt. See also Unification of sbt shell notation and build.sbt DSL

slash

setup

This is an auto plugin, so you need sbt 0.13.5+. Put this in project/plugins.sbt or ~/.sbt/0.13/plugins/slash.sbt:

btPlugin("com.eed3si9n" % "sbt-slash" % "0.1.0")
usage

In addition to the current parser, this plugin adds <project-id>/<config-ident>/intask/key where <config-ident> is the Scala identifier notation for the configurations like Compile and Test.

These examples work both from the shell

ow Global/cancelable
isBuild/scalaVersion
st/compile
ot/Compile/compile/scalacOptions

The output of the inspect command is copy-pastable

spect compile
o] Task: sbt.inc.Analysis
o] Description:
o]  Compiles sources.
o] Provided by:
o]  {file:/xxx/}hellotest/compile:compile
o] Defined at:
o]  (sbt.Defaults) Defaults.scala:327
o] Dependencies:
o]  Compile/manipulateBytecode
o]  Compile/incCompileSetup
o] Reverse dependencies:
o]  Compile/products
o]  Compile/printWarnings
o]  Compile/discoveredSbtPlugins
o]  Compile/discoveredMainClasses
o] Delegates:
o]  Compile/compile
o]  compile
o]  ThisBuild/Compile/compile
o]  ThisBuild/compile
o]  Zero/Compile/compile
o]  Global/compile
o] Related:
o]  Test/compile

The unified slash syntax also works in build.sbt

 val root = (project in file("."))
ettings(
Global / cancelable := true,
ThisBuild / scalaVersion := "2.11.11",
Test / test := (),
Compile / scalacOptions += "-deprecation",
Compile / console / scalacOptions += "-Ywarn-numeric-widen"

notes

If this syntax is proven to be useful, we intend to introduce this as part of sbt in the future.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.