2016-06-07 96 views
0

的SBT任務在SBT控制檯的結果,這是可以做到show settingsKey查看例如設置的值:如何顯示在控制檯

> show resourceManaged 
[info] /Users/code/my_project/target/scala-2.11/resource_managed 

有沒有辦法爲任務做?那是在控制檯中執行並查看任務的結果?

回答

0

是的,您還可以在控制檯中使用show打印任務的結果。例如sbt 'show fullClasspath'或以sbt交互模式直接show fullClasspath

記住keys are scoped

範圍的關鍵符號的例子

  • fullClasspath指定只是一個鍵,所以默認範圍使用:當前項目,一鍵相關的配置,以及全球性的任務範圍。
  • test:fullClasspath指定配置,因此這是測試配置中的fullClasspath,其他兩個示波器軸的默認值爲。
  • *:fullClasspath指定全局配置,而不是默認配置。
  • doc :: fullClasspath指定作爲doc任務作用域的fullClasspath鍵,其中包含項目軸和配置軸的默認值。
  • {file:/ home/hp/checkout/hello /} default-aea33a/test:fullClasspath指定一個項目,{file:/ home/hp/checkout/hello /} default-aea33a,構建{file:/ home/hp/checkout/hello /},然後在構建default-aea33a的項目ID。還指定配置測試,但保留默認任務軸。
  • {file:/ home/hp/checkout/hello /}/test:fullClasspath將項目軸設置爲「整個構建」,其構建是{file:/ home/hp/checkout/hello /}。
  • {。}/test:fullClasspath將項目軸設置爲構建版本爲{。}的「整個構建」。 {。}可以用Scala代碼編寫ThisBuild。
  • {file:/ home/hp/checkout/hello /}/compile:doc :: fullClasspath設置所有三個示波器軸。

您可以使用inspect fullClasspath看到範圍爲相關在你的項目中的任務。