Skip to content

Commit 3670270

Browse files
committed
implement v2 interfaces
1 parent 5f8020e commit 3670270

File tree

298 files changed

+14610
-544
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

298 files changed

+14610
-544
lines changed

.bsp/sbt.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"name":"sbt","version":"1.5.5","bspVersion":"2.0.0-M5","languages":["scala"],"argv":["/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java","-Xms100m","-Xmx100m","-classpath","/home/celadari/.local/share/JetBrains/IdeaIC2021.2/Scala/launcher/sbt-launch.jar","xsbt.boot.Boot","-bsp","--sbt-launch-jar=/home/celadari/.local/share/JetBrains/IdeaIC2021.2/Scala/launcher/sbt-launch.jar"]}

.github/workflows/linter.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Linter CI
2+
on: [push]
3+
jobs:
4+
linter:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
- name: Set up JDK 11
9+
uses: actions/setup-java@v2
10+
with:
11+
java-version: '11'
12+
distribution: 'adopt'
13+
- name: Run Scalastyle Linter
14+
run: |
15+
sbt +scalastyle
16+
sbt +test:scalastyle

.github/workflows/test.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Test Coverage CI
2+
on: [push]
3+
jobs:
4+
retrieve-scala-versions:
5+
runs-on: ubuntu-20.04
6+
steps:
7+
- uses: actions/checkout@v2
8+
- name: Set up JDK 11
9+
uses: actions/setup-java@v2
10+
with:
11+
java-version: '11'
12+
distribution: 'adopt'
13+
- name: Retrieve Scala Versions from build.sbt file
14+
id: set-matrix
15+
run: |
16+
scala_versions=$(sbt +scalaBinaryVersion | cut -f2 -d " " | grep "^[0-9]\.[0-9][0-9]$")
17+
run: echo "::set-output name=matrix::$scala_versions"
18+
outputs:
19+
matrix: ${{ steps.set-matrix.outputs.matrix }}
20+
21+
test-coverage:
22+
runs-on: ubuntu-20.04
23+
steps:
24+
- uses: actions/checkout@v2
25+
- name: Set up JDK 11
26+
uses: actions/setup-java@v2
27+
with:
28+
java-version: '11'
29+
distribution: 'adopt'
30+
- name: Run Sbt Test and Generate Report on Multiple Scala Versions
31+
run: |
32+
sbt +coverage +test
33+
sbt +coverageReport
34+
- uses: actions/upload-artifact@v2
35+
with:
36+
name: coverage-report
37+
path: ./target/scala-[0-9].[0-9][0-9]
38+
39+
upload-coverage:
40+
runs-on: ubuntu-latest
41+
needs: [retrieve-scala-versions, test-coverage]
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
scala_version: ${{ fromJson(needs.retrieve-scala-versions.outputs.matrix) }}
46+
steps:
47+
- uses: actions/checkout@v2
48+
- uses: actions/download-artifact@v2
49+
with:
50+
name: coverage-report
51+
path: ./target/
52+
- uses: codecov/codecov-action@v2
53+
with:
54+
token: ${{ secrets.CODECOV_TOKEN }}
55+
directory: ./target/scala-${{ matrix.scala_version }}/
56+
flags: unittests,${{ matrix.scala_version }}
57+
name: codecov-json-logic-scala
58+
fail_ci_if_error: true
59+
verbose: true

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This project is compiled, tested, and published for the following Scala versions
2020
* 2.10.7
2121
* 2.11.12
2222
* 2.12.6
23-
* 2.13.1
23+
* 2.13.2
2424

2525
# Table of Contents
2626
1. [Installation]()

build.sbt

Lines changed: 39 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,51 @@ organization := "com.github.celadari"
44

55
homepage := Some(url("https://github.com/celadari/json-logic-scala"))
66

7-
version := "1.1.0"
7+
version := "2.0.0"
88

9-
scalaVersion := "2.10.7"
9+
scalaVersion := "2.13.2"
1010

11-
crossScalaVersions := Seq("2.10.7", "2.11.12", "2.12.6", "2.13.1")
11+
crossScalaVersions := Seq("2.11.12", "2.12.13", "2.13.2")
1212

1313
resolvers ++= Seq(
1414
"sonatype-snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
15-
"sonatype-releases" at "https://oss.sonatype.org/content/repositories/releases"
15+
"sonatype-releases" at "https://oss.sonatype.org/content/repositories/releases",
1616
)
1717

