Skip to content

Commit

Permalink
Upgrade dependencies. Next step: make RC build to test with
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinPinner committed Jan 13, 2022
1 parent f5a8805 commit 2324879
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 23 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ npm-debug.log
generated
target/
.idea/
.bsp/
40 changes: 24 additions & 16 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import sbtrelease._
import ReleaseStateTransformations._

val contentEntityVersion = "2.1.0-RC2"
val scroogeVersion = "21.12.0"
val thriftVersion = "0.15.0"

val commonSettings = Seq(
organization := "com.gu",
scalaVersion := "2.13.2",
crossScalaVersions := Seq("2.11.12", "2.12.11", scalaVersion.value),
// Scrooge 21.3.0 dropped support for scala < 2.13, so our builds similarly only support Scala 2.12+
crossScalaVersions := Seq("2.12.11", scalaVersion.value),
scmInfo := Some(ScmInfo(url("https://github.com/guardian/content-atom"),
"scm:git:[email protected]:guardian/content-atom.git")),

Expand Down Expand Up @@ -41,6 +46,11 @@ val commonSettings = Seq(
<name>Regis Kuckaertz</name>
<url>https://github.com/regiskuckaertz</url>
</developer>
<developer>
<id>justinpinner</id>
<name>Justin Pinner</name>
<url>https://github.com/justinpinner</url>
</developer>
</developers>
),
licenses := Seq("Apache V2" -> url("http://www.apache.org/licenses/LICENSE-2.0.html")),
Expand Down Expand Up @@ -75,30 +85,28 @@ lazy val thrift = Project(id = "content-atom-model-thrift", base = file("thrift"
.settings(
description := "Content atom model Thrift files",
crossPaths := false,
publishArtifact in packageDoc := false,
publishArtifact in packageSrc := false,
includeFilter in unmanagedResources := "*.thrift",
unmanagedResourceDirectories in Compile += { baseDirectory.value / "src/main/thrift" }
packageDoc / publishArtifact := false,
packageSrc / publishArtifact := false,
unmanagedResources / includeFilter := "*.thrift",
Compile / unmanagedResourceDirectories += { baseDirectory.value / "src/main/thrift" }
)

val contentEntityVersion = "2.0.6"

lazy val scalaClasses = Project(id = "content-atom-model", base = file("scala"))
.settings(commonSettings)
.settings(
description := "Scala library built from Content-atom thrift definition",
scroogeThriftSourceFolder in Compile := baseDirectory.value / "../thrift/src/main/thrift",
scroogeThriftOutputFolder in Compile := sourceManaged.value,
scroogeThriftDependencies in Compile ++= Seq("content-entity-thrift"),
Compile / scroogeThriftSourceFolder := baseDirectory.value / "../thrift/src/main/thrift",
Compile / scroogeThriftOutputFolder := sourceManaged.value,
Compile / scroogeThriftDependencies ++= Seq("content-entity-thrift"),
resolvers += Resolver.sonatypeRepo("public"),
libraryDependencies ++= Seq(
"com.gu" % "content-entity-thrift" % contentEntityVersion,
"com.gu" %% "content-entity-model" % contentEntityVersion,
"org.apache.thrift" % "libthrift" % "0.12.0",
"com.twitter" %% "scrooge-core" % "20.4.1"
"org.apache.thrift" % "libthrift" % thriftVersion,
"com.twitter" %% "scrooge-core" % scroogeVersion
),
// Include the Thrift file in the published jar
scroogePublishThrift in Compile := true
Compile / scroogePublishThrift := true
)

lazy val typescriptClasses = (project in file("ts"))
Expand All @@ -111,11 +119,11 @@ lazy val typescriptClasses = (project in file("ts"))
Test / scroogeDefaultJavaNamespace := scroogeTypescriptNpmPackageName.value,
description := "Typescript library built from Content-atom thrift definition",

scroogeLanguages in Compile := Seq("typescript"),
scroogeThriftSourceFolder in Compile := baseDirectory.value / "../thrift/src/main/thrift",
Compile / scroogeLanguages := Seq("typescript"),
Compile / scroogeThriftSourceFolder := baseDirectory.value / "../thrift/src/main/thrift",

scroogeTypescriptPackageLicense := "Apache-2.0",
scroogeThriftDependencies in Compile ++= Seq("content-entity-thrift"),
Compile / scroogeThriftDependencies ++= Seq("content-entity-thrift"),
scroogeTypescriptPackageMapping := Map(
"content-entity-thrift" -> "@guardian/content-entity-model"
),
Expand Down
4 changes: 2 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.0")

addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.7")

addSbtPlugin("com.twitter" % "scrooge-sbt-plugin" % "20.4.1")
addSbtPlugin("com.twitter" % "scrooge-sbt-plugin" % "21.12.0")

addSbtPlugin("com.gu" % "sbt-scrooge-typescript" % "1.3.0")
addSbtPlugin("com.gu" % "sbt-scrooge-typescript" % "1.5.0-RC1")
12 changes: 8 additions & 4 deletions thrift/src/main/thrift/atoms/recipe.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,19 @@ struct Time {
}

struct Serves {
/* note that `from` (field 2) has been renamed `minimum` due to `from` becoming a reserved word in scrooge */
/* and that `to` (field 3) is now `maximum` to keep it semantically in line with `from` becoming `minimum` */
1: required string type
2: required i16 from
3: required i16 to
2: required i16 minimum
3: required i16 maximum
4: optional string unit
}

struct Range {
1: required i16 from
2: required i16 to
/* note that `from` (field 1) has been renamed `minimum` due to `from` becoming a reserved word in scrooge */
/* and that `to` (field 2) is now `maximum` to keep it semantically in line with `from` becoming `minimum` */
1: required i16 minimum
2: required i16 maximum
}

struct Ingredient {
Expand Down
2 changes: 1 addition & 1 deletion version.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version in ThisBuild := "3.2.5-SNAPSHOT"
ThisBuild / version := "3.3.0-SNAPSHOT"

0 comments on commit 2324879

Please sign in to comment.