scala-news-reader

rss/atom news reader in scala

git clone https://9o.is/git/scala-news-reader.git

BuildSettings.scala

(1824B)


      1 import sbt._
      2 import sbt.Keys._
      3 
      4 import com.github.siasia.WebPlugin.{container, webSettings}
      5 import com.github.siasia.PluginKeys._
      6 import sbtbuildinfo.Plugin._
      7 import less.Plugin._
      8 import sbtbuildinfo.Plugin._
      9 import sbtclosure.SbtClosurePlugin._
     10 
     11 
     12 object BuildSettings {
     13   object Ver {
     14     val lift = "2.5-RC4"
     15     val lift_edition = "2.5"
     16     val jetty = "8.1.8.v20121106"
     17   }
     18 
     19   val buildTime = SettingKey[String]("build-time")
     20 
     21   val basicSettings = Defaults.defaultSettings ++ Seq(
     22     name := "joe-reader",
     23     version := "0.1.4-SNAPSHOT",
     24     organization := "Joe Reader",
     25     scanDirectories := Nil,
     26     scalaVersion := "2.10.0",
     27     resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/",
     28     scalacOptions <<= scalaVersion map { sv: String =>
     29       if (sv.startsWith("2.10."))
     30         Seq("-deprecation", "-unchecked", "-feature", "-language:postfixOps", "-language:implicitConversions")
     31       else
     32         Seq("-deprecation", "-unchecked")
     33     }
     34   )
     35 
     36   val liftAppSettings = basicSettings ++
     37     webSettings ++
     38     buildInfoSettings ++
     39     lessSettings ++
     40     closureSettings ++
     41     seq(
     42       buildTime := System.currentTimeMillis.toString,
     43 
     44       // build-info
     45       buildInfoKeys ++= Seq[BuildInfoKey](buildTime),
     46       buildInfoPackage := "com.joereader",
     47       sourceGenerators in Compile <+= buildInfo,
     48 
     49       // less
     50       (LessKeys.filter in (Compile, LessKeys.less)) := "*styles.less",
     51       (LessKeys.mini in (Compile, LessKeys.less)) := true,
     52 
     53       // closure
     54       (ClosureKeys.prettyPrint in (Compile, ClosureKeys.closure)) := false,
     55 
     56       // add managed resources, where less and closure publish to, to the webapp
     57       (webappResources in Compile) <+= (resourceManaged in Compile)
     58     )
     59 
     60   lazy val noPublishing = seq(
     61     publish := (),
     62     publishLocal := ()
     63   )
     64 }
     65