GithubHelp home page GithubHelp logo

isabella232 / sbt-slash Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sbt/sbt-slash

0.0 0.0 0.0 142 KB

unified slash syntax for both shell and build.sbt

License: Apache License 2.0

Scala 100.00%

sbt-slash's Introduction

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:

addSbtPlugin("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

> show Global/cancelable
> ThisBuild/scalaVersion
> Test/compile
> root/Compile/compile/scalacOptions

The output of the inspect command is copy-pastable

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

The unified slash syntax also works in build.sbt

lazy val root = (project in file("."))
  .settings(
    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.

sbt-slash's People

Contributors

eed3si9n avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.