Skip to content
Merged
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
2 changes: 0 additions & 2 deletions .github/workflows/scala-steward.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,3 @@ jobs:
uses: softwaremill/github-actions-workflows/.github/workflows/scala-steward.yml@main
secrets:
github-token: ${{ secrets.SOFTWAREMILL_CI_PR_TOKEN }}
with:
java-version: '21'
53 changes: 22 additions & 31 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import com.softwaremill.SbtSoftwareMillCommon.commonSmlBuildSettings
import com.softwaremill.Publish.ossPublishSettings
import sbt.Reference.display
import sbt.internal.ProjectMatrix

val scala2_12 = "2.12.20"
val scala2_13 = "2.13.16"
val scala3 = "3.3.6"
val scala2_12 = "2.12.21"
val scala2_13 = "2.13.18"
val scala3 = "3.3.8"

val scalaJVMVersions = List(scala2_12, scala2_13, scala3)
val scalaJSVersions = List(scala2_12, scala2_13, scala3)
Expand All @@ -18,7 +17,7 @@ val circeYamlVersionLatest = "0.16.1"
val scalaTestVersion = "3.2.19"
val scalaCollectionCompatVersion = "2.11.0"

excludeLintKeys in Global ++= Set(ideSkipProject)
Global / excludeLintKeys ++= Set(ideSkipProject)

val scala3Settings = Seq(
scalacOptions -= "-Xmax-inlines",
Expand All @@ -27,13 +26,16 @@ val scala3Settings = Seq(
}
)

val commonSettings = commonSmlBuildSettings ++ ossPublishSettings ++ Seq(
organization := "com.softwaremill.sttp.apispec",
mimaPreviousArtifacts := Set.empty,
versionScheme := Some("early-semver")
) ++ scala3Settings
commonSmlBuildSettings
ossPublishSettings
scala3Settings

