-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scaffold - working example of empty scala project
- Loading branch information
1 parent
1f83de8
commit 5d848fe
Showing
10 changed files
with
150 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
-Dfile.encoding=UTF8 | ||
-Xms1G | ||
-Xmx5G | ||
-XX:ReservedCodeCacheSize=500M | ||
-XX:+TieredCompilation | ||
-XX:+UseParallelGC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
rules = [ | ||
OrganizeImports | ||
] | ||
|
||
OrganizeImports { | ||
groupedImports = Merge | ||
coalesceToWildcardImportThreshold = 3 | ||
groups = ["re:javax?\\.", "cats.", "scala.", "org.acme.", "*"] | ||
removeUnused = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
version=2.0.0 | ||
|
||
style = default | ||
project.git = true | ||
|
||
maxColumn = 120 | ||
newlines.alwaysBeforeTopLevelStatements = true | ||
continuationIndent.defnSite = 2 | ||
continuationIndent.callSite = 2 | ||
newlines.penalizeSingleSelectMultiArgList = false | ||
includeCurlyBraceInSelectChains = false | ||
align.openParenCallSite = false | ||
danglingParentheses = true | ||
newlines.avoidAfterYield = false | ||
|
||
align = some | ||
|
||
rewrite.rules = [ | ||
AvoidInfix | ||
RedundantBraces | ||
RedundantParens | ||
AsciiSortImports | ||
PreferCurlyFors | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# State channel - examples | ||
|
||
```bash | ||
sbt "stateChannel/run" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import Dependencies._ | ||
|
||
ThisBuild / scalaVersion := "2.13.8" | ||
ThisBuild / organization := "org.acme" | ||
ThisBuild / organizationName := "acme" | ||
|
||
ThisBuild / evictionErrorLevel := Level.Warn | ||
ThisBuild / scalafixDependencies += Libraries.organizeImports | ||
|
||
resolvers += Resolver.sonatypeRepo("snapshots") | ||
|
||
val scalafixCommonSettings = inConfig(IntegrationTest)(scalafixConfigSettings(IntegrationTest)) | ||
|
||
lazy val commonSettings = Seq( | ||
scalacOptions ++= List("-Ymacro-annotations", "-Yrangepos", "-Wconf:cat=unused:info", "-language:reflectiveCalls"), | ||
scalafmtOnCompile := true, | ||
scalafixOnCompile := true, | ||
resolvers ++= List( | ||
Resolver.sonatypeRepo("snapshots") | ||
) | ||
) | ||
|
||
ThisBuild / assemblyMergeStrategy := { | ||
case "logback.xml" => MergeStrategy.first | ||
case x if x.contains("io.netty.versions.properties") => MergeStrategy.discard | ||
case PathList(xs @ _*) if xs.last == "module-info.class" => MergeStrategy.first | ||
case x => (assembly / assemblyMergeStrategy).value(x) | ||
} | ||
|
||
Global / fork := true | ||
Global / cancelable := true | ||
Global / onChangedBuildSource := ReloadOnSourceChanges | ||
|
||
lazy val root = (project in file(".")) | ||
.settings( | ||
name := "acme" | ||
) | ||
.aggregate(stateChannel) | ||
|
||
lazy val stateChannel = (project in file("modules/state-channel")) | ||
.enablePlugins(AshScriptPlugin) | ||
.enablePlugins(JavaAppPackaging) | ||
.settings( | ||
name := "acme-state-channel", | ||
Defaults.itSettings, | ||
scalafixCommonSettings, | ||
commonSettings, | ||
libraryDependencies ++= Seq( | ||
CompilerPlugin.kindProjector, | ||
CompilerPlugin.betterMonadicFor, | ||
CompilerPlugin.semanticDB | ||
) | ||
) | ||
|
||
addCommandAlias("runLinter", ";scalafixAll --rules OrganizeImports") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package org.acme | ||
|
||
object Main { | ||
|
||
def main(args: Array[String]) = | ||
println("Hello, world") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import sbt._ | ||
|
||
object Dependencies { | ||
|
||
object V { | ||
val betterMonadicFor = "0.3.1" | ||
val kindProjector = "0.13.2" | ||
val organizeImports = "0.5.0" | ||
val semanticDB = "4.5.9" | ||
} | ||
|
||
object Libraries { | ||
|
||
// Scalafix rules | ||
val organizeImports = "com.github.liancheng" %% "organize-imports" % V.organizeImports | ||
} | ||
|
||
object CompilerPlugin { | ||
|
||
val betterMonadicFor = compilerPlugin( | ||
"com.olegpy" %% "better-monadic-for" % V.betterMonadicFor | ||
) | ||
|
||
val kindProjector = compilerPlugin( | ||
("org.typelevel" % "kind-projector" % V.kindProjector).cross(CrossVersion.full) | ||
) | ||
|
||
val semanticDB = compilerPlugin( | ||
("org.scalameta" % "semanticdb-scalac" % V.semanticDB).cross(CrossVersion.full) | ||
) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sbt.version=1.6.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.3.3") | ||
addSbtPlugin("io.spray" % "sbt-revolver" % "0.9.1") | ||
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.8.1") | ||
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6") | ||
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.0") | ||
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.2.0") | ||
addSbtPlugin("org.jmotor.sbt" % "sbt-dependency-updates" % "1.2.2") | ||
addDependencyTreePlugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ThisBuild / version := "0.1.0-SNAPSHOT" |