-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
642 additions
and
23 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
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,27 @@ | ||
// This example builds Smithy models but does not create a JAR. | ||
|
||
plugins { | ||
java | ||
} | ||
|
||
buildscript { | ||
repositories { | ||
mavenLocal() | ||
} | ||
dependencies { | ||
classpath("software.amazon.smithy:smithy-gradle-plugin:0.0.1") | ||
} | ||
} | ||
|
||
apply(plugin = "software.amazon.smithy") | ||
|
||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation("software.amazon.smithy:smithy-model:0.4.1") | ||
} | ||
|
||
tasks["jar"].enabled = false |
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,5 @@ | ||
namespace smithy.example | ||
|
||
structure Example { | ||
foo: String | ||
} |
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,7 @@ | ||
rootProject.name = "disable-jar" | ||
|
||
pluginManagement { | ||
repositories { | ||
mavenLocal() | ||
} | ||
} |
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 @@ | ||
{ | ||
"version": "1.0" | ||
} |
29 changes: 29 additions & 0 deletions
29
examples/failure-cases/invalid-projection/build.gradle.kts
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,29 @@ | ||
// This example attempts to use an invalid projection. The build will fail. | ||
|
||
plugins { | ||
java | ||
} | ||
|
||
buildscript { | ||
repositories { | ||
mavenLocal() | ||
} | ||
dependencies { | ||
classpath("software.amazon.smithy:smithy-gradle-plugin:0.0.1") | ||
} | ||
} | ||
|
||
apply(plugin = "software.amazon.smithy") | ||
|
||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation("software.amazon.smithy:smithy-model:0.4.1") | ||
} | ||
|
||
configure<software.amazon.smithy.gradle.SmithyExtension> { | ||
projection = "invalid" | ||
} |
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,5 @@ | ||
namespace smithy.example | ||
|
||
structure Foo { | ||
foo: String | ||
} |
2 changes: 1 addition & 1 deletion
2
test-kotlin/settings.gradle.kts → ...es/invalid-projection/settings.gradle.kts
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,4 +1,4 @@ | ||
rootProject.name = "test" | ||
rootProject.name = "projection" | ||
|
||
pluginManagement { | ||
repositories { | ||
|
2 changes: 1 addition & 1 deletion
2
test-kotlin/smithy-build.json → ...ases/invalid-projection/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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"version": "1.0", | ||
"projections": { | ||
"trimmed": {} | ||
"foo": {} | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
examples/failure-cases/missing-runtime-dependency/build.gradle.kts
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,39 @@ | ||
// This example creates a projected version of the model, but because the | ||
// projected model references traits from another package and that package | ||
// is not part of the runtime dependencies, the build will fail when the | ||
// plugin validates the JAR with Smithy model discovery. | ||
|
||
plugins { | ||
java | ||
} | ||
|
||
buildscript { | ||
repositories { | ||
mavenLocal() | ||
} | ||
dependencies { | ||
classpath("software.amazon.smithy:smithy-gradle-plugin:0.0.1") | ||
|
||
// This dependency is required to build the model. | ||
classpath("software.amazon.smithy:smithy-aws-traits:0.4.1") | ||
} | ||
} | ||
|
||
apply(plugin = "software.amazon.smithy") | ||
|
||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation("software.amazon.smithy:smithy-model:0.4.1") | ||
|
||
// This dependency is used in the projected model, so it's required here too. | ||
// This should fail to build since this is missing. | ||
//implementation("software.amazon.smithy:smithy-aws-traits:0.4.1") | ||
} | ||
|
||
configure<software.amazon.smithy.gradle.SmithyExtension> { | ||
projection = "foo" | ||
} |
File renamed without changes.
7 changes: 7 additions & 0 deletions
7
examples/failure-cases/missing-runtime-dependency/settings.gradle.kts
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,7 @@ | ||
rootProject.name = "projection" | ||
|
||
pluginManagement { | ||
repositories { | ||
mavenLocal() | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
examples/failure-cases/missing-runtime-dependency/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,6 @@ | ||
{ | ||
"version": "1.0", | ||
"projections": { | ||
"foo": {} | ||
} | ||
} |
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,28 @@ | ||
// This example pulls Smithy models from the following locations: | ||
// - model/ | ||
// - src/main/smithy/ | ||
// - src/main/resources/META-INF/smithy | ||
|
||
plugins { | ||
java | ||
} | ||
|
||
buildscript { | ||
repositories { | ||
mavenLocal() | ||
} | ||
dependencies { | ||
classpath("software.amazon.smithy:smithy-gradle-plugin:0.0.1") | ||
} | ||
} | ||
|
||
apply(plugin = "software.amazon.smithy") | ||
|
||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation("software.amazon.smithy:smithy-model:0.4.1") | ||
} |
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 smithy.example | ||
|
||
structure A {} |
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,7 @@ | ||
rootProject.name = "multiple-sources" | ||
|
||
pluginManagement { | ||
repositories { | ||
mavenLocal() | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
examples/multiple-sources/src/main/resources/META-INF/smithy/c.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,5 @@ | ||
namespace smithy.example | ||
|
||
structure C { | ||
foo: String | ||
} |
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,5 @@ | ||
namespace smithy.example | ||
|
||
structure B { | ||
foo: String | ||
} |
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,35 @@ | ||
// This example places a projected version of the model into the JAR. | ||
|
||
plugins { | ||
java | ||
} | ||
|
||
buildscript { | ||
repositories { | ||
mavenLocal() | ||
} | ||
dependencies { | ||
classpath("software.amazon.smithy:smithy-gradle-plugin:0.0.1") | ||
|
||
// This dependency is required to build the model. | ||
classpath("software.amazon.smithy:smithy-aws-traits:0.4.1") | ||
} | ||
} | ||
|
||
apply(plugin = "software.amazon.smithy") | ||
|
||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation("software.amazon.smithy:smithy-model:0.4.1") | ||
|
||
// This dependency is used in the projected model, so it's requird here too. | ||
implementation("software.amazon.smithy:smithy-aws-traits:0.4.1") | ||
} | ||
|
||
configure<software.amazon.smithy.gradle.SmithyExtension> { | ||
projection = "foo" | ||
} |
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 @@ | ||
namespace smithy.example | ||
|
||
structure Baz { | ||
foo: String | ||
} | ||
|
||
@aws.api#unsignedPayload | ||
operation Foo() |
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,7 @@ | ||
rootProject.name = "projection" | ||
|
||
pluginManagement { | ||
repositories { | ||
mavenLocal() | ||
} | ||
} |
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,6 @@ | ||
{ | ||
"version": "1.0", | ||
"projections": { | ||
"foo": {} | ||
} | ||
} |
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,8 @@ | ||
namespace smithy.example | ||
|
||
structure Baz { | ||
foo: String | ||
} | ||
|
||
@aws.api#unsignedPayload | ||
operation Foo() |
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,7 @@ | ||
rootProject.name = "source-projection" | ||
|
||
pluginManagement { | ||
repositories { | ||
mavenLocal() | ||
} | ||
} |
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,6 @@ | ||
{ | ||
"version": "1.0", | ||
"projections": { | ||
"foo": {} | ||
} | ||
} |
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 @@ | ||
org.gradle.parallel=true |
Oops, something went wrong.