18-
val typeSafeVersions = Map("2.10" -> "2.6.14", "2.11" -> "2.7.4", "2.12" -> "2.8.1", "2.13" -> "2.8.1")
18+
// This forbids including Scala related libraries into the dependency
19+
autoScalaLibrary := false
20+
21+
// scalastyle:off magic.number
1922
def resolveVersion(scalaV: String, versionsResolver: Map[String, String]): String = versionsResolver(scalaV.slice(0, 4))
2023

21-
libraryDependencies ++= {
22-
Seq(
23-
"org.scala-lang" % "scala-compiler" % scalaVersion.value,
24-
"com.typesafe.play" %% "play-json" % resolveVersion(scalaVersion.value, typeSafeVersions)
25-
)
26-
}
24+
val typeSafeVersions = Map("2.10" -> "2.6.14", "2.11" -> "2.7.4", "2.12" -> "2.8.1", "2.13" -> "2.8.1")
25+
26+
libraryDependencies ++= Seq(
27+
"com.typesafe.play" %% "play-json" % resolveVersion(scalaVersion.value, typeSafeVersions),
28+
"org.apache.xbean" % "xbean-finder" % "4.20",
29+
"org.apache.xbean" % "xbean-reflect" % "4.20",
30+
"org.scalatest" %% "scalatest" % "3.2.9" % Test
31+
)
32+
33+
// scalacOptions ++= ("-feature" :: "-language:postfixOps" :: "-language:implicitConversions" :: Nil)
34+
scalacOptions ++= Seq(
35+
"-encoding", "utf8",
36+
"-deprecation",
37+
"-feature",
38+
"-language:higherKinds",
39+
if (Set("2.12", "2.13").contains(scalaVersion.value.slice(0, 4))) "-Ywarn-unused:imports" else "-Ywarn-unused-import",
40+
if (Set("2.11", "2.12").contains(scalaVersion.value.slice(0, 4))) "-Xmax-classfile-name" else "",
41+
if (Set("2.11", "2.12").contains(scalaVersion.value.slice(0, 4))) "128" else "",
42+
"-language:existentials",
43+
if (scalaVersion.value.slice(0, 4) == "2.11") "-Xfatal-warnings"
44+
else if (scalaVersion.value.slice(0, 4) == "2.12") ""
45+
else "-Werror"
46+
)
2747

28-
scalacOptions ++= ("-feature" :: "-language:postfixOps" :: "-language:implicitConversions" :: Nil)
48+
Test / testOptions += Tests.Argument("-oGK")
49+
50+
// scalastyle unit test configuration
51+
Test / scalastyleConfig := baseDirectory.value / "scalastyle-test-config.xml"
2952

3053
// Publishing stuff for sonatype
3154
publishTo := {
@@ -37,13 +60,13 @@ publishConfiguration := publishConfiguration.value.withOverwrite(true)
3760

3861
credentials += Credentials(Path.userHome / ".sbt" / ".credentials")
3962

40-
publishArtifact in Test := false
63+
Test / publishArtifact := false
4164

4265
publishMavenStyle := true
4366

4467
pomIncludeRepository := { _ => false }
4568

46-
pomExtra := (
69+
pomExtra :=
4770
<scm>
4871
<url>git@github.com:celadari/json-logic-scala.git</url>
4972
<connection>scm:git:git@github.com:celadari/json-logic-scala.git</connection>
@@ -55,11 +78,7 @@ pomExtra := (
5578
<url>https://github.com/celadari</url>
5679
</developer>
5780
</developers>
58-
)
59-
60-
licenses += ("MIT", url("http://mit-license.org/"))
6181

62-
// Scaladoc publishing stuff
63-
enablePlugins(GhpagesPlugin, SiteScaladocPlugin)
82+
licenses += ("MIT", url("https://mit-license.org/"))
6483

65-
git.remoteRepo := "git@github.com:celadari/json-logic-scala.git"
84+
// Scaladoc publishing stuff

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.3.8
1+
sbt.version=1.5.5

project/plugins.sbt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
resolvers += "jgit-repo" at "https://download.eclipse.org/jgit/maven"
22

3-
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.3") // https://github.com/sbt/sbt-ghpages
3+
addSbtPlugin("com.beautiful-scala" % "sbt-scalastyle" % "1.5.0")
44

5-
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0")
5+
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.8.2")
66

7-
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.6")
7+
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "latest.integration")

0 commit comments

Comments
 (0)