Skip to content

Commit

Permalink
mill build.sc, cats 1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Maciej Kowalski committed Mar 11, 2019
1 parent 27aef9e commit 7b47f86
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# Simple Build Tool
# http://www.scala-sbt.org/release/docs/Getting-Started/Directories.html#configuring-version-control

.idea_modules/
.idea/
dist/*
target/
Expand Down
3 changes: 2 additions & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
version = "2.0.0-RC4"
#
# See http://scalameta.org/scalafmt/#Configuration for details
#
Expand Down Expand Up @@ -78,4 +79,4 @@ rewrite {
# if your for has more than one single <- then it gets transformed into a multit-line curly brace one
# PreferCurlyFors
]
}
}
11 changes: 5 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat

buildscript {
dependencies {
classpath("cz.alenkacz:gradle-scalafmt:1.7.0")
classpath("cz.alenkacz:gradle-scalafmt:1.8.0")
}
}

Expand All @@ -11,7 +11,7 @@ plugins {
scala
application
id("maven-publish")
id("com.github.maiflai.scalatest") version "0.23"
id("com.github.maiflai.scalatest") version "0.24"
}

apply(plugin = "scalafmt")
Expand Down Expand Up @@ -41,13 +41,13 @@ dependencies {
compile(group = "org.springframework.boot", name = "spring-boot-starter-webflux", version = "2.1.0.RELEASE")
compile(group = "com.fasterxml.jackson.module", name = "jackson-module-scala_"+scalaVersion, version = "2.9.8")

compile(group = "org.typelevel", name = "cats-core_"+scalaVersion, version = "1.5.0")
compile(group = "org.typelevel", name = "cats-core_"+scalaVersion, version = "1.6.0")
compile(group = "com.chuusai", name = "shapeless_"+scalaVersion, version = "2.3.3")
compile(group = "com.github.mpilquist", name = "simulacrum_"+scalaVersion, version = "0.15.0")

// compile("org.scala-lang:scala-compiler:2.12.8"
// testCompile(group = "com.lihaoyi", name = "ammonite_2.12.8", version = "1.6.0"
testCompile(group = "org.scalatest", name = "scalatest_"+scalaVersion, version = "3.0.6-SNAP5")
testCompile(group = "org.scalatest", name = "scalatest_"+scalaVersion, version = "3.0.7-RC1")
testRuntime(group = "org.pegdown", name = "pegdown", version = "1.6.0")
}

Expand All @@ -58,7 +58,6 @@ tasks.withType<JavaCompile> {
}

tasks.withType<ScalaCompile> {
// scalaCompileOptions.deprecation = false
scalaCompileOptions.additionalParameters = listOf(
// @see https://tpolecat.github.io/2017/04/25/scalac-flags.html
"-deprecation", // Emit warning and location for usages of deprecated APIs.
Expand Down Expand Up @@ -128,5 +127,5 @@ tasks.withType<Test> {
//}

tasks.withType<Wrapper> {
gradleVersion = "5.1"
gradleVersion = "5.2.1"
}
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ resolvers += Resolver.sonatypeRepo("snapshots")

scalaVersion := "2.13.0-M5"

val catsVersion = "1.5.0"
val catsVersion = "1.6.0"

libraryDependencies ++= Seq(
"org.typelevel" %% "cats-core" % catsVersion,
Expand Down
69 changes: 69 additions & 0 deletions build.sc
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import mill._, scalalib._, scalafmt._

object spring extends ScalaModule with ScalafmtModule {
override def scalaVersion = "2.13.0-M5"

override def sources = T.sources { millSourcePath / os.up / 'src / 'main / 'scala }

override def mainClass = Some("fp.spring.spring4.UserApp")

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:existentials", // Existential types (besides wildcard types) can be written and inferred
"-language:experimental.macros", // Allow macro definition (besides implementation and application)
"-language:higherKinds", // Allow higher-kinded types
"-language:implicitConversions", // Allow definition of implicit functions called views
"-unchecked", // Enable additional warnings where generated code depends on assumptions.
"-Xcheckinit", // Wrap field accessors to throw an exception on uninitialized access.
// "-Xfatal-warnings", // Fail the compilation if there are any warnings.
"-Xfuture", // Turn on future language features.
"-Xlint:adapted-args", // Warn if an argument list is modified to match the receiver.
"-Xlint:constant", // Evaluation of a constant arithmetic expression results in an error.
"-Xlint:delayedinit-select", // Selecting member of DelayedInit.
"-Xlint:doc-detached", // A Scaladoc comment appears to be detached from its element.
"-Xlint:inaccessible", // Warn about inaccessible types in method signatures.
"-Xlint:infer-any", // Warn when a type argument is inferred to be `Any`.
"-Xlint:missing-interpolator", // A string literal appears to be missing an interpolator id.
"-Xlint:nullary-override", // Warn when non-nullary `def f()' overrides nullary `def f'.
"-Xlint:nullary-unit", // Warn when nullary methods return Unit.
"-Xlint:option-implicit", // Option.apply used implicit view.
"-Xlint:package-object-classes", // Class or object defined in package object.
"-Xlint:poly-implicit-overload", // Parameterized overloaded implicit methods are not visible as view bounds.
"-Xlint:private-shadow", // A private field (or class parameter) shadows a superclass field.
"-Xlint:stars-align", // Pattern sequence wildcard must align with sequence component.
"-Xlint:type-parameter-shadow", // A local type parameter shadows a type already in scope.
// "-Ywarn-dead-code", // Warn when dead code is identified.
"-Ywarn-extra-implicit", // Warn when more than one implicit parameter section is defined.
"-Ywarn-numeric-widen", // Warn when numerics are widened.
// "-Ywarn-unused:implicits", // Warn if an implicit parameter is unused.
// "-Ywarn-unused:imports", // Warn if an import selector is not referenced.
"-Ywarn-unused:locals", // Warn if a local definition is unused.
// "-Ywarn-unused:params", // Warn if a value parameter is unused.
"-Ywarn-unused:patvars", // Warn if a variable bound in a pattern is unused.
"-Ywarn-unused:privates", // Warn if a private member is unused.
"-Ywarn-value-discard", // Warn when non-Unit expression results are unused.
"-Ymacro-annotations" // enable simulacrum typeclass annotations only in 2.13
)}

override def ivyDeps = Agg(
ivy"org.springframework.boot:spring-boot-starter-webflux:2.1.0.RELEASE",
ivy"com.fasterxml.jackson.module::jackson-module-scala:2.9.8",

ivy"org.typelevel::cats-core:1.6.0",
ivy"com.chuusai::shapeless:2.3.3",
ivy"com.github.mpilquist::simulacrum:0.15.0",
)

object test extends Tests {
def testFrameworks = T { Seq("org.scalatest.tools.Framework") }

override def sources = T.sources { millSourcePath / os.up / os.up / 'src / 'test / 'scala }

override def ivyDeps = Agg(
ivy"org.scalatest::scalatest:3.0.7-RC1"
)
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 7b47f86

Please sign in to comment.