Skip to content

Commit 3d5fd55

Browse files
committed
Empty solution w/ dependencies
1 parent a406bb7 commit 3d5fd55

File tree

11 files changed

+141
-1
lines changed

11 files changed

+141
-1
lines changed

.gitignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Scala and SBT
2+
dist/*
3+
target/
4+
lib_managed/
5+
src_managed/
6+
project/boot/
7+
project/plugins/project/
8+
.history
9+
.cache
10+
.lib/
11+
*.class
12+
*.log
13+
14+
# IntelliJ
15+
.idea
16+
17+
# Vagrant
18+
.vagrant
19+
*.log

.java-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.8

.jvmopts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
-Dfile.encoding=UTF8
2+
-Xms3784m
3+
-Xmx3784m
4+
-XX:MaxMetaspaceSize=1g
5+
-Xss4m

.scalafix.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
rules = [
2+
RemoveUnused
3+
ExplicitResultTypes
4+
]

.scalafmt.conf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
align = most
2+
maxColumn = 120
3+
lineEndings = windows
4+
danglingParentheses = true
5+
assumeStandardLibraryStripMargin = true
6+
rewrite.rules = [
7+
SortImports,
8+
AvoidInfix,
9+
RedundantParens,
10+
RedundantBraces,
11+
SortModifiers,
12+
PreferCurlyFors
13+
]

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1-
# lastminute-fp-workshop
1+
# lastminute-fp-workshop
2+
3+
### Scala Standard Library
4+
[https://www.scala-lang.org/api/current/](https://www.scala-lang.org/api/current/)
5+
6+
### Monix Minitest
7+
[https://github.com/monix/minitest](https://github.com/monix/minitest)
8+
9+
10+

build.sbt

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
lazy val global = project
2+
.in(file("."))
3+
.settings(settings)
4+
.aggregate(day1)
5+
6+
lazy val day1 = project
7+
.settings(
8+
name := "day1",
9+
settings
10+
)
11+
12+
lazy val settings = Seq(
13+
organization := "io.doubleloop",
14+
scalaVersion := "2.12.7",
15+
version := "0.1.0-SNAPSHOT",
16+
scalacOptions ++= scalacSettings,
17+
resolvers ++= resolversSettings,
18+
libraryDependencies ++= libsSettings,
19+
scalafmtOnCompile := true,
20+
testFrameworks += new TestFramework("minitest.runner.Framework"),
21+
addCompilerPlugin("com.olegpy" %% "better-monadic-for" % "0.2.4"),
22+
addCompilerPlugin("org.spire-math" %% "kind-projector" % "0.9.8"),
23+
addCompilerPlugin(("org.scalamacros" % "paradise" % "2.1.0").cross(CrossVersion.full)),
24+
addCompilerPlugin(scalafixSemanticdb)
25+
)
26+
27+
lazy val scalacSettings = Seq(
28+
"-encoding",
29+
"UTF-8",
30+
"-deprecation",
31+
"-unchecked",
32+
"-feature",
33+
"-language:existentials",
34+
"-language:higherKinds",
35+
"-language:implicitConversions",
36+
"-Ypartial-unification",
37+
"-Yrangepos",
38+
"-Xlint",
39+
"-Yno-adapted-args",
40+
"-Ywarn-numeric-widen",
41+
"-Ywarn-value-discard",
42+
"-Xfuture",
43+
"-Ywarn-unused-import"
44+
)
45+
46+
lazy val resolversSettings = Seq(
47+
Resolver.sonatypeRepo("public"),
48+
Resolver.sonatypeRepo("snapshots"),
49+
Resolver.sonatypeRepo("releases")
50+
)
51+
52+
lazy val monocleVersion = "1.5.1-cats"
53+
54+
lazy val libsSettings = Seq(
55+
"org.typelevel" %% "cats-core" % "1.4.0",
56+
"org.typelevel" %% "cats-effect" % "1.0.0",
57+
"org.typelevel" %% "cats-mtl-core" % "0.2.3",
58+
"com.github.julien-truffaut" %% "monocle-core" % monocleVersion,
59+
"com.github.julien-truffaut" %% "monocle-macro" % monocleVersion,
60+
"net.debasishg" %% "redisclient" % "3.7",
61+
"com.github.mpilquist" %% "simulacrum" % "0.13.0",
62+
"io.monix" %% "minitest" % "2.1.1" % Test
63+
)

day1/src/main/scala/Main.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package day1
2+
3+
object Main {
4+
def main(args: Array[String]) =
5+
print("ciao!")
6+
}

day1/src/test/scala/MainTests.scala

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package day1
2+
3+
import minitest._
4+
5+
import java.io.ByteArrayOutputStream
6+
7+
object MainTests extends SimpleTestSuite {
8+
9+
test("it works!") {
10+
val out = new ByteArrayOutputStream
11+
Console.withOut(out) {
12+
Main.main(Array())
13+
}
14+
assertEquals(out.toString, "ciao!")
15+
}
16+
}

project/build.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sbt.version=1.2.3

0 commit comments

Comments
 (0)