-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add --mode arbitrary|project to smithy diff
This commit adds a --mode option to Smithy diff to support the arbitrary mode (the current mode used to compare two models), and the project mode used to compare the current project against another project or model. When running in project mode, the imports and sources of the current model are used to load the "new" model (the current project), but they aren't used to load the "old" model. If the --old argument points to a directory that contains a smithy-build.json file, its imports and sources are used when loading the old model, though its dependencies are ignored and it's loaded using the resolved classpath of the new model. This ensures that the models are comparable and won't cause comparison issues when trying to compare things like traits across class loaders.
- Loading branch information
Showing
10 changed files
with
239 additions
and
56 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
9 changes: 9 additions & 0 deletions
9
...s/software/amazon/smithy/cli/projects/diff-example-conflict-with-simple/model/main.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,9 @@ | ||
$version: "2.0" | ||
namespace smithy.example | ||
|
||
// See the DiffCommandTest#projectModeUsesConfigOfOldModel integration test. | ||
// | ||
// This is to cause a diff event when compared against simple-config-sources, ensuring that the config file of this | ||
// project is used and not the config file of the "new" model. If the new model's config was also loaded, the | ||
// integration test would create a shape conflict error after loading. | ||
integer MyString |
4 changes: 4 additions & 0 deletions
4
...s/software/amazon/smithy/cli/projects/diff-example-conflict-with-simple/smithy-build.json
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 @@ | ||
{ | ||
"version": "1.0", | ||
"sources": ["model"] | ||
} |
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
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
Oops, something went wrong.