Project skeleton
authorTomas Zeman <tomas@functionals.cz>
Wed, 28 Aug 2019 20:56:00 +0200
changeset 0 a3f8b52a99ca
child 1 b9c54a82f3db
Project skeleton
.hgignore
build.sc
mill
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgignore	Wed Aug 28 20:56:00 2019 +0200
@@ -0,0 +1,8 @@
+syntax: glob
+*~
+.*.swp
+lib_managed
+tags
+.idea
+out
+.idea_modules
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build.sc	Wed Aug 28 20:56:00 2019 +0200
@@ -0,0 +1,62 @@
+import mill._
+import mill.api.Loose
+import mill.define.Target
+import mill.scalajslib._
+import mill.scalalib._
+import mill.scalalib.publish._
+
+object V {
+  val visjs = "0.1-SNAPSHOT"
+  val scalaJs = "0.6.28"
+  val scala211 = "2.11.12"
+  val scala212 = "2.12.9"
+}
+
+object D {
+  val scalaJsDom = ivy"org.scala-js::scalajs-dom::0.9.7"
+}
+
+class VisJs(val crossScalaVersion: String) extends CrossScalaModule with
+  ScalaJSModule with PublishModule {
+
+  override def artifactName: T[String] = "visjs"
+
+  override def scalaJSVersion: Target[String] = V.scalaJs
+
+  override def publishVersion: Target[String] = V.visjs
+
+  override def pomSettings = PomSettings(
+    description = "Scala.js library facade for vis.js",
+    organization = "cz.functionals",
+    url = "https://functionals.cz/project/visjs",
+    licenses = Seq(License.`Apache-2.0`),
+    versionControl = VersionControl(developerConnection = Some(
+      "ssh://hg@functionals.cz/visjs")),
+    developers = Seq(
+      Developer("tzeman", "Tomas Zeman", "")
+    )
+  )
+
+  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",
+    "-P:scalajs:sjsDefinedByDefault"
+  )}
+
+  override def ivyDeps: Target[Loose.Agg[Dep]] = Agg(D.scalaJsDom)
+
+}
+
+object visjs extends Cross[VisJs](V.scala211, V.scala212)
+
+// vim: et ts=2 sw=2 syn=scala
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mill	Wed Aug 28 20:56:00 2019 +0200
@@ -0,0 +1,37 @@
+#!/usr/bin/env sh
+
+# This is a wrapper script, that automatically download mill from GitHub release pages
+# You can give the required mill version with MILL_VERSION env variable
+# If no version is given, it falls back to the value of DEFAULT_MILL_VERSION
+DEFAULT_MILL_VERSION=0.5.0
+
+set -e
+
+if [ -z "$MILL_VERSION" ] ; then
+  if [ -f ".mill-version" ] ; then
+    MILL_VERSION="$(head -n 1 .mill-version 2> /dev/null)"
+  elif [ -f "mill" ] && [ "$BASH_SOURCE" != "mill" ] ; then
+    MILL_VERSION=$(grep -F "DEFAULT_MILL_VERSION=" "mill" | head -n 1 | cut -d= -f2)
+  else
+    MILL_VERSION=$DEFAULT_MILL_VERSION
+  fi
+fi
+
+MILL_DOWNLOAD_PATH="$HOME/.mill/download"
+MILL_EXEC_PATH="${MILL_DOWNLOAD_PATH}/$MILL_VERSION"
+
+if [ ! -x "$MILL_EXEC_PATH" ] ; then
+  mkdir -p $MILL_DOWNLOAD_PATH
+  DOWNLOAD_FILE=$MILL_EXEC_PATH-tmp-download
+  MILL_DOWNLOAD_URL="https://github.com/lihaoyi/mill/releases/download/${MILL_VERSION%%-*}/$MILL_VERSION-assembly"
+  curl --fail -L -o "$DOWNLOAD_FILE" "$MILL_DOWNLOAD_URL"
+  chmod +x "$DOWNLOAD_FILE"
+  mv "$DOWNLOAD_FILE" "$MILL_EXEC_PATH"
+  unset DOWNLOAD_FILE
+  unset MILL_DOWNLOAD_URL
+fi
+
+unset MILL_DOWNLOAD_PATH
+unset MILL_VERSION
+
+exec $MILL_EXEC_PATH "$@"