Skip to content

Commit

Permalink
Bump scala and sbt version (#185)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Iofel authored Mar 2, 2023
1 parent 8627f38 commit fdc0035
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 11 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
java: [ '13' ]
scala: [ '2.13.6' ]
scala: [ '2.13.10' ]
steps:
- uses: actions/checkout@v2
- name: Set up JDK
Expand All @@ -24,5 +24,7 @@ jobs:
distribution: 'zulu'
- name: print Java version
run: java -version
- name: setup apibuilder config
run: mkdir ~/.apibuilder && echo "[default]" > ~/.apibuilder/config
- name: Build
run: sbt ++${{ matrix.scala }} clean test
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
language: scala
scala:
- 2.13.6
- 2.13.10
jdk:
- openjdk13
script:
script:
- mkdir ~/.apibuilder && echo "[default]" > ~/.apibuilder/config
- sbt ++$TRAVIS_SCALA_VERSION clean compile test
# Tricks to avoid unnecessary cache updates
- find $HOME/.sbt -name "*.lock" | xargs rm -f
Expand Down
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name := "apibuilder-validation"

organization := "io.apibuilder"

ThisBuild / scalaVersion := "2.13.6"
ThisBuild / scalaVersion := "2.13.10"

crossScalaVersions := Seq("2.13.6")
crossScalaVersions := Seq("2.13.10")

lazy val allScalacOptions = Seq(
"-deprecation",
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.5.7
sbt.version=1.8.2
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ case class UnionToModelBuilder(multiService: MultiService) {
}

private[this] def buildModel(union: ApiBuilderType.Union, discriminator: String, fields: Seq[Field]): UnionModel = {
val enum = buildDiscriminatorEnum(union, discriminator)
val `enum` = buildDiscriminatorEnum(union, discriminator)
val allFields = Seq(buildDiscriminatorField(union, enum, discriminator)) ++ fields
UnionModel(
service = union.service,
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/io/apibuilder/validation/AnyType.scala
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ case class ApiBuilderField(service: ApiBuilderService, field: Field)
case class ApiBuilderUnionType(union: ApiBuilderType.Union, `type`: UnionType)

object ApiBuilderType {
case class Enum(override val service: ApiBuilderService, enum: models.Enum) extends ApiBuilderType {
case class Enum(override val service: ApiBuilderService, `enum`: models.Enum) extends ApiBuilderType {
override val name: String = enum.name
override val typeDiscriminator: TypeDiscriminator = TypeDiscriminator.Enums
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class UnionToModelBuilderSpec extends AnyWordSpec with Matchers

"validates all types are models" must {
"enum" in {
val enum = makeEnum("test")
val `enum` = makeEnum("test")
setupInvalid(enums = Seq(enum)) must equal(
Seq("Type 'test' is an enum. A model is required")
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import org.scalatest.funspec.AnyFunSpec
class ApiBuilderTypeSpec extends AnyFunSpec with Matchers with Helpers {

private[this] lazy val service = loadService("flow-api-service.json")
private[this] lazy val enum = ApiBuilderType.Enum(service, Enum("gender", "genders", values = Nil))
private[this] lazy val `enum` = ApiBuilderType.Enum(service, Enum("gender", "genders", values = Nil))
private[this] lazy val model = ApiBuilderType.Model(service, Model("user", "users", fields = Nil))
private[this] lazy val union = ApiBuilderType.Union(service, Union("test", "tests", types = Nil))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ trait Helpers {
)
}

def rightOrErrors[_,V](f: Either[_, V]): V = {
def rightOrErrors[V](f: Either[_, V]): V = {
f match {
case Left(bad) => sys.error(s"Expected valid value but got: $bad")
case Right(v) => v
Expand Down

0 comments on commit fdc0035

Please sign in to comment.