Ho un po 'di problemi a cercare di capire come impostare/aggiungere a scalacOptions
utilizzato da SBT quando si compila Build.scala
. Qualcuno nella mia squadra ha copiato un po 'di codice da Akka Build.scala
e il risultato è stato un po' di avvertimenti obsoleti e un avviso di funzionalità.Come impostare le scalacOptions utilizzate da SBT durante la compilazione di Build.scala?
$ reload
[info] Loading global plugins from /Users/xxx/.sbt/0.13/plugins
[info] Loading project definition from /Users/xxx/yyy/zzz/project
[info] Compiling 1 Scala source to /Users/xxx/yyy/zzz/project/target/scala-2.10/sbt-0.13/classes...
[warn] there were 3 deprecation warning(s); re-run with -deprecation for details
[warn] there were 1 feature warning(s); re-run with -feature for details
[warn] two warnings found
Le cose che ho provato
- Aggiungi
scalacOptions ++= Seq("-unchecked", "-feature")
-build.sbt
. Speravo che questo sarebbe stato caricato prima della compilazione diBuild.scala
. - già avuto
scalacOptions ++= Seq(...., "-unchecked", "-feature")
inBuild.scala
Tentativo di impostare
scalacOptions
primareload
ma sembra essere scartata$ ;set scalacOptions ++= Seq("-feature", "-deprecated") ;reload [info] Defining zzz/*:scalacOptions [info] The new value will be used by zzz/compile:scalacOptions [info] Reapplying settings... [info] Set current project to zzz (in build file:/Users/xxx/yyy/zzz/) [info] Loading global plugins from /Users/xxx/.sbt/0.13/plugins [info] Loading project definition from /Users/xxx/yyy/zzz/project [info] Compiling 1 Scala source to /Users/xxx/yyy/zzz/project/target/scala-2.10/sbt-0.13/classes... [warn] there were 3 deprecation warning(s); re-run with -deprecation for details [warn] there were 1 feature warning(s); re-run with -feature for details [warn] two warnings found [warn] Discarding 1 session setting. Use 'session save' to persist session settings.
Attraverso tanto sudore di sangue sono stato in grado di trovare la causa delle avvertenze deprecato , ma non riesco a trovare la causa dell'avviso di funzionalità.
Ho avuto 'build.sbt' nel posto sbagliato. Questo ha funzionato quando ho spostato 'build.sbt' dalla directory root a' project/build.sbt' – drstevens
@drstevens hai ragione, dovrebbe essere in 'project/build.sbt', ho aggiornato la mia risposta. Se si volesse creare 'Build.scala', si dovrebbe crearne uno in' project/project/Build.scala'. – lpiepiora