@@ -7,179 +7,74 @@ import class Foundation.FileManager
77let baseDir = " ./protocol-test-codegen/build/smithyprojections/protocol-test-codegen "
88let baseDirLocal = " ./protocol-test-codegen-local/build/smithyprojections/protocol-test-codegen-local "
99
10- let package = Package (
10+ var package = Package (
1111 name: " ProtocolCodegenTests " ,
1212 platforms: [
1313 . macOS( . v10_15) , . iOS( . v13)
1414 ] ,
1515 products: [
16- . library( name: " AWSRestJsonTestSDK " , targets: [ " AWSRestJsonTestSDK " ] ) ,
17- . library( name: " AWSJson1_0TestSDK " , targets: [ " AWSJson1_0TestSDK " ] ) ,
18- . library( name: " AWSJson1_1TestSDK " , targets: [ " AWSJson1_1TestSDK " ] ) ,
19- . library( name: " RestXmlTestSDK " , targets: [ " RestXmlTestSDK " ] ) ,
20- . library( name: " AWSQueryTestSDK " , targets: [ " AWSQueryTestSDK " ] ) ,
21-
22- . library( name: " aws_restjson " , targets: [ " aws_restjson " ] ) ,
23- . library( name: " rest_json_extras " , targets: [ " rest_json_extras " ] )
2416 ] ,
2517 targets: [
26- . target(
27- name: " AWSRestJsonTestSDK " ,
28- dependencies: [
29- . product( name: " ClientRuntime " ,
30- package : " ClientRuntime "
31- ) ,
32- . product(
33- name: " AWSClientRuntime " ,
34- package : " AWSClientRuntime "
35- ) ,
36- ] ,
37- path: " \( baseDir) /aws-restjson/swift-codegen/AWSRestJsonTestSDK "
38- ) ,
39- . testTarget(
40- name: " AWSRestJsonTestSDKTests " ,
41- dependencies: [
42- " AWSRestJsonTestSDK " ,
43- . product( name: " SmithyTestUtil " , package : " ClientRuntime " )
44- ] ,
45- path: " \( baseDir) /aws-restjson/swift-codegen/AWSRestJsonTestSDKTests "
46- ) ,
47-
48- . target(
49- name: " AWSJson1_0TestSDK " ,
50- dependencies: [
51- . product(
52- name: " ClientRuntime " ,
53- package : " ClientRuntime "
54- ) ,
55- . product(
56- name: " AWSClientRuntime " ,
57- package : " AWSClientRuntime "
58- ) ,
59- ] ,
60- path: " \( baseDir) /aws-json-10/swift-codegen/AWSJson1_0TestSDK "
61- ) ,
62- . testTarget(
63- name: " AWSJson1_0TestSDKTests " ,
64- dependencies: [
65- " AWSJson1_0TestSDK " ,
66- . product( name: " SmithyTestUtil " , package : " ClientRuntime " )
67- ] ,
68- path: " \( baseDir) /aws-json-10/swift-codegen/AWSJson1_0TestSDKTests "
69- ) ,
70- . target(
71- name: " AWSJson1_1TestSDK " ,
72- dependencies: [
73- . product(
74- name: " ClientRuntime " ,
75- package : " ClientRuntime "
76- ) ,
77- . product(
78- name: " AWSClientRuntime " ,
79- package : " AWSClientRuntime "
80- ) ,
81- ] ,
82- path: " \( baseDir) /aws-json-11/swift-codegen/AWSJson1_1TestSDK "
83- ) ,
84- . testTarget(
85- name: " AWSJson1_1TestSDKTests " ,
86- dependencies: [
87- " AWSJson1_1TestSDK " ,
88- . product( name: " SmithyTestUtil " , package : " ClientRuntime " )
89- ] ,
90- path: " \( baseDir) /aws-json-11/swift-codegen/AWSJson1_1TestSDKTests "
91- ) ,
92- . target(
93- name: " RestXmlTestSDK " ,
94- dependencies: [
95- . product(
96- name: " ClientRuntime " ,
97- package : " ClientRuntime "
98- ) ,
99- . product(
100- name: " AWSClientRuntime " ,
101- package : " AWSClientRuntime "
102- ) ,
103- ] ,
104- path: " \( baseDir) /rest-xml/swift-codegen/RestXmlTestSDK "
105- ) ,
106- . testTarget(
107- name: " RestXmlTestSDKTests " ,
108- dependencies: [
109- " RestXmlTestSDK " ,
110- . product( name: " SmithyTestUtil " , package : " ClientRuntime " )
111- ] ,
112- path: " \( baseDir) /rest-xml/swift-codegen/RestXmlTestSDKTests "
113- ) ,
114- . target(
115- name: " AWSQueryTestSDK " ,
116- dependencies: [
117- . product(
118- name: " ClientRuntime " ,
119- package : " ClientRuntime "
120- ) ,
121- . product(
122- name: " AWSClientRuntime " ,
123- package : " AWSClientRuntime "
124- ) ,
125- ] ,
126- path: " \( baseDir) /aws-query/swift-codegen/AWSQueryTestSDK "
127- ) ,
128- . testTarget(
129- name: " AWSQueryTestSDKTests " ,
130- dependencies: [
131- " AWSQueryTestSDK " ,
132- . product( name: " SmithyTestUtil " , package : " ClientRuntime " )
133- ] ,
134- path: " \( baseDir) /aws-query/swift-codegen/AWSQueryTestSDKTests "
135- ) ,
136- . target(
137- name: " aws_restjson " ,
138- dependencies: [
139- . product(
140- name: " ClientRuntime " ,
141- package : " ClientRuntime "
142- ) ,
143- . product(
144- name: " AWSClientRuntime " ,
145- package : " AWSClientRuntime "
146- ) ,
147- ] ,
148- path: " \( baseDirLocal) /aws-restjson/swift-codegen/aws_restjson "
149- ) ,
150- . testTarget(
151- name: " aws_restjsonTests " ,
152- dependencies: [
153- " aws_restjson " ,
154- . product( name: " SmithyTestUtil " , package : " ClientRuntime " )
155- ] ,
156- path: " \( baseDirLocal) /aws-restjson/swift-codegen/aws_restjsonTests "
157- ) ,
158- . target(
159- name: " rest_json_extras " ,
160- dependencies: [
161- . product(
162- name: " ClientRuntime " ,
163- package : " ClientRuntime "
164- ) ,
165- . product(
166- name: " AWSClientRuntime " ,
167- package : " AWSClientRuntime "
168- ) ,
169- ] ,
170- path: " \( baseDirLocal) /rest_json_extras/swift-codegen/rest_json_extras "
171- ) ,
172- . testTarget(
173- name: " rest_json_extrasTests " ,
174- dependencies: [
175- " rest_json_extras " ,
176- . product( name: " SmithyTestUtil " , package : " ClientRuntime " )
177- ] ,
178- path: " \( baseDirLocal) /rest_json_extras/swift-codegen/rest_json_extrasTests "
179- )
18018 ]
18119)
182-
20+
21+ appendLibTarget ( name: " AWSRestJsonTestSDK " , path: " \( baseDir) /aws-restjson " )
22+ appendTstTarget ( name: " AWSRestJsonTestSDKTests " , path: " \( baseDir) /aws-restjson " , dependency: " AWSRestJsonTestSDK " )
23+
24+ appendLibTarget ( name: " AWSJson1_0TestSDK " , path: " \( baseDir) /aws-json-10 " )
25+ appendTstTarget ( name: " AWSJson1_0TestSDKTests " , path: " \( baseDir) /aws-json-10 " , dependency: " AWSJson1_0TestSDK " )
26+
27+ appendLibTarget ( name: " AWSJson1_1TestSDK " , path: " \( baseDir) /aws-json-11 " )
28+ appendTstTarget ( name: " AWSJson1_1TestSDKTests " , path: " \( baseDir) /aws-json-11 " , dependency: " AWSJson1_1TestSDK " )
29+
30+ appendLibTarget ( name: " RestXmlTestSDK " , path: " \( baseDir) /rest-xml " )
31+ appendTstTarget ( name: " RestXmlTestSDKTests " , path: " \( baseDir) /rest-xml " , dependency: " RestXmlTestSDK " )
32+
33+ appendLibTarget ( name: " AWSQueryTestSDK " , path: " \( baseDir) /aws-query " )
34+ appendTstTarget ( name: " AWSQueryTestSDKTests " , path: " \( baseDir) /aws-query " , dependency: " AWSQueryTestSDK " )
35+
36+ //Service specific
37+ //appendLibTarget(name: "S3TestSDK", path: "\(baseDir)/s3")
38+ //appendTstTarget(name: "S3TestSDKTests", path: "\(baseDir)/s3", dependency: "S3TestSDK")
39+
40+ //Local tests
41+ appendLibTarget ( name: " aws_restjson " , path: " \( baseDirLocal) /aws-restjson " )
42+ appendTstTarget ( name: " aws_restjsonTests " , path: " \( baseDirLocal) /aws-restjson " , dependency: " aws_restjson " )
43+ appendLibTarget ( name: " rest_json_extras " , path: " \( baseDirLocal) /rest_json_extras " )
44+ appendTstTarget ( name: " rest_json_extrasTests " , path: " \( baseDirLocal) /rest_json_extras " , dependency: " rest_json_extras " )
45+
46+ func appendLibTarget( name: String , path: String ) {
47+ package . targets. append (
48+ . target( name: name,
49+ dependencies: [
50+ . product(
51+ name: " ClientRuntime " ,
52+ package : " ClientRuntime "
53+ ) ,
54+ . product(
55+ name: " AWSClientRuntime " ,
56+ package : " AWSClientRuntime "
57+ ) ,
58+ ] ,
59+ path: " \( path) /swift-codegen/ \( name) " )
60+ )
61+ package . products. append (
62+ . library( name: name, targets: [ name] )
63+ )
64+ }
65+
66+ func appendTstTarget( name: String , path: String , dependency: String ) {
67+ package . targets. append ( . testTarget( name: name,
68+ dependencies: [
69+ . _byNameItem( name: dependency, condition: nil ) ,
70+ . product( name: " SmithyTestUtil " , package : " ClientRuntime " )
71+ ] ,
72+ path: " \( path) /swift-codegen/ \( name) " )
73+ )
74+ }
75+
76+
77+
18378if let smithySwiftDir = ProcessInfo . processInfo. environment [ " SMITHY_SWIFT_CI_DIR " ] ,
18479 let sdkDir = ProcessInfo . processInfo. environment [ " AWS_SDK_SWIFT_CI_DIR " ] {
18580 package . dependencies += [
0 commit comments