-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve SBT caching during code generation (#1499)
- Loading branch information
Showing
19 changed files
with
93 additions
and
58 deletions.
There are no files selected for viewing
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
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
2 changes: 1 addition & 1 deletion
2
modules/codegen-plugin/src/sbt-test/codegen-plugin/aws-specs/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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# check if smithy4sCodegen works | ||
> smithy4sCodegen | ||
$ exists target/scala-2.13/src_managed/main/scala/com/amazonaws/dynamodb/AttributeValue.scala | ||
$ exists target/scala-2.13/src_managed/main/scala/smithy4s/com/amazonaws/dynamodb/AttributeValue.scala |
10 changes: 5 additions & 5 deletions
10
modules/codegen-plugin/src/sbt-test/codegen-plugin/custom-settings/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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
# check if smithy4sCodegen works | ||
> show p1/smithy4sAllExternalDependencies | ||
> p1/compile | ||
$ exists p1/smithy_output/aws/iam/ActionPermissionDescription.scala | ||
$ exists p1/smithy_output/smithy4s/example/ObjectService.scala | ||
$ exists p1/smithy_output/smithy4s/aws/iam/ActionPermissionDescription.scala | ||
$ exists p1/smithy_output/smithy4s/smithy4s/example/ObjectService.scala | ||
|
||
> p2/compile | ||
$ exists p2/smithy_output/aws/iam/ActionPermissionDescription.scala | ||
$ exists p2/smithy_output/smithy4s/example/ObjectService.scala | ||
-$ exists p2/smithy_output/smithy4s/toexclude/StructureToExclude.scala | ||
$ exists p2/smithy_output/smithy4s/aws/iam/ActionPermissionDescription.scala | ||
$ exists p2/smithy_output/smithy4s/smithy4s/example/ObjectService.scala | ||
-$ exists p2/smithy_output/smithy4s/smithy4s/toexclude/StructureToExclude.scala |
6 changes: 3 additions & 3 deletions
6
modules/codegen-plugin/src/sbt-test/codegen-plugin/defaults/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 |
---|---|---|
@@ -1,18 +1,18 @@ | ||
# check if smithy4sCodegen works | ||
> compile | ||
$ exists target/scala-2.13/src_managed/main/scala/smithy4s/example/ObjectService.scala | ||
$ exists target/scala-2.13/src_managed/main/scala/smithy4s/smithy4s/example/ObjectService.scala | ||
$ exists target/scala-2.13/resource_managed/main/smithy4s.example.ObjectService.json | ||
|
||
# check if code can run, this can reveal runtime issues | ||
# such as initialization errors | ||
> run | ||
$ copy-file example-added.smithy src/main/smithy/example-added.smithy | ||
> compile | ||
$ exists target/scala-2.13/src_managed/main/scala/smithy4s/example/Added.scala | ||
$ exists target/scala-2.13/src_managed/main/scala/smithy4s/smithy4s/example/Added.scala | ||
|
||
# ensuring that removing existing files removes their outputs | ||
$ delete src/main/smithy/example.smithy | ||
-> compile | ||
|
||
> smithy4sUpdateLSPConfig | ||
> checkSmithyBuild | ||
> checkSmithyBuild |
2 changes: 1 addition & 1 deletion
2
modules/codegen-plugin/src/sbt-test/codegen-plugin/dependencies-only/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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# check if smithy4sCodegen works | ||
> p1/compile | ||
$ exists p1/smithy_output/aws/iam/ActionPermissionDescription.scala | ||
$ exists p1/smithy_output/smithy4s/aws/iam/ActionPermissionDescription.scala |
4 changes: 2 additions & 2 deletions
4
modules/codegen-plugin/src/sbt-test/codegen-plugin/extra-configs/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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# check if main sources are generated | ||
> compile | ||
$ exists target/scala-2.13/src_managed/main/scala/example/ExampleStruct.scala | ||
$ exists target/scala-2.13/src_managed/main/scala/smithy4s/example/ExampleStruct.scala | ||
|
||
# check if test sources are generated | ||
> Test/compile | ||
$ exists target/scala-2.13/src_managed/test/scala/testexample/TestStruct.scala | ||
$ exists target/scala-2.13/src_managed/test/scala/smithy4s/testexample/TestStruct.scala |
4 changes: 2 additions & 2 deletions
4
modules/codegen-plugin/src/sbt-test/codegen-plugin/multimodule-aws/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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# check if smithy4sCodegen works with libraries that were built with Smithy4s | ||
> show bar/smithy4sAllExternalDependencies | ||
> compile | ||
$ exists foo/target/scala-2.13/src_managed/main/scala/foo/Lambda.scala | ||
$ absent bar/target/scala-2.13/src_managed/main/scala/foo/Lambda.scala | ||
$ exists foo/target/scala-2.13/src_managed/main/scala/smithy4s/foo/Lambda.scala | ||
$ absent bar/target/scala-2.13/src_managed/main/scala/smithy4s/foo/Lambda.scala |
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
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
8 changes: 4 additions & 4 deletions
8
modules/codegen-plugin/src/sbt-test/codegen-plugin/scala3/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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
# check if smithy4sCodegen works | ||
> compile | ||
|
||
$ exists target/scala-3.3.0/src_managed/main/scala/smithy4s/errors/BadRequest.scala | ||
$ exists target/scala-3.3.0/src_managed/main/scala/smithy4s/errors/InternalServerError.scala | ||
$ exists target/scala-3.3.0/src_managed/main/scala/smithy4s/errors/ErrorService.scala | ||
$ exists target/scala-3.3.0/src_managed/main/scala/smithy4s/errors/package.scala | ||
$ exists target/scala-3.3.0/src_managed/main/scala/smithy4s/smithy4s/errors/BadRequest.scala | ||
$ exists target/scala-3.3.0/src_managed/main/scala/smithy4s/smithy4s/errors/InternalServerError.scala | ||
$ exists target/scala-3.3.0/src_managed/main/scala/smithy4s/smithy4s/errors/ErrorService.scala | ||
$ exists target/scala-3.3.0/src_managed/main/scala/smithy4s/smithy4s/errors/package.scala | ||
|
||
# check if code can run | ||
> run |
4 changes: 2 additions & 2 deletions
4
modules/codegen-plugin/src/sbt-test/codegen-plugin/smithy-build/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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# check if smithy4sCodegen works | ||
> compile | ||
$ exists target/scala-2.13/src_managed/main/scala/smithy4s/example/ObjectService.scala | ||
$ exists target/scala-2.13/src_managed/main/scala/smithy4s/smithy4s/example/ObjectService.scala | ||
$ exists target/scala-2.13/resource_managed/main/smithy4s.example.ObjectService.json | ||
> checkOpenApi | ||
> checkOpenApi |
2 changes: 1 addition & 1 deletion
2
modules/codegen-plugin/src/sbt-test/codegen-plugin/smithy-rules/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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# check if smithy4sCodegen works | ||
> compile | ||
$ exists target/scala-2.13/src_managed/main/scala/smithy/rules | ||
$ exists target/scala-2.13/src_managed/main/scala/smithy4s/smithy/rules |
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
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
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,19 @@ | ||
/* | ||
* Copyright 2021-2024 Disney Streaming | ||
* | ||
* Licensed under the Tomorrow Open Source Technology License, Version 1.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://disneystreaming.github.io/TOST-1.0.txt | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package smithy4s.codegen | ||
|
||
final case class PathRef(underlying: os.Path) |
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
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
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