Skip to content

Commit

Permalink
Merge pull request #1435 from disneystreaming/add-protobuf-generation
Browse files Browse the repository at this point in the history
Wire protobuf generation in codegen plugin
  • Loading branch information
Baccata committed Mar 14, 2024
2 parents 4a7a522 + 43d0d5c commit 3025f4c
Show file tree
Hide file tree
Showing 54 changed files with 690 additions and 551 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
@@ -1,5 +1,6 @@
# 0.18.13

* Enable generation of protobuf specifications from smithy specifications.
* modify logic to guarantee that rendered and dynamic enum values respect the ordering from the specification.

# 0.18.12
Expand Down
15 changes: 13 additions & 2 deletions build.sbt
Expand Up @@ -371,6 +371,7 @@ lazy val codegen = projectMatrix
Dependencies.Smithy.build,
Dependencies.Alloy.core,
Dependencies.Alloy.openapi,
Dependencies.Smithytranslate.proto,
"com.lihaoyi" %% "os-lib" % "0.9.3",
"com.lihaoyi" %% "upickle" % "3.1.5",
Dependencies.collectionsCompat.value,
Expand Down Expand Up @@ -834,6 +835,11 @@ lazy val complianceTests = projectMatrix
lazy val exampleGeneratedOutput =
settingKey[File]("Output directory where the generated code is going to be.")

lazy val exampleGeneratedResourcesOutput =
settingKey[File](
"Output directory where the generated resources are going to be."
)

/**
* A project that contains generated code, which can serve as a basis for tests.
*/
Expand All @@ -845,7 +851,11 @@ lazy val bootstrapped = projectMatrix
.settings(
Test / fork := true,
exampleGeneratedOutput := (ThisBuild / baseDirectory).value / "modules" / "bootstrapped" / "src" / "generated",
cleanFiles += exampleGeneratedOutput.value,
exampleGeneratedResourcesOutput := (Compile / resourceDirectory).value,
cleanFiles ++= Seq(
exampleGeneratedOutput.value,
exampleGeneratedResourcesOutput.value
),
smithy4sDependencies ++= Seq(
Dependencies.Smithy.testTraits,
Dependencies.Smithy.awsTraits,
Expand All @@ -867,6 +877,7 @@ lazy val bootstrapped = projectMatrix
"smithy4s.example.hello",
"smithy4s.example.test",
"smithy4s.example.package",
"smithy4s.example.protobuf",
"weather",
"smithy4s.example.product",
"smithy4s.example.reservedNameOverride"
Expand All @@ -878,7 +889,7 @@ lazy val bootstrapped = projectMatrix
libraryDependencies += Dependencies.Http4s.emberServer.value,
genSmithy(Compile),
genSmithyOutput := exampleGeneratedOutput.value,
genSmithyResourcesOutput := (Compile / resourceDirectory).value,
genSmithyResourcesOutput := exampleGeneratedResourcesOutput.value,
smithy4sSkip := List("resource"),
// Ignore deprecation warnings here - it's all generated code, anyway.
scalacOptions ++= Seq(
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit 3025f4c

Please sign in to comment.