From 298d6c2200e98f882feadce4d196bb8ecd09459b Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@users.noreply.github.com> Date: Mon, 17 Mar 2025 21:05:43 +0000 Subject: [PATCH] [Swift][client] make alamofire version more flexible and build projects on CI before running unit tests (#20913) * [Swift][client] CI first build the projects then run the unit tests * [Swift][client] make alamofire version more flexible --- .../src/main/resources/swift6/Cartfile.mustache | 2 +- .../src/main/resources/swift6/Package.swift.mustache | 2 +- .../src/main/resources/swift6/Podspec.mustache | 2 +- samples/client/petstore/swift6/alamofireLibrary/Cartfile | 2 +- samples/client/petstore/swift6/alamofireLibrary/Package.swift | 2 +- .../petstore/swift6/alamofireLibrary/PetstoreClient.podspec | 2 +- samples/client/petstore/swift6/apiNonStaticMethod/Cartfile | 2 +- samples/client/petstore/swift6/apiNonStaticMethod/Package.swift | 2 +- .../petstore/swift6/apiNonStaticMethod/PetstoreClient.podspec | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/swift6/Cartfile.mustache b/modules/openapi-generator/src/main/resources/swift6/Cartfile.mustache index f2994b6ac1f..bbf4a7425be 100644 --- a/modules/openapi-generator/src/main/resources/swift6/Cartfile.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/Cartfile.mustache @@ -1,4 +1,4 @@ {{#useAlamofire}} -github "Alamofire/Alamofire" = 5.10.2{{/useAlamofire}}{{#usePromiseKit}} +github "Alamofire/Alamofire" ~> 5.10{{/useAlamofire}}{{#usePromiseKit}} github "mxcl/PromiseKit" ~> 8.1{{/usePromiseKit}}{{#useRxSwift}} github "ReactiveX/RxSwift" ~> 6.8{{/useRxSwift}} diff --git a/modules/openapi-generator/src/main/resources/swift6/Package.swift.mustache b/modules/openapi-generator/src/main/resources/swift6/Package.swift.mustache index f4b4f677e59..000f495b48f 100644 --- a/modules/openapi-generator/src/main/resources/swift6/Package.swift.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/Package.swift.mustache @@ -25,7 +25,7 @@ let package = Package( dependencies: [ // Dependencies declare other packages that this package depends on. {{#useAlamofire}} - .package(url: "https://github.com/Alamofire/Alamofire", exact: "5.10.2"), + .package(url: "https://github.com/Alamofire/Alamofire", .upToNextMajor(from: "5.10.2")), {{/useAlamofire}} {{#usePromiseKit}} .package(url: "https://github.com/mxcl/PromiseKit", .upToNextMajor(from: "8.1.2")), diff --git a/modules/openapi-generator/src/main/resources/swift6/Podspec.mustache b/modules/openapi-generator/src/main/resources/swift6/Podspec.mustache index 341fd45b1c3..fc7ff92f285 100644 --- a/modules/openapi-generator/src/main/resources/swift6/Podspec.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/Podspec.mustache @@ -27,7 +27,7 @@ Pod::Spec.new do |s| {{/podDocumentationURL}} s.source_files = '{{swiftPackagePath}}{{^swiftPackagePath}}{{#useSPMFileStructure}}Sources/{{projectName}}{{/useSPMFileStructure}}{{^useSPMFileStructure}}{{projectName}}/Classes{{/useSPMFileStructure}}{{/swiftPackagePath}}/**/*.swift' {{#useAlamofire}} - s.dependency 'Alamofire', '5.10.2' + s.dependency 'Alamofire', '~> 5.10' {{/useAlamofire}} {{#usePromiseKit}} s.dependency 'PromiseKit/CorePromise', '~> 8.1' diff --git a/samples/client/petstore/swift6/alamofireLibrary/Cartfile b/samples/client/petstore/swift6/alamofireLibrary/Cartfile index 329bb9d3ee0..dcd51e39355 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Cartfile +++ b/samples/client/petstore/swift6/alamofireLibrary/Cartfile @@ -1 +1 @@ -github "Alamofire/Alamofire" = 5.10.2 +github "Alamofire/Alamofire" ~> 5.10 diff --git a/samples/client/petstore/swift6/alamofireLibrary/Package.swift b/samples/client/petstore/swift6/alamofireLibrary/Package.swift index b4c5244b2a4..18f505a86cf 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Package.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Package.swift @@ -19,7 +19,7 @@ let package = Package( ], dependencies: [ // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/Alamofire/Alamofire", exact: "5.10.2"), + .package(url: "https://github.com/Alamofire/Alamofire", .upToNextMajor(from: "5.10.2")), ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. diff --git a/samples/client/petstore/swift6/alamofireLibrary/PetstoreClient.podspec b/samples/client/petstore/swift6/alamofireLibrary/PetstoreClient.podspec index 64d4ba09943..71c84bc1ffc 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/PetstoreClient.podspec +++ b/samples/client/petstore/swift6/alamofireLibrary/PetstoreClient.podspec @@ -11,5 +11,5 @@ Pod::Spec.new do |s| s.homepage = 'https://github.com/openapitools/openapi-generator' s.summary = 'PetstoreClient' s.source_files = 'Sources/PetstoreClient/**/*.swift' - s.dependency 'Alamofire', '5.10.2' + s.dependency 'Alamofire', '~> 5.10' end diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Cartfile b/samples/client/petstore/swift6/apiNonStaticMethod/Cartfile index b9ac9faa000..8d89c879e61 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Cartfile +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Cartfile @@ -1,3 +1,3 @@ -github "Alamofire/Alamofire" = 5.10.2 +github "Alamofire/Alamofire" ~> 5.10 github "mxcl/PromiseKit" ~> 8.1 github "ReactiveX/RxSwift" ~> 6.8 diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Package.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Package.swift index 91fe79acc28..58fb81d22bd 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Package.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Package.swift @@ -19,7 +19,7 @@ let package = Package( ], dependencies: [ // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/Alamofire/Alamofire", exact: "5.10.2"), + .package(url: "https://github.com/Alamofire/Alamofire", .upToNextMajor(from: "5.10.2")), .package(url: "https://github.com/mxcl/PromiseKit", .upToNextMajor(from: "8.1.2")), .package(url: "https://github.com/ReactiveX/RxSwift", .upToNextMajor(from: "6.8.0")), ], diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/PetstoreClient.podspec b/samples/client/petstore/swift6/apiNonStaticMethod/PetstoreClient.podspec index 9ee7ee73769..5694a8439b4 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/PetstoreClient.podspec +++ b/samples/client/petstore/swift6/apiNonStaticMethod/PetstoreClient.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.homepage = 'https://github.com/openapitools/openapi-generator' s.summary = 'PetstoreClient' s.source_files = 'Sources/PetstoreClient/**/*.swift' - s.dependency 'Alamofire', '5.10.2' + s.dependency 'Alamofire', '~> 5.10' s.dependency 'PromiseKit/CorePromise', '~> 8.1' s.dependency 'RxSwift', '~> 6.8' end