diff --git a/RRuleSwift.podspec b/RRuleSwift.podspec new file mode 100644 index 0000000..94e4cfa --- /dev/null +++ b/RRuleSwift.podspec @@ -0,0 +1,22 @@ +Pod::Spec.new do |s| + s.name = "RRuleSwift" + s.version = "0.2.0" + s.summary = "Swift rrule library for working with recurrence rules of calendar dates." + s.description = <<-DESC + Swift rrule library for working with recurrence rules of calendar dates. + It wraps the rrule.js library (https://github.com/jkbrzt/rrule). + DESC + + s.homepage = "https://github.com/teambition/RRuleSwift" + s.screenshots = "https://raw.githubusercontent.com/teambition/RRuleSwift/master/Gif/RRuleSwiftExample.gif" + s.license = "MIT" + s.author = { 'Teambition' => 'dev@teambition.com' } + s.ios.deployment_target = "8.0" + s.watchos.deployment_target = "2.0" + s.source = { :git => "https://github.com/teambition/RRuleSwift.git", :tag => "#{s.version}" } + s.source_files = "Sources", "Sources/**/*.{h,m}" + s.watchos.exclude_files = "Sources/JavaScriptBridge.swift", "Sources/Iterators.swift" + s.resource = "Sources/lib/*.js" + s.frameworks = "Foundation", "EventKit" + s.ios.frameworks = "Foundation", "EventKit", "JavaScriptCore" +end diff --git a/Sources/JavaScriptBridge.swift b/Sources/JavaScriptBridge.swift index 364261e..512e213 100644 --- a/Sources/JavaScriptBridge.swift +++ b/Sources/JavaScriptBridge.swift @@ -10,8 +10,12 @@ import Foundation import EventKit internal struct JavaScriptBridge { + + // This class is needed to be able to get out bundle + private class DummyClass {} + internal static func rrulejs() -> String? { - let libPath = Bundle(identifier: "Teambition.RRuleSwift-iOS")?.path(forResource: "rrule", ofType: "js") ?? Bundle.main.path(forResource: "rrule", ofType: "js") + let libPath = Bundle(for: DummyClass.self).path(forResource: "rrule", ofType: "js") ?? Bundle.main.path(forResource: "rrule", ofType: "js") guard let rrulelibPath = libPath else { return nil }