build.sc
changeset 1 5a1fe2302fb4
child 2 eb0fb99d0289
equal deleted inserted replaced
0:5097819c6d3e 1:5a1fe2302fb4
       
     1 import java.io.File
       
     2 
       
     3 import ammonite.ops._
       
     4 import coursier.maven.MavenRepository
       
     5 import mill._
       
     6 import mill.define.{Command, Input, Sources, Target}
       
     7 import mill.scalajslib._
       
     8 import mill.scalalib._
       
     9 import mill.scalalib.publish._
       
    10 
       
    11 import scala.sys
       
    12 
       
    13 val appVersion = "18.12-SNAPSHOT"
       
    14 
       
    15 val scalaJsVer = "0.6.25"
       
    16 val scalaVer = "2.12.7"
       
    17 val akkaVer = "2.4.20"
       
    18 
       
    19 trait Common extends ScalaModule with PublishModule {
       
    20   val scalaVersion = scalaVer
       
    21 
       
    22   def publishVersion = appVersion 
       
    23 
       
    24   def pomSettings = PomSettings(
       
    25     description = "Content management system for SQWL",
       
    26     organization = "net.tz",
       
    27     url = "http://kvalitapracovnihozivota.vubp.cz",
       
    28     licenses = Seq(License.`Apache-2.0`),
       
    29     versionControl = VersionControl(developerConnection = Some(
       
    30       "ssh://hg@bitbucket.org/tzeman/sqwl-cms")),
       
    31     developers = Seq(
       
    32       Developer("tzeman", "Tomas Zeman", "")
       
    33     )
       
    34   )
       
    35 
       
    36   override def artifactName = T{
       
    37     super.artifactName.map(_.flatMap(c =>
       
    38       if (c.isUpper) Seq('-', c.toLower) else Seq(c) ))
       
    39   }
       
    40 
       
    41   override def scalacOptions = T{Seq(
       
    42     "-deprecation",                      // Emit warning and location for usages of deprecated APIs.
       
    43     "-encoding", "utf-8",                // Specify character encoding used by source files.
       
    44     "-explaintypes",                     // Explain type errors in more detail.
       
    45     "-feature",                          // Emit warning and location for usages of features that should be imported explicitly.
       
    46     "-language:higherKinds",             // Allow higher-kinded types
       
    47     "-language:implicitConversions",     // Allow definition of implicit functions called views
       
    48     "-language:reflectiveCalls",
       
    49     "-language:postfixOps",
       
    50     "-unchecked",                        // Enable additional warnings where generated code depends on assumptions.
       
    51     "-Xcheckinit",                       // Wrap field accessors to throw an exception on uninitialized access.
       
    52     "-Xfuture",                          // Turn on future language features.
       
    53     "-target:jvm-1.8",
       
    54     "--illegal-access=warn"
       
    55   )}
       
    56 }
       
    57 
       
    58 object jvm extends Common {
       
    59   override def scalacPluginIvyDeps = super.scalacPluginIvyDeps() ++ Agg(
       
    60     ivy"org.scalamacros:::paradise:2.1.0"
       
    61   )
       
    62 
       
    63   override def ivyDeps = Agg(
       
    64     ivy"com.wacai::config-annotation:0.3.6",
       
    65     ivy"de.heikoseeberger::akka-http-json4s:1.22.0",
       
    66     ivy"com.typesafe.akka::akka-slf4j:$akkaVer",
       
    67     ivy"org.json4s::json4s-native:3.6.2",
       
    68     ivy"ch.qos.logback:logback-classic:1.2.3"
       
    69   )
       
    70 
       
    71   override def scalacOptions = T{super.scalacOptions.map(_ :+
       
    72     "-Xmacro-settings:conf.output.dir=jvm/src/main/resources"
       
    73   )}
       
    74 
       
    75   override def mainClass = Some("sqwl.cms.Server")
       
    76 
       
    77 }
       
    78 
       
    79 object js extends Common with ScalaJSModule {
       
    80   def scalaJSVersion: Target[String] = scalaJsVer
       
    81 }
       
    82 
       
    83 // vim: et ts=2 sw=2 syn=scala