val commonJvmSettings = commonSettings ++ Seq(
organization := "com.softwaremill.sttp.apispec"
mimaPreviousArtifacts := Set.empty
versionScheme := Some("early-semver")

val commonJvmSettings = Seq(
scalacOptions ++= (if (ScalaArtifacts.isScala3(scalaVersion.value)) Seq.empty else Seq("-release", "8")),
ideSkipProject := (scalaVersion.value != scala2_13),
libraryDependencies ++= Seq("org.scalatest" %% "scalatest" % scalaTestVersion % Test),
mimaPreviousArtifacts := previousStableVersion.value.map(organization.value %% moduleName.value % _).toSet,
Expand All @@ -42,7 +44,7 @@ val commonJvmSettings = commonSettings ++ Seq(
}
)

val commonJsSettings = commonSettings ++ Seq(
val commonJsSettings = Seq(
ideSkipProject := true,
Compile / scalacOptions ++= {
if (isSnapshot.value) Seq.empty
Expand All @@ -58,12 +60,12 @@ val commonJsSettings = commonSettings ++ Seq(
s"$mapSourcePrefix:$dir->$url/v${version.value}/"
}
},
libraryDependencies ++= Seq("org.scalatest" %%% "scalatest" % scalaTestVersion % Test)
libraryDependencies ++= Seq("org.scalatest" %% "scalatest" % scalaTestVersion % Test)
)

val commonNativeSettings = commonSettings ++ Seq(
val commonNativeSettings = Seq(
ideSkipProject := true,
libraryDependencies ++= Seq("org.scalatest" %%% "scalatest" % scalaTestVersion % Test)
libraryDependencies ++= Seq("org.scalatest" %% "scalatest" % scalaTestVersion % Test)
)

lazy val allProjectAggregates: Seq[ProjectReference] =
Expand All @@ -89,18 +91,16 @@ lazy val projectAggregates: Seq[ProjectReference] = if (sys.env.isDefinedAt("STT
val compileAndTest = "compile->compile;test->test"

lazy val rootProject = (project in file("."))
.settings(commonSettings *)
.settings(publish / skip := true, name := "sttp-apispec", scalaVersion := scala2_13)
.aggregate(projectAggregates *)

lazy val circeTestUtils: ProjectMatrix = (projectMatrix in file("circe-testutils"))
.settings(commonSettings)
.settings(
publish / skip := true,
name := "circe-testutils",
libraryDependencies ++= Seq(
"io.circe" %%% "circe-core" % circeVersion,
"io.circe" %%% "circe-parser" % circeVersion
"io.circe" %% "circe-core" % circeVersion,
"io.circe" %% "circe-parser" % circeVersion
)
)
.jvmPlatform(
Expand All @@ -118,7 +118,6 @@ lazy val circeTestUtils: ProjectMatrix = (projectMatrix in file("circe-testutils
// apispec

lazy val apispecModel: ProjectMatrix = (projectMatrix in file("apispec-model"))
.settings(commonSettings)
.settings(
name := "apispec-model"
)
Expand All @@ -137,12 +136,11 @@ lazy val apispecModel: ProjectMatrix = (projectMatrix in file("apispec-model"))

// jsonschema
lazy val jsonSchemaCirce: ProjectMatrix = (projectMatrix in file("jsonschema-circe"))
.settings(commonSettings)
.settings(
libraryDependencies ++= Seq(
"io.circe" %%% "circe-core" % circeVersion,
"io.circe" %%% "circe-parser" % circeVersion,
"io.circe" %%% "circe-generic" % circeVersion
"io.circe" %% "circe-core" % circeVersion,
"io.circe" %% "circe-parser" % circeVersion,
"io.circe" %% "circe-generic" % circeVersion
),
name := "jsonschema-circe"
)
Expand All @@ -163,7 +161,6 @@ lazy val jsonSchemaCirce: ProjectMatrix = (projectMatrix in file("jsonschema-cir
// openapi

lazy val openapiModel: ProjectMatrix = (projectMatrix in file("openapi-model"))
.settings(commonSettings)
.settings(
name := "openapi-model"
)
Expand All @@ -182,7 +179,6 @@ lazy val openapiModel: ProjectMatrix = (projectMatrix in file("openapi-model"))
.dependsOn(apispecModel)

lazy val openapiCirce: ProjectMatrix = (projectMatrix in file("openapi-circe"))
.settings(commonSettings)
.settings(
name := "openapi-circe"
)
Expand All @@ -201,7 +197,6 @@ lazy val openapiCirce: ProjectMatrix = (projectMatrix in file("openapi-circe"))
.dependsOn(openapiModel, jsonSchemaCirce, circeTestUtils % Test)

lazy val openapiCirceYaml: ProjectMatrix = (projectMatrix in file("openapi-circe-yaml"))
.settings(commonSettings)
.settings(
libraryDependencies ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, n)) if n <= 12 =>
Expand All @@ -220,7 +215,6 @@ lazy val openapiCirceYaml: ProjectMatrix = (projectMatrix in file("openapi-circe
// asyncapi

lazy val asyncapiModel: ProjectMatrix = (projectMatrix in file("asyncapi-model"))
.settings(commonSettings)
.settings(
name := "asyncapi-model"
)
Expand All @@ -239,7 +233,6 @@ lazy val asyncapiModel: ProjectMatrix = (projectMatrix in file("asyncapi-model")
.dependsOn(apispecModel)

lazy val asyncapiCirce: ProjectMatrix = (projectMatrix in file("asyncapi-circe"))
.settings(commonSettings)
.settings(
name := "asyncapi-circe"
)
Expand All @@ -258,7 +251,6 @@ lazy val asyncapiCirce: ProjectMatrix = (projectMatrix in file("asyncapi-circe")
.dependsOn(asyncapiModel, jsonSchemaCirce)

lazy val asyncapiCirceYaml: ProjectMatrix = (projectMatrix in file("asyncapi-circe-yaml"))
.settings(commonSettings)
.settings(
libraryDependencies ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, n)) if n <= 12 =>
Expand All @@ -275,7 +267,6 @@ lazy val asyncapiCirceYaml: ProjectMatrix = (projectMatrix in file("asyncapi-cir
.dependsOn(asyncapiCirce)

lazy val openapiComparatorTests: ProjectMatrix = (projectMatrix in file("openapi-comparator-tests"))
.settings(commonSettings)
.settings(
name := "openapi-comparator-tests",
publish / skip := true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ package sttp.apispec.test

import io.circe._
import io.circe.parser.decode
import java.io.{BufferedReader, InputStreamReader, StringWriter}
import java.nio.charset.StandardCharsets
import scala.io.Source

trait ResourcePlatform {

Expand All @@ -12,11 +11,8 @@ trait ResourcePlatform {
*/
def basedir: String
def readJson(path: String): Either[Error, Json] = {

val is = getClass.getResourceAsStream(path)
val reader = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8))
val writer = new StringWriter()
reader.transferTo(writer)
decode[Json](writer.toString)
try decode[Json](Source.fromInputStream(is, "UTF-8").mkString)
finally is.close()
}
}
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.11.2
sbt.version=2.0.9
13 changes: 5 additions & 8 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
libraryDependencies += "org.scala-js" %% "scalajs-env-selenium" % "1.1.1"
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.22.0")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.12")

addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.19.0")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.8")
addSbtPlugin("com.eed3si9n" % "sbt-projectmatrix" % "0.11.0")

val sbtSoftwareMillVersion = "2.1.0"
val sbtSoftwareMillVersion = "3.0.1"
addSbtPlugin("com.softwaremill.sbt-softwaremill" % "sbt-softwaremill-common" % sbtSoftwareMillVersion)
addSbtPlugin("com.softwaremill.sbt-softwaremill" % "sbt-softwaremill-publish" % sbtSoftwareMillVersion)
addSbtPlugin("com.softwaremill.sbt-softwaremill" % "sbt-softwaremill-browser-test-js" % sbtSoftwareMillVersion)

addSbtPlugin("org.jetbrains" % "sbt-ide-settings" % "1.1.0")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.4")
addSbtPlugin("org.jetbrains.scala" % "sbt-ide-settings" % "1.1.4")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.2.1")
Loading