Skip to content

Commit fc0bc08

Browse files
Update integration test to repro issue with AOT codegen on targets with dependencies
1 parent 576e620 commit fc0bc08

File tree

10 files changed

+39
-0
lines changed

10 files changed

+39
-0
lines changed

.licenseignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,4 @@ Examples/streaming-chatgpt-proxy/players.txt
4343
**/Makefile
4444
**/*.html
4545
.editorconfig
46+
IntegrationTest/**/Empty.swift

IntegrationTest/Package.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,15 @@ let package = Package(
5151
name: "MockTransportServer",
5252
dependencies: ["Server", .product(name: "OpenAPIRuntime", package: "swift-openapi-runtime")]
5353
),
54+
// Targets to integration test the command plugin
55+
.target(name: "Empty"),
56+
.target(
57+
name: "TypesAOT",
58+
dependencies: [.product(name: "OpenAPIRuntime", package: "swift-openapi-runtime")],
59+
),
60+
.target(
61+
name: "TypesAOTWithDependency",
62+
dependencies: ["Empty", .product(name: "OpenAPIRuntime", package: "swift-openapi-runtime")],
63+
),
5464
]
5565
)

IntegrationTest/Sources/Empty/Empty.swift

Whitespace-only changes.

IntegrationTest/Sources/TypesAOT/Empty.swift

Whitespace-only changes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
generate:
2+
- types
3+
accessModifier: package
4+
namingStrategy: idiomatic
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../openapi.yaml

IntegrationTest/Sources/TypesAOTWithDependency/Empty.swift

Whitespace-only changes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
generate:
2+
- types
3+
accessModifier: package
4+
namingStrategy: idiomatic
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../openapi.yaml

scripts/run-integration-test.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,22 @@ log "Running command plugin on integration test package: ${INTEGRATION_TEST_PACK
4949
swift package --package-path "${INTEGRATION_TEST_PACKAGE_PATH}" \
5050
--allow-writing-to-package-directory generate-code-from-openapi
5151

52+
log "Running command plugin on integration test package AOT target: ${INTEGRATION_TEST_PACKAGE_PATH}"
53+
swift package --package-path "${INTEGRATION_TEST_PACKAGE_PATH}" \
54+
--allow-writing-to-package-directory generate-code-from-openapi \
55+
--target TypesAOT
56+
57+
log "Building integration test package AOT target: ${INTEGRATION_TEST_PACKAGE_PATH}"
58+
swift build --package-path "${INTEGRATION_TEST_PACKAGE_PATH}" \
59+
--target TypesAOT
60+
61+
log "Running command plugin on integration test package AOT target with dependency: ${INTEGRATION_TEST_PACKAGE_PATH}"
62+
swift package --package-path "${INTEGRATION_TEST_PACKAGE_PATH}" \
63+
--allow-writing-to-package-directory generate-code-from-openapi \
64+
--target TypesAOTWithDependency
65+
66+
log "Building integration test package AOT target with dependency: ${INTEGRATION_TEST_PACKAGE_PATH}"
67+
swift build --package-path "${INTEGRATION_TEST_PACKAGE_PATH}" \
68+
--target TypesAOTWithDependency
69+
5270
log "✅ Successfully built integration test package."

0 commit comments

Comments
 (0)