77
88import ArgumentParser
99import Foundation
10+ import struct SmithyCodegenCore. CodeGenerator
1011
1112@main
1213struct SmithyCodegenCLI : AsyncParsableCommand {
@@ -17,6 +18,9 @@ struct SmithyCodegenCLI: AsyncParsableCommand {
1718 @Option ( help: " The full or relative path to write the schemas output file. " )
1819 var schemasPath : String ?
1920
21+ @Option ( help: " The full or relative path to write the struct consumers output file. " )
22+ var structConsumersPath : String ?
23+
2024 func run( ) async throws {
2125 let currentWorkingDirectoryFileURL = currentWorkingDirectoryFileURL ( )
2226 print ( " Current working directory: \( currentWorkingDirectoryFileURL. path) " )
@@ -31,12 +35,11 @@ struct SmithyCodegenCLI: AsyncParsableCommand {
3135 // If --schemas-path was supplied, create the schema file URL
3236 let schemasFileURL = resolve ( paramName: " --schemas-path " , path: schemasPath)
3337
34- // All file URLs needed for code generation have now been resolved.
35- // Implement code generation here.
36- if let schemasFileURL {
37- print ( " Schemas file path: \( schemasFileURL) " )
38- FileManager . default. createFile ( atPath: schemasFileURL. path, contents: Data ( ) )
39- }
38+ // Use resolved file URLs to run code generator
39+ try CodeGenerator (
40+ modelFileURL: modelFileURL,
41+ schemasFileURL: schemasFileURL
42+ ) . run ( )
4043 }
4144
4245 private func currentWorkingDirectoryFileURL( ) -> URL {
0 commit comments