add default value to swift3,4 podspec (#921)

This commit is contained in:
William Cheng 2018-09-02 15:51:36 +08:00 committed by GitHub
parent 026c26075d
commit a2acfe3be0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 206 additions and 58 deletions

View File

@ -5,18 +5,34 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.11'
s.tvos.deployment_target = '9.0'
s.version = '{{#podVersion}}{{podVersion}}{{/podVersion}}{{^podVersion}}0.0.1{{/podVersion}}'
s.source = {{#podSource}}{{& podSource}}{{/podSource}}{{^podSource}}{ :git => 'git@github.com:openapitools/openapi-generator.git', :tag => 'v1.0.0' }{{/podSource}}{{#podAuthors}}
s.authors = '{{podAuthors}}'{{/podAuthors}}{{#podSocialMediaURL}}
s.social_media_url = '{{podSocialMediaURL}}'{{/podSocialMediaURL}}{{#podDocsetURL}}
s.docset_url = '{{podDocsetURL}}'{{/podDocsetURL}}
s.license = {{#podLicense}}{{& podLicense}}{{/podLicense}}{{^podLicense}}'Proprietary'{{/podLicense}}{{#podHomepage}}
s.homepage = '{{podHomepage}}'{{/podHomepage}}{{#podSummary}}
s.summary = '{{podSummary}}'{{/podSummary}}{{#podDescription}}
s.description = '{{podDescription}}'{{/podDescription}}{{#podScreenshots}}
s.screenshots = {{& podScreenshots}}{{/podScreenshots}}{{#podDocumentationURL}}
s.documentation_url = '{{podDocumentationURL}}'{{/podDocumentationURL}}
s.source_files = '{{projectName}}/Classes/**/*.swift'{{#usePromiseKit}}
s.dependency 'PromiseKit/CorePromise', '~> 4.4.0'{{/usePromiseKit}}{{#useRxSwift}}
s.dependency 'RxSwift', '3.6.1'{{/useRxSwift}}
s.source = {{#podSource}}{{& podSource}}{{/podSource}}{{^podSource}}{ :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v1.0.0' }{{/podSource}}
{{#podAuthors}}
s.authors = '{{podAuthors}}'
{{/podAuthors}}
{{#podSocialMediaURL}}
s.social_media_url = '{{podSocialMediaURL}}'
{{/podSocialMediaURL}}
{{#podDocsetURL}}
s.docset_url = '{{podDocsetURL}}'
{{/podDocsetURL}}
s.license = {{#podLicense}}{{& podLicense}}{{/podLicense}}{{^podLicense}}'Proprietary'{{/podLicense}}
s.homepage = '{{podHomepage}}{{^podHomepage}}https://github.com/OpenAPITools/openapi-generator{{/podHomepage}}'
s.summary = '{{podSummary}}{{^podSummary}}{{projectName}} Swift SDK{{/podSummary}}'
{{#podDescription}}
s.description = '{{podDescription}}'
{{/podDescription}}
{{#podScreenshots}}
s.screenshots = {{& podScreenshots}}
{{/podScreenshots}}
{{#podDocumentationURL}}
s.documentation_url = '{{podDocumentationURL}}'
{{/podDocumentationURL}}
s.source_files = '{{projectName}}/Classes/**/*.swift'
{{#usePromiseKit}}
s.dependency 'PromiseKit/CorePromise', '~> 4.4.0'
{{/usePromiseKit}}
{{#useRxSwift}}
s.dependency 'RxSwift', '3.6.1'
{{/useRxSwift}}
s.dependency 'Alamofire', '~> 4.5.0'
end

View File

@ -5,18 +5,34 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.11'
s.tvos.deployment_target = '9.0'
s.version = '{{#podVersion}}{{podVersion}}{{/podVersion}}{{^podVersion}}0.0.1{{/podVersion}}'
s.source = {{#podSource}}{{& podSource}}{{/podSource}}{{^podSource}}{ :git => 'git@github.com:openapitools/openapi-generator.git', :tag => 'v1.0.0' }{{/podSource}}{{#podAuthors}}
s.authors = '{{podAuthors}}'{{/podAuthors}}{{#podSocialMediaURL}}
s.social_media_url = '{{podSocialMediaURL}}'{{/podSocialMediaURL}}{{#podDocsetURL}}
s.docset_url = '{{podDocsetURL}}'{{/podDocsetURL}}
s.license = {{#podLicense}}{{& podLicense}}{{/podLicense}}{{^podLicense}}'Proprietary'{{/podLicense}}{{#podHomepage}}
s.homepage = '{{podHomepage}}'{{/podHomepage}}{{#podSummary}}
s.summary = '{{podSummary}}'{{/podSummary}}{{#podDescription}}
s.description = '{{podDescription}}'{{/podDescription}}{{#podScreenshots}}
s.screenshots = {{& podScreenshots}}{{/podScreenshots}}{{#podDocumentationURL}}
s.documentation_url = '{{podDocumentationURL}}'{{/podDocumentationURL}}
s.source_files = '{{projectName}}/Classes/**/*.swift'{{#usePromiseKit}}
s.dependency 'PromiseKit/CorePromise', '~> 4.4.0'{{/usePromiseKit}}{{#useRxSwift}}
s.dependency 'RxSwift', '~> 4.0'{{/useRxSwift}}
s.source = {{#podSource}}{{& podSource}}{{/podSource}}{{^podSource}}{ :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v1.0.0' }{{/podSource}}
{{#podAuthors}}
s.authors = '{{podAuthors}}'
{{/podAuthors}}
{{#podSocialMediaURL}}
s.social_media_url = '{{podSocialMediaURL}}'
{{/podSocialMediaURL}}
{{#podDocsetURL}}
s.docset_url = '{{podDocsetURL}}'
{{/podDocsetURL}}
s.license = {{#podLicense}}{{& podLicense}}{{/podLicense}}{{^podLicense}}'Proprietary'{{/podLicense}}
s.homepage = '{{podHomepage}}{{^podHomepage}}https://github.com/OpenAPITools/openapi-generator{{/podHomepage}}'
s.summary = '{{podSummary}}{{^podSummary}}{{projectName}} Swift SDK{{/podSummary}}'
{{#podDescription}}
s.description = '{{podDescription}}'
{{/podDescription}}
{{#podScreenshots}}
s.screenshots = {{& podScreenshots}}
{{/podScreenshots}}
{{#podDocumentationURL}}
s.documentation_url = '{{podDocumentationURL}}'
{{/podDocumentationURL}}
s.source_files = '{{projectName}}/Classes/**/*.swift'
{{#usePromiseKit}}
s.dependency 'PromiseKit/CorePromise', '~> 4.4.0'
{{/usePromiseKit}}
{{#useRxSwift}}
s.dependency 'RxSwift', '~> 4.0'
{{/useRxSwift}}
s.dependency 'Alamofire', '~> 4.5.0'
end

View File

@ -1 +1 @@
3.2.0-SNAPSHOT
3.2.3-SNAPSHOT

View File

@ -4,7 +4,7 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.11'
s.tvos.deployment_target = '9.0'
s.version = '0.0.1'
s.source = { :git => 'git@github.com:openapitools/openapi-generator.git', :tag => 'v1.0.0' }
s.source = { :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v1.0.0' }
s.authors = ''
s.license = 'Proprietary'
s.homepage = 'https://github.com/openapitools/openapi-generator'

View File

@ -1 +1 @@
3.2.0-SNAPSHOT
3.2.3-SNAPSHOT

View File

@ -4,7 +4,7 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.11'
s.tvos.deployment_target = '9.0'
s.version = '0.0.1'
s.source = { :git => 'git@github.com:openapitools/openapi-generator.git', :tag => 'v1.0.0' }
s.source = { :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v1.0.0' }
s.authors = ''
s.license = 'Proprietary'
s.homepage = 'https://github.com/openapitools/openapi-generator'

View File

@ -1 +1 @@
3.2.0-SNAPSHOT
3.2.3-SNAPSHOT

View File

@ -4,7 +4,7 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.11'
s.tvos.deployment_target = '9.0'
s.version = '0.0.1'
s.source = { :git => 'git@github.com:openapitools/openapi-generator.git', :tag => 'v1.0.0' }
s.source = { :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v1.0.0' }
s.authors = ''
s.license = 'Proprietary'
s.homepage = 'https://github.com/openapitools/openapi-generator'

View File

@ -1 +1 @@
3.2.0-SNAPSHOT
3.2.3-SNAPSHOT

View File

@ -4,7 +4,7 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.11'
s.tvos.deployment_target = '9.0'
s.version = '0.0.1'
s.source = { :git => 'git@github.com:openapitools/openapi-generator.git', :tag => 'v1.0.0' }
s.source = { :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v1.0.0' }
s.authors = ''
s.license = 'Proprietary'
s.homepage = 'https://github.com/openapitools/openapi-generator'

View File

@ -1 +1 @@
3.2.0-SNAPSHOT
3.2.3-SNAPSHOT

View File

@ -4,7 +4,7 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.11'
s.tvos.deployment_target = '9.0'
s.version = '0.0.1'
s.source = { :git => 'git@github.com:openapitools/openapi-generator.git', :tag => 'v1.0.0' }
s.source = { :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v1.0.0' }
s.authors = ''
s.license = 'Proprietary'
s.homepage = 'https://github.com/openapitools/openapi-generator'

View File

@ -1 +1 @@
3.2.0-SNAPSHOT
3.2.3-SNAPSHOT

View File

@ -4,7 +4,7 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.11'
s.tvos.deployment_target = '9.0'
s.version = '0.0.1'
s.source = { :git => 'git@github.com:openapitools/openapi-generator.git', :tag => 'v1.0.0' }
s.source = { :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v1.0.0' }
s.authors = ''
s.license = 'Proprietary'
s.homepage = 'https://github.com/openapitools/openapi-generator'

View File

@ -1 +1 @@
3.2.0-SNAPSHOT
3.2.3-SNAPSHOT

View File

@ -4,7 +4,7 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.11'
s.tvos.deployment_target = '9.0'
s.version = '0.0.1'
s.source = { :git => 'git@github.com:openapitools/openapi-generator.git', :tag => 'v1.0.0' }
s.source = { :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v1.0.0' }
s.authors = ''
s.license = 'Proprietary'
s.homepage = 'https://github.com/openapitools/openapi-generator'

View File

@ -17,8 +17,37 @@ class AlamofireRequestBuilderFactory: RequestBuilderFactory {
}
}
private struct SynchronizedDictionary<K: Hashable, V> {
private var dictionary = [K: V]()
private let queue = DispatchQueue(
label: "SynchronizedDictionary",
qos: DispatchQoS.userInitiated,
attributes: [DispatchQueue.Attributes.concurrent],
autoreleaseFrequency: DispatchQueue.AutoreleaseFrequency.inherit,
target: nil
)
public subscript(key: K) -> V? {
get {
var value: V?
queue.sync {
value = self.dictionary[key]
}
return value
}
set {
queue.sync(flags: DispatchWorkItemFlags.barrier) {
self.dictionary[key] = newValue
}
}
}
}
// Store manager to retain its reference
private var managerStore: [String: Alamofire.SessionManager] = [:]
private var managerStore = SynchronizedDictionary<String, Alamofire.SessionManager>()
open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) {
@ -112,7 +141,7 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
}
let cleanupRequest = {
_ = managerStore.removeValue(forKey: managerId)
managerStore[managerId] = nil
}
let validatedRequest = request.validate()
@ -314,7 +343,7 @@ open class AlamofireDecodableRequestBuilder<T:Decodable>: AlamofireRequestBuilde
}
let cleanupRequest = {
_ = managerStore.removeValue(forKey: managerId)
managerStore[managerId] = nil
}
let validatedRequest = request.validate()

View File

@ -1 +1 @@
3.2.0-SNAPSHOT
3.2.3-SNAPSHOT

View File

@ -4,7 +4,7 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.11'
s.tvos.deployment_target = '9.0'
s.version = '0.0.1'
s.source = { :git => 'git@github.com:openapitools/openapi-generator.git', :tag => 'v1.0.0' }
s.source = { :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v1.0.0' }
s.authors = ''
s.license = 'Proprietary'
s.homepage = 'https://github.com/openapitools/openapi-generator'

View File

@ -17,8 +17,37 @@ class AlamofireRequestBuilderFactory: RequestBuilderFactory {
}
}
private struct SynchronizedDictionary<K: Hashable, V> {
private var dictionary = [K: V]()
private let queue = DispatchQueue(
label: "SynchronizedDictionary",
qos: DispatchQoS.userInitiated,
attributes: [DispatchQueue.Attributes.concurrent],
autoreleaseFrequency: DispatchQueue.AutoreleaseFrequency.inherit,
target: nil
)
public subscript(key: K) -> V? {
get {
var value: V?
queue.sync {
value = self.dictionary[key]
}
return value
}
set {
queue.sync(flags: DispatchWorkItemFlags.barrier) {
self.dictionary[key] = newValue
}
}
}
}
// Store manager to retain its reference
private var managerStore: [String: Alamofire.SessionManager] = [:]
private var managerStore = SynchronizedDictionary<String, Alamofire.SessionManager>()
open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) {
@ -112,7 +141,7 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
}
let cleanupRequest = {
_ = managerStore.removeValue(forKey: managerId)
managerStore[managerId] = nil
}
let validatedRequest = request.validate()
@ -314,7 +343,7 @@ open class AlamofireDecodableRequestBuilder<T:Decodable>: AlamofireRequestBuilde
}
let cleanupRequest = {
_ = managerStore.removeValue(forKey: managerId)
managerStore[managerId] = nil
}
let validatedRequest = request.validate()

View File

@ -1 +1 @@
3.2.0-SNAPSHOT
3.2.3-SNAPSHOT

View File

@ -4,7 +4,7 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.11'
s.tvos.deployment_target = '9.0'
s.version = '0.0.1'
s.source = { :git => 'git@github.com:openapitools/openapi-generator.git', :tag => 'v1.0.0' }
s.source = { :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v1.0.0' }
s.authors = ''
s.license = 'Proprietary'
s.homepage = 'https://github.com/openapitools/openapi-generator'

View File

@ -17,8 +17,37 @@ class AlamofireRequestBuilderFactory: RequestBuilderFactory {
}
}
private struct SynchronizedDictionary<K: Hashable, V> {
private var dictionary = [K: V]()
private let queue = DispatchQueue(
label: "SynchronizedDictionary",
qos: DispatchQoS.userInitiated,
attributes: [DispatchQueue.Attributes.concurrent],
autoreleaseFrequency: DispatchQueue.AutoreleaseFrequency.inherit,
target: nil
)
public subscript(key: K) -> V? {
get {
var value: V?
queue.sync {
value = self.dictionary[key]
}
return value
}
set {
queue.sync(flags: DispatchWorkItemFlags.barrier) {
self.dictionary[key] = newValue
}
}
}
}
// Store manager to retain its reference
private var managerStore: [String: Alamofire.SessionManager] = [:]
private var managerStore = SynchronizedDictionary<String, Alamofire.SessionManager>()
open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) {
@ -112,7 +141,7 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
}
let cleanupRequest = {
_ = managerStore.removeValue(forKey: managerId)
managerStore[managerId] = nil
}
let validatedRequest = request.validate()
@ -314,7 +343,7 @@ open class AlamofireDecodableRequestBuilder<T:Decodable>: AlamofireRequestBuilde
}
let cleanupRequest = {
_ = managerStore.removeValue(forKey: managerId)
managerStore[managerId] = nil
}
let validatedRequest = request.validate()

View File

@ -1 +1 @@
3.2.0-SNAPSHOT
3.2.3-SNAPSHOT

View File

@ -4,7 +4,7 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.11'
s.tvos.deployment_target = '9.0'
s.version = '0.0.1'
s.source = { :git => 'git@github.com:openapitools/openapi-generator.git', :tag => 'v1.0.0' }
s.source = { :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v1.0.0' }
s.authors = ''
s.license = 'Proprietary'
s.homepage = 'https://github.com/openapitools/openapi-generator'

View File

@ -17,8 +17,37 @@ class AlamofireRequestBuilderFactory: RequestBuilderFactory {
}
}
private struct SynchronizedDictionary<K: Hashable, V> {
private var dictionary = [K: V]()
private let queue = DispatchQueue(
label: "SynchronizedDictionary",
qos: DispatchQoS.userInitiated,
attributes: [DispatchQueue.Attributes.concurrent],
autoreleaseFrequency: DispatchQueue.AutoreleaseFrequency.inherit,
target: nil
)
public subscript(key: K) -> V? {
get {
var value: V?
queue.sync {
value = self.dictionary[key]
}
return value
}
set {
queue.sync(flags: DispatchWorkItemFlags.barrier) {
self.dictionary[key] = newValue
}
}
}
}
// Store manager to retain its reference
private var managerStore: [String: Alamofire.SessionManager] = [:]
private var managerStore = SynchronizedDictionary<String, Alamofire.SessionManager>()
open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) {
@ -112,7 +141,7 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
}
let cleanupRequest = {
_ = managerStore.removeValue(forKey: managerId)
managerStore[managerId] = nil
}
let validatedRequest = request.validate()
@ -314,7 +343,7 @@ open class AlamofireDecodableRequestBuilder<T:Decodable>: AlamofireRequestBuilde
}
let cleanupRequest = {
_ = managerStore.removeValue(forKey: managerId)
managerStore[managerId] = nil
}
let validatedRequest = request.validate()