what does a single colon mean in sbt (between two commands)

允我心安 提交于 2020-04-16 08:00:19

问题


In a .travis.yml file using sbt, I see this

script:
  - sbt ++$TRAVIS_SCALA_VERSION test:fastOptJS test:fullOptJS

In sbt, I can run test, and I can run fastOptJS . What does the single colon between them do?

In travis, can one run a sequence of commands? ie. what does it mean for test:fastOptJS to be followed by test:fullOptJS?


回答1:


In sbt, I can run test, and I can run fastOptJS . What does the single colon between them do?

test:fastOptJS means fastOptJS in test scope. The confusion comes from the fact that the test scope and the test task are both test in sbt's shell.

This, btw, is fixed in sbt 1.1's new "unified slash syntax" where the test scope now Test, so test:fastOptJS is now Test / fastOptJS.

In travis, can one run a sequence of commands? ie. what does it mean for test:fastOptJS to be followed by test:fullOptJS?

Yes you can run a sequence of commands.

sbt ++$TRAVIS_SCALA_VERSION test:fastOptJS test:fullOptJS means run ++$TRAVIS_SCALA_VERSION (which changes scalaVersion), then test:fastOptJS then test:fullOptJS.



来源:https://stackoverflow.com/questions/48322013/what-does-a-single-colon-mean-in-sbt-between-two-commands

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!