-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added scripted test for protobuf generation
- Loading branch information
Showing
5 changed files
with
33 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/protobuf/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( | ||
scalaVersion := "2.13.10", | ||
libraryDependencies ++= Seq( | ||
"com.disneystreaming.smithy4s" %% "smithy4s-core" % smithy4sVersion.value | ||
) | ||
) |
1 change: 1 addition & 0 deletions
1
modules/codegen-plugin/src/sbt-test/codegen-plugin/protobuf/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.2 |
9 changes: 9 additions & 0 deletions
9
modules/codegen-plugin/src/sbt-test/codegen-plugin/protobuf/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 | ||
) | ||
} |
11 changes: 11 additions & 0 deletions
11
modules/codegen-plugin/src/sbt-test/codegen-plugin/protobuf/src/main/smithy/foo.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,11 @@ | ||
$version: "2" | ||
|
||
namespace foo | ||
|
||
use alloy.proto#protoEnabled | ||
|
||
@protoEnabled | ||
structure Foo { | ||
a: String | ||
b: Integer | ||
} |
4 changes: 4 additions & 0 deletions
4
modules/codegen-plugin/src/sbt-test/codegen-plugin/protobuf/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,4 @@ | ||
> compile | ||
|
||
# Protobuf source created | ||
-$ exists target/scala-2.13/resources_managed/foo/foo.proto |