Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

Commit

Permalink
feat(cocoapods): add cocoapods spec
Browse files Browse the repository at this point in the history
Setup cocoapods spec for the package.
  • Loading branch information
CassiusPacheco committed Aug 11, 2022
1 parent eaff34b commit a1c740f
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.6.1
5.5
28 changes: 28 additions & 0 deletions ImmutableXCore.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Pod::Spec.new do |spec|
spec.name = 'ImmutableXCore'
spec.version = '0.1.0'
spec.summary = 'The Immutable X Core SDK Swift for applications written on the Immutable X platform.'

spec.description = <<-DESC
The Immutable Core SDK Swift provides convenient access to the Immutable API's for applications written on the Immutable X platform.
DESC

spec.homepage = 'https://github.com/immutable/imx-core-sdk-swift'
spec.documentation_url = 'https://docs.x.immutable.com/sdk-docs/core-sdk-swift/overview'
spec.license = { :type => 'Apache License 2.0', :file => 'LICENSE' }
spec.author = { 'Immutable' => '[email protected]'}

spec.source = { :git => 'https://github.com/immutable/imx-core-sdk-swift.git', :tag => "v#{spec.version}" }
spec.source_files = 'Sources/**/*.swift'

spec.swift_version = '5.5'

spec.ios.deployment_target = '13'
spec.osx.deployment_target = '10.15'

spec.dependency 'AnyCodable-FlightSchool', '~> 0.6'
spec.dependency 'BigInt', '~> 5.2.0'
spec.dependency 'secp256k1.swift', '~> 0.1'

spec.resources = ['Sources/ImmutableXCore/version']
end
6 changes: 5 additions & 1 deletion Sources/ImmutableXCore/ImmutableXCore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ public struct ImmutableXCore {

/// Returns the version of the sdk reading from the `version` file, e.g. `"1.0.0"`
internal var sdkVersion: String {
let file = Bundle.module.path(forResource: "version", ofType: "")!
#if SWIFT_PACKAGE
let file = Bundle.module.path(forResource: "version", ofType: "")!
#else
let file = Bundle(for: BuyWorkflow.self).path(forResource: "version", ofType: "")!
#endif
// swiftlint:disable:next force_try
return try! String(contentsOfFile: file).trimmingCharacters(in: CharacterSet.whitespacesAndNewlines)
}
Expand Down

0 comments on commit a1c740f

Please sign in to comment.