Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the first semicolon in `addCommandAlias` method used for in SBT?

For example, I have to write an alias like this:

addCommandAlias("make-idea", ";updateClassifiers; updateSbtClassifiers; gen-idea sbt-classifiers")

Instead of

addCommandAlias("make-idea", "updateClassifiers; updateSbtClassifiers; gen-idea sbt-classifiers")

If I skip the first semicolon, sbt will complain.. Does anyone have ideas about what does the first ; in the second argument of addCommandAlias do?

like image 216
Hanfei Sun Avatar asked Dec 16 '14 07:12

Hanfei Sun


People also ask

What is sbt command?

The simple build tool (sbt) is used for building Java and Scala projects; its purpose is to allow users to skillfully perform the basics of building and to customize endlessly.

How do I clear my sbt cache?

You can use Pretty Clean to clean the all of dev tools caches including SBT. PrettyClean also cleans the SBT project's target folder.

What sbt version do I have?

Running the command, "sbt sbt-version" will simply output your current directory and the version number.


1 Answers

This is just sbt's syntax to specify multiple commands. This is normal sbt CLI behavior and is not specific to addCommandAlias.

The same happens in the sbt shell:

sbt> updateClassifiers; updateSbtClassifiers; gen-idea sbt-classifiers
[error] Expected ID character
// etc.

sbt> ; updateClassifiers; updateSbtClassifiers; gen-idea sbt-classifiers
// as expected
like image 91
gzm0 Avatar answered Sep 19 '22 04:09

gzm0