Skip to content

Commit c627e2f

Browse files
committed
Add project for protocol test codegen
This commit adds a separate Gradle project that depends on the published version of the smithy-aws-protocol-tests. This new project contains 1 projection for each protocol, generating the full AWS SDK for JS V3 client and test suite for each contained service.
1 parent 6667e3a commit c627e2f

File tree

3 files changed

+140
-8
lines changed

3 files changed

+140
-8
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
import software.amazon.smithy.gradle.tasks.SmithyBuild
17+
18+
plugins {
19+
id("software.amazon.smithy") version "0.4.3"
20+
}
21+
22+
dependencies {
23+
implementation("software.amazon.smithy:smithy-aws-protocol-tests:0.9.8")
24+
compile(project(":smithy-aws-typescript-codegen"))
25+
}
26+
27+
// This project doesn't produce a JAR.
28+
tasks["jar"].enabled = false
29+
30+
// Run the SmithyBuild task manually since this project needs the built JAR
31+
// from smithy-aws-typescript-codegen.
32+
tasks["smithyBuildJar"].enabled = false
33+
34+
tasks.create<SmithyBuild>("buildSdk") {
35+
addRuntimeClasspath = true
36+
}
37+
38+
// Run the `buildSdk` automatically.
39+
tasks["build"].finalizedBy(tasks["buildSdk"])
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
{
2+
"version": "1.0",
3+
"projections": {
4+
"aws-ec2": {
5+
"transforms": [
6+
{"name": "includeServices", "args": ["aws.protocols.tests.ec2#AwsEc2"]}
7+
],
8+
"plugins": {
9+
"typescript-codegen": {
10+
"package": "@aws-sdk/protocol-tests-aws-ec2",
11+
"packageVersion": "1.0.0-alpha.1",
12+
"packageJson": {
13+
"author": {
14+
"name": "AWS SDK for JavaScript Team",
15+
"url": "https://aws.amazon.com/javascript/"
16+
},
17+
"license": "Apache-2.0"
18+
},
19+
"protocol": "aws.ec2"
20+
}
21+
}
22+
},
23+
"aws-json": {
24+
"transforms": [
25+
{"name": "includeServices", "args": ["aws.protocols.tests.json#JsonProtocol"]}
26+
],
27+
"plugins": {
28+
"typescript-codegen": {
29+
"package": "@aws-sdk/protocol-tests-aws-json",
30+
"packageVersion": "1.0.0-alpha.1",
31+
"packageJson": {
32+
"author": {
33+
"name": "AWS SDK for JavaScript Team",
34+
"url": "https://aws.amazon.com/javascript/"
35+
},
36+
"license": "Apache-2.0"
37+
},
38+
"protocol": "aws.json-1.1"
39+
}
40+
}
41+
},
42+
"aws-query": {
43+
"transforms": [
44+
{"name": "includeServices", "args": ["aws.protocols.tests.query#AwsQuery"]}
45+
],
46+
"plugins": {
47+
"typescript-codegen": {
48+
"package": "@aws-sdk/protocol-tests-aws-query",
49+
"packageVersion": "1.0.0-alpha.1",
50+
"packageJson": {
51+
"author": {
52+
"name": "AWS SDK for JavaScript Team",
53+
"url": "https://aws.amazon.com/javascript/"
54+
},
55+
"license": "Apache-2.0"
56+
},
57+
"protocol": "aws.query"
58+
}
59+
}
60+
},
61+
"aws-restjson": {
62+
"transforms": [
63+
{"name": "includeServices", "args": ["aws.protocols.tests.restjson#RestJson"]}
64+
],
65+
"plugins": {
66+
"typescript-codegen": {
67+
"package": "@aws-sdk/protocol-tests-aws-restjson",
68+
"packageVersion": "1.0.0-alpha.1",
69+
"packageJson": {
70+
"author": {
71+
"name": "AWS SDK for JavaScript Team",
72+
"url": "https://aws.amazon.com/javascript/"
73+
},
74+
"license": "Apache-2.0"
75+
},
76+
"protocol": "aws.rest-json-1.1"
77+
}
78+
}
79+
},
80+
"aws-restxml": {
81+
"transforms": [
82+
{"name": "includeServices", "args": ["aws.protocols.tests.restxml#RestXml"]}
83+
],
84+
"plugins": {
85+
"typescript-codegen": {
86+
"package": "@aws-sdk/protocol-tests-aws-restxml",
87+
"packageVersion": "1.0.0-alpha.1",
88+
"packageJson": {
89+
"author": {
90+
"name": "AWS SDK for JavaScript Team",
91+
"url": "https://aws.amazon.com/javascript/"
92+
},
93+
"license": "Apache-2.0"
94+
},
95+
"protocol": "aws.rest-xml"
96+
}
97+
}
98+
}
99+
}
100+
}

codegen/settings.gradle.kts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,4 @@
1616
rootProject.name = "codegen"
1717
include(":smithy-aws-typescript-codegen")
1818
include(":sdk-codegen")
19-
20-
// TODO: remove once smithy-gradle-plugin:0.4.0 is published.
21-
pluginManagement {
22-
repositories {
23-
mavenLocal()
24-
gradlePluginPortal()
25-
}
26-
}
19+
include(":protocol-test-codegen")

0 commit comments

Comments
 (0)