Merge pull request #237 from indrajitr/default-options

Default set of opt-ins for convenience
This commit is contained in:
Mark Harrah 2011-10-23 10:44:31 -07:00
commit 0849d61da4
1 changed files with 32 additions and 0 deletions

32
main/Opts.scala Normal file
View File

@ -0,0 +1,32 @@
/* sbt -- Simple Build Tool
* Copyright 2011 Mark Harrah, Indrajit Raychaudhuri
*/
package sbt
/** Options for well-known tasks. */
object Opts {
object compile {
val deprecation = "-deprecation"
def encoding(enc: String) = Seq("-encoding", enc)
val explaintypes = "-explaintypes"
val nowarn = "-nowarn"
val optimise = "-optimise"
val unchecked = "-unchecked"
val verbose = "-verbose"
}
object doc {
def generator(g: String) = Seq("-doc-generator", g)
def sourceUrl(u: String) = Seq("-doc-source-url", u)
def title(t: String) = Seq("-doc-title", t)
def version(v: String) = Seq("-doc-version", v)
}
}
object DefaultOptions {
import Opts._
import Path._
def javac: Seq[String] = compile.encoding("UTF-8")
def scalac: Seq[String] = compile.encoding("UTF-8")
def scaladoc(name: String, version: String): Seq[String] = doc.title(name) ++ doc.version(version)
def credentials: Credentials = Credentials(Path.userHome / ".ivy2" / ".credentials")
}