Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run sbt multiple command in interactive mode as one command? [duplicate]

Tags:

scala

sbt

I want to refine sbt assembly/package operation by combine two step to one. The two step is:

$ sbt > project XXX .... > assembly Ctrl + c to exit 

Besides, assembly is a task form fat jar sbt plugin.
I have attempt with sbt project analysis assembly but not works.A error encounter:

[error] Not a valid command: analysis (similar: alias) [error] Not a valid key: analysis (similar: readAnalysis, mainClass, less) [error] analysis [error]         ^ 

How to achieve this?Thanks

like image 792
LoranceChen Avatar asked Apr 11 '17 09:04

LoranceChen


People also ask

What does sbt clean do?

clean Deletes all generated files (in the target directory). compile Compiles the main sources (in src/main/scala and src/main/java directories). test Compiles and runs all tests. console Starts the Scala interpreter with a classpath including the compiled sources and all dependencies.


1 Answers

Within the sbt shell, use ; to chain commands:

;project XXX; assembly 

Calling from the command line, enclose individual commands with quotes:

sbt "project XXX" assembly 

or enclose a whole chain in quotes:

sbt ";project XXX; assembly" 

To call a task in subproject XXX from the context of another project in the shell:

XXX/assembly 
like image 132
Justin Kaeser Avatar answered Sep 25 '22 05:09

Justin Kaeser