build.sc
changeset 0 a3f8b52a99ca
child 2 b2f4b60986c8
equal deleted inserted replaced
-1:000000000000 0:a3f8b52a99ca
       
     1 import mill._
       
     2 import mill.api.Loose
       
     3 import mill.define.Target
       
     4 import mill.scalajslib._
       
     5 import mill.scalalib._
       
     6 import mill.scalalib.publish._
       
     7 
       
     8 object V {
       
     9   val visjs = "0.1-SNAPSHOT"
       
    10   val scalaJs = "0.6.28"
       
    11   val scala211 = "2.11.12"
       
    12   val scala212 = "2.12.9"
       
    13 }
       
    14 
       
    15 object D {
       
    16   val scalaJsDom = ivy"org.scala-js::scalajs-dom::0.9.7"
       
    17 }
       
    18 
       
    19 class VisJs(val crossScalaVersion: String) extends CrossScalaModule with
       
    20   ScalaJSModule with PublishModule {
       
    21 
       
    22   override def artifactName: T[String] = "visjs"
       
    23 
       
    24   override def scalaJSVersion: Target[String] = V.scalaJs
       
    25 
       
    26   override def publishVersion: Target[String] = V.visjs
       
    27 
       
    28   override def pomSettings = PomSettings(
       
    29     description = "Scala.js library facade for vis.js",
       
    30     organization = "cz.functionals",
       
    31     url = "https://functionals.cz/project/visjs",
       
    32     licenses = Seq(License.`Apache-2.0`),
       
    33     versionControl = VersionControl(developerConnection = Some(
       
    34       "ssh://hg@functionals.cz/visjs")),
       
    35     developers = Seq(
       
    36       Developer("tzeman", "Tomas Zeman", "")
       
    37     )
       
    38   )
       
    39 
       
    40   override def scalacOptions = T{Seq(
       
    41     "-deprecation",                      // Emit warning and location for usages of deprecated APIs.
       
    42     "-encoding", "utf-8",                // Specify character encoding used by source files.
       
    43     "-explaintypes",                     // Explain type errors in more detail.
       
    44     "-feature",                          // Emit warning and location for usages of features that should be imported explicitly.
       
    45     "-language:higherKinds",             // Allow higher-kinded types
       
    46     "-language:implicitConversions",     // Allow definition of implicit functions called views
       
    47     "-language:reflectiveCalls",
       
    48     "-language:postfixOps",
       
    49     "-unchecked",                        // Enable additional warnings where generated code depends on assumptions.
       
    50     "-Xcheckinit",                       // Wrap field accessors to throw an exception on uninitialized access.
       
    51     "-Xfuture",                          // Turn on future language features.
       
    52     "-target:jvm-1.8",
       
    53     "-P:scalajs:sjsDefinedByDefault"
       
    54   )}
       
    55 
       
    56   override def ivyDeps: Target[Loose.Agg[Dep]] = Agg(D.scalaJsDom)
       
    57 
       
    58 }
       
    59 
       
    60 object visjs extends Cross[VisJs](V.scala211, V.scala212)
       
    61 
       
    62 // vim: et ts=2 sw=2 syn=scala