-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a failing sbt scripted test to demonstrate #1589
- Loading branch information
Showing
5 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
modules/codegen-plugin/src/sbt-test/codegen-plugin/cross-builds/build.sbt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
) | ||
) |
1 change: 1 addition & 0 deletions
1
modules/codegen-plugin/src/sbt-test/codegen-plugin/cross-builds/project/build.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sbt.version=1.8.0 |
9 changes: 9 additions & 0 deletions
9
modules/codegen-plugin/src/sbt-test/codegen-plugin/cross-builds/project/plugins.sbt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
) | ||
} |
3 changes: 3 additions & 0 deletions
3
...les/codegen-plugin/src/sbt-test/codegen-plugin/cross-builds/src/main/smithy/simple.smithy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
namespace smithy4s.example | ||
|
||
structure Simple {} |
16 changes: 16 additions & 0 deletions
16
modules/codegen-plugin/src/sbt-test/codegen-plugin/cross-builds/test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |