Project setup
authorTomas Zeman <tzeman@volny.cz>
Thu, 08 Nov 2018 19:01:57 +0100
changeset 1 5a1fe2302fb4
parent 0 5097819c6d3e
child 2 eb0fb99d0289
Project setup
build.sc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build.sc	Thu Nov 08 19:01:57 2018 +0100
@@ -0,0 +1,83 @@
+import java.io.File
+
+import ammonite.ops._
+import coursier.maven.MavenRepository
+import mill._
+import mill.define.{Command, Input, Sources, Target}
+import mill.scalajslib._
+import mill.scalalib._
+import mill.scalalib.publish._
+
+import scala.sys
+
+val appVersion = "18.12-SNAPSHOT"
+
+val scalaJsVer = "0.6.25"
+val scalaVer = "2.12.7"
+val akkaVer = "2.4.20"
+
+trait Common extends ScalaModule with PublishModule {
+  val scalaVersion = scalaVer
+
+  def publishVersion = appVersion 
+
+  def pomSettings = PomSettings(
+    description = "Content management system for SQWL",
+    organization = "net.tz",
+    url = "http://kvalitapracovnihozivota.vubp.cz",
+    licenses = Seq(License.`Apache-2.0`),
+    versionControl = VersionControl(developerConnection = Some(
+      "ssh://hg@bitbucket.org/tzeman/sqwl-cms")),
+    developers = Seq(
+      Developer("tzeman", "Tomas Zeman", "")
+    )
+  )
+
+  override def artifactName = T{
+    super.artifactName.map(_.flatMap(c =>
+      if (c.isUpper) Seq('-', c.toLower) else Seq(c) ))
+  }
+
+  override def scalacOptions = T{Seq(
+    "-deprecation",                      // Emit warning and location for usages of deprecated APIs.
+    "-encoding", "utf-8",                // Specify character encoding used by source files.
+    "-explaintypes",                     // Explain type errors in more detail.
+    "-feature",                          // Emit warning and location for usages of features that should be imported explicitly.
+    "-language:higherKinds",             // Allow higher-kinded types
+    "-language:implicitConversions",     // Allow definition of implicit functions called views
+    "-language:reflectiveCalls",
+    "-language:postfixOps",
+    "-unchecked",                        // Enable additional warnings where generated code depends on assumptions.
+    "-Xcheckinit",                       // Wrap field accessors to throw an exception on uninitialized access.
+    "-Xfuture",                          // Turn on future language features.
+    "-target:jvm-1.8",
+    "--illegal-access=warn"
+  )}
+}
+
+object jvm extends Common {
+  override def scalacPluginIvyDeps = super.scalacPluginIvyDeps() ++ Agg(
+    ivy"org.scalamacros:::paradise:2.1.0"
+  )
+
+  override def ivyDeps = Agg(
+    ivy"com.wacai::config-annotation:0.3.6",
+    ivy"de.heikoseeberger::akka-http-json4s:1.22.0",
+    ivy"com.typesafe.akka::akka-slf4j:$akkaVer",
+    ivy"org.json4s::json4s-native:3.6.2",
+    ivy"ch.qos.logback:logback-classic:1.2.3"
+  )
+
+  override def scalacOptions = T{super.scalacOptions.map(_ :+
+    "-Xmacro-settings:conf.output.dir=jvm/src/main/resources"
+  )}
+
+  override def mainClass = Some("sqwl.cms.Server")
+
+}
+
+object js extends Common with ScalaJSModule {
+  def scalaJSVersion: Target[String] = scalaJsVer
+}
+
+// vim: et ts=2 sw=2 syn=scala