Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies, apply scalafmt, and resolve warnings #57

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ bin
.ensime*
shared/src/main/scala/Empty.scala
.idea/
.bsp/
53 changes: 53 additions & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
version = 2.1.0

style = defaultWithAlign

docstrings = JavaDoc
indentOperator = spray
maxColumn = 120
rewrite.rules = [RedundantParens, SortImports, AvoidInfix]
unindentTopLevelOperators = true
align.tokens = [{code = "=>", owner = "Case"}]
align.openParenDefnSite = false
align.openParenCallSite = false
optIn.breakChainOnFirstMethodDot = false
optIn.configStyleArguments = false
danglingParentheses = false
spaces.inImportCurlyBraces = true
rewrite.neverInfix.excludeFilters = [
and
min
max
until
to
by
eq
ne
"should.*"
"contain.*"
"must.*"
in
ignore
be
taggedAs
thrownBy
synchronized
have
when
size
only
noneOf
oneElementOf
noElementsOf
atLeastOneElementOf
atMostOneElementOf
allElementsOf
inOrderElementsOf
theSameElementsAs
theSameElementsInOrderAs
]
rewriteTokens = {
"⇒": "=>"
"→": "->"
"←": "<-"
}
13 changes: 4 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ jdk: openjdk8
language: scala

scala:
- "2.13.1"
- "2.12.10"

jdk: openjdk8
- "2.13.8"
- "2.12.15"

matrix:
include:
- env: SBT_VERSION=1.3.8
scala: "2.12.10"
- env: SBT_VERSION=1.4.9
scala: "2.12.15"

env:
- TRAVIS_NODE_VERSION="10.17.0"
Expand All @@ -30,6 +28,3 @@ cache:
script:
- sbt ++$TRAVIS_SCALA_VERSION test
- source travis/testSbtPlugin.sh
cache:
directories:
- $HOME/.cache
83 changes: 23 additions & 60 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,103 +2,66 @@ import xerial.sbt.Sonatype._

import sbtcrossproject.CrossPlugin.autoImport.crossProject

lazy val root = project
.in(file("."))
.aggregate(parserJS, parserJVM, facadeJS, facadeJVM)
.settings(sonatypeSettings)
lazy val root = project.in(file(".")).aggregate(parser.js, parser.jvm, facade.js, facade.jvm).settings(sonatypeSettings)

lazy val fixResources =
taskKey[Unit]("Fix application.conf presence on first clean build.")

lazy val parser = crossProject(JSPlatform, JVMPlatform)
.in(file("."))
.in(file("parser"))
.settings(
name := "shocon-parser",
scalacOptions ++=
Seq(
"-feature",
"-unchecked",
"-language:implicitConversions",
"-deprecation",
),
publishTo := sonatypePublishTo.value
)
Seq("-feature", "-unchecked", "-language:implicitConversions", "-deprecation"),
publishTo := sonatypePublishTo.value)
.settings(sonatypeSettings)
.settings(
fixResources := {
val compileConf = (resourceDirectory in Compile).value / "application.conf"
if (compileConf.exists)
IO.copyFile(
compileConf,
(classDirectory in Compile).value / "application.conf"
)
if (compileConf.exists) {
IO.copyFile(compileConf, (classDirectory in Compile).value / "application.conf")
}
val testConf = (resourceDirectory in Test).value / "application.conf"
if (testConf.exists) {
IO.copyFile(
testConf,
(classDirectory in Test).value / "application.conf"
)
IO.copyFile(testConf, (classDirectory in Test).value / "application.conf")
}
},
compile in Compile := (compile in Compile).dependsOn(fixResources).value,
libraryDependencies ++= Seq(
"org.scala-lang.modules" %%% "scala-collection-compat" % "2.1.4",
"com.lihaoyi" %%% "fastparse" % "2.2.4",
"org.scala-lang" % "scala-reflect" % scalaVersion.value % "provided"
)
)
"org.scala-lang.modules" %%% "scala-collection-compat" % "2.6.0",
"com.lihaoyi" %%% "fastparse" % "2.3.3",
"org.scala-lang" % "scala-reflect" % scalaVersion.value % "provided"))
.jsSettings(
libraryDependencies += "org.scala-js" %%% "scalajs-java-time" % "1.0.0",
parallelExecution in Test := true
)

lazy val parserJVM = parser.jvm
lazy val parserJS = parser.js
parallelExecution in Test := true)

lazy val facade = crossProject(JSPlatform, JVMPlatform)
.in(file("facade"))
.dependsOn(parser)
.settings(
name := "shocon",
scalacOptions ++=
Seq(
"-feature",
"-unchecked",
"-language:implicitConversions",
"-deprecation",
),
publishTo := sonatypePublishTo.value
)
Seq("-feature", "-unchecked", "-language:implicitConversions", "-deprecation"),
publishTo := sonatypePublishTo.value)
.settings(sonatypeSettings)
.settings(
fixResources := {
val compileConf = (resourceDirectory in Compile).value / "application.conf"
if (compileConf.exists)
IO.copyFile(
compileConf,
(classDirectory in Compile).value / "application.conf"
)
if (compileConf.exists) {
IO.copyFile(compileConf, (classDirectory in Compile).value / "application.conf")
}
val testConf = (resourceDirectory in Test).value / "application.conf"
if (testConf.exists) {
IO.copyFile(
testConf,
(classDirectory in Test).value / "application.conf"
)
IO.copyFile(testConf, (classDirectory in Test).value / "application.conf")
}
},
compile in Compile := (compile in Compile).dependsOn(fixResources).value,
testFrameworks += new TestFramework("utest.runner.Framework"),
libraryDependencies ++= Seq(
"org.scala-lang.modules" %%% "scala-collection-compat" % "2.1.4",
"com.lihaoyi" %%% "fastparse" % "2.2.4",
"com.lihaoyi" %%% "utest" % "0.7.4" % "test",
"org.scala-lang" % "scala-reflect" % scalaVersion.value % "provided"
)
)
"org.scala-lang.modules" %%% "scala-collection-compat" % "2.6.0",
"com.lihaoyi" %%% "fastparse" % "2.3.3",
"com.lihaoyi" %%% "utest" % "0.7.11" % "test",
"org.scala-lang" % "scala-reflect" % scalaVersion.value % "provided"))
.jsSettings(
libraryDependencies += "org.scala-js" %%% "scalajs-java-time" % "1.0.0",
parallelExecution in Test := true
)

lazy val facadeJVM = facade.jvm
lazy val facadeJS = facade.js
parallelExecution in Test := true)
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package tests

import scala.scalajs.js.Dynamic.global

object AkkaConf {

def basic: String = """
Expand Down Expand Up @@ -73,7 +71,7 @@ akka {

"""

def long =
def long: String =
"""
# This is an unmodified akka-reference.conf, except for this
# comment and quoting one key that contained slashes.
Expand Down
11 changes: 0 additions & 11 deletions facade/jvm/src/test/scala/AkkaConf.scala

This file was deleted.

11 changes: 11 additions & 0 deletions facade/jvm/src/test/scala/tests/AkkaConf.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package tests

import scala.util.Using

object AkkaConf {

def basic: String = Using.resource(io.Source.fromFile("facade/jvm/src/test/resources/akka.conf")) { _.mkString }

def long: String = Using.resource(io.Source.fromFile("facade/jvm/src/test/resources/akka-long.conf")) { _.mkString }

}
Loading