Skip to content

Commit b84bad4

Browse files
build: Add essential SBT structure for building and releasing
1 parent 4201cdf commit b84bad4

File tree

6 files changed

+101
-0
lines changed

6 files changed

+101
-0
lines changed

.scalafmt.conf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version = "2.0.1"
2+
3+
maxColumn = 140
4+
assumeStandardLibraryStripMargin = true
5+
continuationIndent.defnSite = 2
6+
align.arrowEnumeratorGenerator = true
7+
align.openParenCallSite = true
8+
align.openParenDefnSite = true
9+
rewrite.rules = [RedundantParens, RedundantBraces, SortImports, SortModifiers, PreferCurlyFors]
10+
includeNoParensInSelectChains = true
11+
lineEndings = preserve

.travis.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
sudo: false
2+
language: scala
3+
jdk: openjdk8
4+
scala:
5+
- 2.13.1
6+
7+
before_install:
8+
- git fetch --tags
9+
10+
stages:
11+
- name: test
12+
- name: release
13+
if: ((branch = master AND type = push) OR (tag IS present)) AND NOT fork
14+
15+
jobs:
16+
include:
17+
-
18+
name: test
19+
script: sbt test
20+
-
21+
name: formatting
22+
script: sbt scalafmtCheckAll
23+
# run ci-release only if previous stages passed
24+
- stage: release
25+
script: sbt ci-release
26+
27+
# These directories are cached to S3 at the end of the build
28+
cache:
29+
directories:
30+
- $HOME/.coursier
31+
- $HOME/.ivy2/cache
32+
- $HOME/.sbt/boot/
33+
- $HOME/.sbt/launchers
34+
35+
before_cache:
36+
# Tricks to avoid unnecessary cache updates
37+
- find $HOME/.sbt -name "*.lock" | xargs rm
38+
- find $HOME/.ivy2 -name "ivydata-*.properties" | xargs rm
39+
- rm -f $HOME/.ivy2/.sbt.ivy.lock

build.sbt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
ThisBuild / organization := "com.avast.server"
2+
ThisBuild / homepage := Some(url("https://github.com/avast/scala-server-toolkit"))
3+
ThisBuild / description := "Functional programming toolkit for building server applications in Scala."
4+
ThisBuild / licenses := Seq("MIT" -> url("https://raw.githubusercontent.com/avast/scala-server-toolkit/master/LICENSE"))
5+
ThisBuild / developers := List(Developer("jakubjanecek", "Jakub Janecek", "[email protected]", url("https://www.avast.com")))
6+
ThisBuild / scmInfo := Some(
7+
ScmInfo(url("https://github.com/avast/scala-server-toolkit"), "scm:git:[email protected]:avast/scala-server-toolkit.git")
8+
)
9+
10+
ThisBuild / scalaVersion := "2.13.1"
11+
ThisBuild / scalacOptions := ScalacOptions.default
12+
13+
lazy val commonSettings = Seq(
14+
libraryDependencies ++= Seq(
15+
compilerPlugin("org.typelevel" %% "kind-projector" % "0.10.3")
16+
),
17+
Test / publishArtifact := false
18+
)
19+
20+
lazy val root = (project in file("."))
21+
.settings(
22+
commonSettings,
23+
name := "scala-server-toolkit",
24+
publish / skip := true
25+
)

project/ScalacOptions.scala

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
object ScalacOptions {
2+
3+
val default: Seq[String] = Seq(
4+
"-encoding",
5+
"utf8",
6+
"-deprecation",
7+
"-unchecked",
8+
"-feature",
9+
"-explaintypes",
10+
"-Xlint",
11+
"-Xfatal-warnings",
12+
"-Xcheckinit",
13+
"-Ywarn-dead-code",
14+
"-Ywarn-value-discard",
15+
"-Ypartial-unification",
16+
"-Ywarn-macros:after",
17+
"-Ybackend-parallelism",
18+
"4"
19+
)
20+
21+
}

project/build.properties

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

project/plugins.sbt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.0.4")
2+
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "1.3.2")
3+
addSbtPlugin("com.github.cb372" % "sbt-explicit-dependencies" % "0.2.10")
4+
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.2.6")

0 commit comments

Comments
 (0)