Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions AWSSDKSwiftCLI/Sources/AWSCLIUtils/FileManager+Utils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public extension FileManager {
.contentsOfDirectory(atPath: "../smithy-swift/Sources")
.sorted()
.filter { $0 != "libxml2" } // Ignore libxml module
.filter { $0 != "SmithyCodegenCLI" } // Ignore codegen component
.filter { $0 != "SmithyCodegenCore" } // Ignore codegen component
.filter { !$0.hasPrefix(".") }
}

Expand Down
20 changes: 15 additions & 5 deletions AWSSDKSwiftCLI/Sources/AWSSDKSwiftCLI/Resources/Package.Base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ extension Target.Dependency {
static var SmithyXML: Self { .product(name: "SmithyXML", package: "smithy-swift") }
}

extension Target.PluginUsage {
// Smithy plugins
static var SmithyCodeGenerator: Self { .plugin(name: "SmithyCodeGenerator", package: "smithy-swift") }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Above, a convenience var with the code generator plugin is defined.

Below, the plugin is inserted into all of our service clients (public and internal.)

// MARK: Base Package

let package = Package(
Expand Down Expand Up @@ -198,22 +203,26 @@ private var runtimeTargets: [Target] {
.target(
name: "InternalAWSSTS",
dependencies: internalAWSSTSDependencies,
path: "Sources/Core/AWSSDKIdentity/InternalClients/InternalAWSSTS/Sources/InternalAWSSTS"
path: "Sources/Core/AWSSDKIdentity/InternalClients/InternalAWSSTS/Sources/InternalAWSSTS",
plugins: [.SmithyCodeGenerator]
),
.target(
name: "InternalAWSSSO",
dependencies: internalAWSSSODependencies,
path: "Sources/Core/AWSSDKIdentity/InternalClients/InternalAWSSSO/Sources/InternalAWSSSO"
path: "Sources/Core/AWSSDKIdentity/InternalClients/InternalAWSSSO/Sources/InternalAWSSSO",
plugins: [.SmithyCodeGenerator]
),
.target(
name: "InternalAWSSSOOIDC",
dependencies: internalAWSSSOOIDCDependencies,
path: "Sources/Core/AWSSDKIdentity/InternalClients/InternalAWSSSOOIDC/Sources/InternalAWSSSOOIDC"
path: "Sources/Core/AWSSDKIdentity/InternalClients/InternalAWSSSOOIDC/Sources/InternalAWSSSOOIDC",
plugins: [.SmithyCodeGenerator]
),
.target(
name: "InternalAWSCognitoIdentity",
dependencies: internalAWSCognitoIdentityDependencies,
path: "Sources/Core/AWSSDKIdentity/InternalClients/InternalAWSCognitoIdentity/Sources/InternalAWSCognitoIdentity"
path: "Sources/Core/AWSSDKIdentity/InternalClients/InternalAWSCognitoIdentity/Sources/InternalAWSCognitoIdentity",
plugins: [.SmithyCodeGenerator]
),
.target(
name: "AWSSDKChecksums",
Expand Down Expand Up @@ -286,7 +295,8 @@ private func target(_ service: String, _ dependencies: [Target.Dependency]) -> T
.target(
name: service,
dependencies: dependencies,
path: "Sources/Services/\(service)/Sources/\(service)"
path: "Sources/Services/\(service)/Sources/\(service)",
plugins: [.SmithyCodeGenerator]
)
}

Expand Down
20 changes: 15 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,11 @@ extension Target.Dependency {
static var SmithyXML: Self { .product(name: "SmithyXML", package: "smithy-swift") }
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything below is just a copy of the changes in Package.base.txt above


extension Target.PluginUsage {
// Smithy plugins
static var SmithyCodeGenerator: Self { .plugin(name: "SmithyCodeGenerator", package: "smithy-swift") }
}

// MARK: Base Package

let package = Package(
Expand Down Expand Up @@ -636,22 +641,26 @@ private var runtimeTargets: [Target] {
.target(
name: "InternalAWSSTS",
dependencies: internalAWSSTSDependencies,
path: "Sources/Core/AWSSDKIdentity/InternalClients/InternalAWSSTS/Sources/InternalAWSSTS"
path: "Sources/Core/AWSSDKIdentity/InternalClients/InternalAWSSTS/Sources/InternalAWSSTS",
plugins: [.SmithyCodeGenerator]
),
.target(
name: "InternalAWSSSO",
dependencies: internalAWSSSODependencies,
path: "Sources/Core/AWSSDKIdentity/InternalClients/InternalAWSSSO/Sources/InternalAWSSSO"
path: "Sources/Core/AWSSDKIdentity/InternalClients/InternalAWSSSO/Sources/InternalAWSSSO",
plugins: [.SmithyCodeGenerator]
),
.target(
name: "InternalAWSSSOOIDC",
dependencies: internalAWSSSOOIDCDependencies,
path: "Sources/Core/AWSSDKIdentity/InternalClients/InternalAWSSSOOIDC/Sources/InternalAWSSSOOIDC"
path: "Sources/Core/AWSSDKIdentity/InternalClients/InternalAWSSSOOIDC/Sources/InternalAWSSSOOIDC",
plugins: [.SmithyCodeGenerator]
),
.target(
name: "InternalAWSCognitoIdentity",
dependencies: internalAWSCognitoIdentityDependencies,
path: "Sources/Core/AWSSDKIdentity/InternalClients/InternalAWSCognitoIdentity/Sources/InternalAWSCognitoIdentity"
path: "Sources/Core/AWSSDKIdentity/InternalClients/InternalAWSCognitoIdentity/Sources/InternalAWSCognitoIdentity",
plugins: [.SmithyCodeGenerator]
),
.target(
name: "AWSSDKChecksums",
Expand Down Expand Up @@ -724,7 +733,8 @@ private func target(_ service: String, _ dependencies: [Target.Dependency]) -> T
.target(
name: service,
dependencies: dependencies,
path: "Sources/Services/\(service)/Sources/\(service)"
path: "Sources/Services/\(service)/Sources/\(service)",
plugins: [.SmithyCodeGenerator]
)
}

Expand Down
1 change: 1 addition & 0 deletions scripts/codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ rm -rf ServiceClients/*
rm -rf Sources/Services/*
rm -rf Tests/Services/*
rm -rf SmokeTests/*
rm -rf Sources/Core/AWSIdentity/InternalClients/*
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete internal clients so they are regenerated completely during codegen


# Regenerate code
./gradlew -p codegen/sdk-codegen build
Expand Down