Skip to content

Commit

Permalink
add a failing sbt scripted test to demonstrate #1589
Browse files Browse the repository at this point in the history
  • Loading branch information
bpholt committed Sep 25, 2024
1 parent b828a13 commit b21afb0
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
lazy val root = (project in file("."))
.enablePlugins(Smithy4sCodegenPlugin)
.settings(
crossScalaVersions := Seq("2.13.15", "3.3.3"),
libraryDependencies ++= Seq(
"com.disneystreaming.smithy4s" %% "smithy4s-core" % smithy4sVersion.value
)
)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=1.8.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
sys.props.get("plugin.version") match {
case Some(x) =>
addSbtPlugin("com.disneystreaming.smithy4s" % "smithy4s-sbt-codegen" % x)
case _ =>
sys.error(
"""|The system property 'plugin.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace smithy4s.example

structure Simple {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# generate for Scala 2.13
> ++ 2.13
> compile

$ exists target/scala-2.13/src_managed/main/smithy4s/smithy4s/example/Simple.scala

> ++ 3
> compile

$ exists target/scala-3.3.3/src_managed/main/smithy4s/smithy4s/example/Simple.scala

# switch back to Scala 2.13 and compile again; codegen should not happen a second time
> ++ 2.13
> compile

$ newer target/scala-3.3.3/src_managed/main/smithy4s/smithy4s/example/Simple.scala target/scala-2.13/src_managed/main/smithy4s/smithy4s/example/Simple.scala

0 comments on commit b21afb0

Please sign in to comment.