-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
10,160 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
clients/algoliasearch-client-swift/Sources/Core/Helpers/Version.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. | ||
|
||
public struct Version { | ||
public let major: Int | ||
public let minor: Int | ||
public let patch: Int | ||
public let prereleaseIdentifier: String? | ||
|
||
public init(major: Int, minor: Int, patch: Int = 0, prereleaseIdentifier: String? = nil) { | ||
self.major = major | ||
self.minor = minor | ||
self.patch = patch | ||
self.prereleaseIdentifier = prereleaseIdentifier | ||
} | ||
|
||
public init(version: String) { | ||
let components = version.components(separatedBy: ".") | ||
|
||
guard components.count >= 3 else { | ||
fatalError("version is not formatted correctly") | ||
} | ||
|
||
major = Int(components[0]) ?? 0 | ||
minor = Int(components[1]) ?? 0 | ||
patch = Int(components[2]) ?? 0 | ||
prereleaseIdentifier = components.count == 4 ? components[3] : nil | ||
} | ||
} | ||
|
||
extension Version: CustomStringConvertible { | ||
public var description: String { | ||
let main = [major, minor, patch].map(String.init).joined(separator: ".") | ||
if let prereleaseIdentifier = prereleaseIdentifier { | ||
return main + "-\(prereleaseIdentifier)" | ||
} else { | ||
return main | ||
} | ||
} | ||
} | ||
|
||
public extension Version { | ||
static let current: Version = .init(version: "9.0.0-alpha.2") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// swift-tools-version: 5.9 | ||
// | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "AlgoliaSearchClientTests", | ||
dependencies: [ | ||
.package(url: "https://github.com/Flight-School/AnyCodable", .upToNextMajor(from: "0.6.1")), | ||
.package(url: "https://github.com/SwiftyJSON/SwiftyJSON.git", from: "5.0.0"), | ||
.package(path: "../../../clients/algoliasearch-client-swift"), | ||
], | ||
targets: [ | ||
.testTarget( | ||
name: "requests", | ||
dependencies: [ | ||
.product(name: "AnyCodable", package: "AnyCodable"), | ||
.product(name: "SwiftyJSON", package: "SwiftyJSON"), | ||
.product( | ||
name: "Abtesting", | ||
package: "algoliasearch-client-swift" | ||
), | ||
.product( | ||
name: "Analytics", | ||
package: "algoliasearch-client-swift" | ||
), | ||
.product( | ||
name: "Ingestion", | ||
package: "algoliasearch-client-swift" | ||
), | ||
.product( | ||
name: "Insights", | ||
package: "algoliasearch-client-swift" | ||
), | ||
.product( | ||
name: "Monitoring", | ||
package: "algoliasearch-client-swift" | ||
), | ||
.product( | ||
name: "Personalization", | ||
package: "algoliasearch-client-swift" | ||
), | ||
.product( | ||
name: "QuerySuggestions", | ||
package: "algoliasearch-client-swift" | ||
), | ||
.product( | ||
name: "Recommend", | ||
package: "algoliasearch-client-swift" | ||
), | ||
.product( | ||
name: "Search", | ||
package: "algoliasearch-client-swift" | ||
), | ||
] | ||
) | ||
] | ||
) |
Oops, something went wrong.