Skip to content

Instantly share code, notes, and snippets.

@kailuowang
Created April 2, 2019 17:19
Show Gist options
  • Save kailuowang/5d8ae9c8b6c7a19946e2c558ab9736b3 to your computer and use it in GitHub Desktop.
Save kailuowang/5d8ae9c8b6c7a19946e2c558ab9736b3 to your computer and use it in GitHub Desktop.
min example of failed ++2.11.12 commandAlias
import Dependencies._
ThisBuild / scalaVersion := "2.12.8"
ThisBuild / version := "0.1.0-SNAPSHOT"
ThisBuild / organization := "com.example"
ThisBuild / organizationName := "example"
lazy val root = (project in file("."))
.aggregate(mA, mB)
.settings(
crossScalaVersions := Nil,
name := "crossCmd",
libraryDependencies += scalaTest % Test
)
lazy val mA = project.settings(crossScalaVersions := Seq("2.11.12"))
lazy val mB = project.settings(crossScalaVersions := Seq("2.11.12"))
addCommandAlias("validate", "test")
@kailuowang
Copy link
Author

kailuowang commented Apr 2, 2019

validate is just an alias of test

sbt "++2.11.12 test" works as expected but
sbt "++2.11.12 validate" throws

[error] Expected configuration
[error] Expected ':'
[error] Expected key
[error] Not a valid key: validate (similar: ivyValidate, update, evicted)
[error] all mA/validate mB/validate

also sbt ++2.11.12 test (without the quote), actually will run tests on root module, which is sort of surprising, although I can understand why it was that way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment