diff --git a/Package.swift b/Package.swift index 367df25..069e8de 100644 --- a/Package.swift +++ b/Package.swift @@ -3,6 +3,10 @@ import PackageDescription let package = Package( name: "Bagel", + platforms: [ + .iOS(.v9), + .macOS(.v10_10), + ], products: [ .library(name: "Bagel", targets: ["Bagel"]) ], @@ -13,7 +17,8 @@ let package = Package( .target( name: "Bagel", dependencies: ["CocoaAsyncSocket"], - path: "iOS/Source" + path: "iOS/Source", + publicHeadersPath: "" ) ] ) diff --git a/iOS/Bagel.xcodeproj/project.pbxproj b/iOS/Bagel.xcodeproj/project.pbxproj index 49afa07..0109e04 100644 --- a/iOS/Bagel.xcodeproj/project.pbxproj +++ b/iOS/Bagel.xcodeproj/project.pbxproj @@ -24,7 +24,7 @@ 3760A46921F1383F004D1E07 /* BagelRequestCarrier.h in Headers */ = {isa = PBXBuildFile; fileRef = 3760A44F21F1383F004D1E07 /* BagelRequestCarrier.h */; }; 3760A46A21F1383F004D1E07 /* BagelDeviceModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 3760A45021F1383F004D1E07 /* BagelDeviceModel.h */; settings = {ATTRIBUTES = (Public, ); }; }; 3760A46B21F1383F004D1E07 /* BagelProjectModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 3760A45121F1383F004D1E07 /* BagelProjectModel.m */; }; - 3760A46C21F1383F004D1E07 /* BagelUtility.h in Headers */ = {isa = PBXBuildFile; fileRef = 3760A45221F1383F004D1E07 /* BagelUtility.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3760A46C21F1383F004D1E07 /* BagelUtility.h in Headers */ = {isa = PBXBuildFile; fileRef = 3760A45221F1383F004D1E07 /* BagelUtility.h */; }; 3760A46D21F1383F004D1E07 /* BagelURLSessionInjector.h in Headers */ = {isa = PBXBuildFile; fileRef = 3760A45321F1383F004D1E07 /* BagelURLSessionInjector.h */; }; 3760A46E21F1383F004D1E07 /* BagelRequestInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 3760A45421F1383F004D1E07 /* BagelRequestInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; 3760A46F21F1383F004D1E07 /* Bagel.h in Headers */ = {isa = PBXBuildFile; fileRef = 3760A45521F1383F004D1E07 /* Bagel.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -32,7 +32,7 @@ 3760A47121F1383F004D1E07 /* BagelRequestPacket.m in Sources */ = {isa = PBXBuildFile; fileRef = 3760A45721F1383F004D1E07 /* BagelRequestPacket.m */; }; 3760A47221F1383F004D1E07 /* BagelBrowser.h in Headers */ = {isa = PBXBuildFile; fileRef = 3760A45821F1383F004D1E07 /* BagelBrowser.h */; }; 3760A47321F1383F004D1E07 /* BagelURLConnectionInjector.m in Sources */ = {isa = PBXBuildFile; fileRef = 3760A45921F1383F004D1E07 /* BagelURLConnectionInjector.m */; }; - 3760A47421F1383F004D1E07 /* BagelBaseModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 3760A45A21F1383F004D1E07 /* BagelBaseModel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3760A47421F1383F004D1E07 /* BagelBaseModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 3760A45A21F1383F004D1E07 /* BagelBaseModel.h */; }; 3760A47B21F13A47004D1E07 /* CocoaAsyncSocket.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3760A47A21F13A47004D1E07 /* CocoaAsyncSocket.framework */; }; 51102CE2220B87290067EB63 /* BagelCarrierDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 51102CE1220B857E0067EB63 /* BagelCarrierDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; /* End PBXBuildFile section */ diff --git a/iOS/Source/Bagel.h b/iOS/Source/Bagel.h index 21d2263..a28bbeb 100644 --- a/iOS/Source/Bagel.h +++ b/iOS/Source/Bagel.h @@ -19,7 +19,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#import +@import Foundation; //! Project version number for Bagel. FOUNDATION_EXPORT double BagelVersionNumber; @@ -27,14 +27,12 @@ FOUNDATION_EXPORT double BagelVersionNumber; //! Project version string for Bagel. FOUNDATION_EXPORT const unsigned char BagelVersionString[]; -#import +@import Foundation; -#import -#import -#import -#import -#import -#import +#import "BagelCarrierDelegate.h" +#import "BagelConfiguration.h" +#import "BagelDeviceModel.h" +#import "BagelProjectModel.h" @interface Bagel : NSObject diff --git a/iOS/Source/BagelBaseModel.h b/iOS/Source/BagelBaseModel.h index e5088b4..ecc479b 100644 --- a/iOS/Source/BagelBaseModel.h +++ b/iOS/Source/BagelBaseModel.h @@ -19,7 +19,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#import +@import Foundation; @protocol BagelBaseModelProtocol diff --git a/iOS/Source/BagelConfiguration.h b/iOS/Source/BagelConfiguration.h index 0fbe1f2..acdf0e3 100644 --- a/iOS/Source/BagelConfiguration.h +++ b/iOS/Source/BagelConfiguration.h @@ -19,11 +19,11 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#import -#import "BagelCarrierDelegate.h" -#import "BagelProjectModel.h" -#import "BagelDeviceModel.h" -#import "BagelUtility.h" +@import Foundation; + +@class BagelProjectModel; +@class BagelDeviceModel; +@protocol BagelCarrierDelegate; @interface BagelConfiguration : NSObject diff --git a/iOS/Source/BagelConfiguration.m b/iOS/Source/BagelConfiguration.m index 357c39d..1fec5de 100644 --- a/iOS/Source/BagelConfiguration.m +++ b/iOS/Source/BagelConfiguration.m @@ -20,6 +20,9 @@ // THE SOFTWARE. #import "BagelConfiguration.h" +#import "BagelProjectModel.h" +#import "BagelDeviceModel.h" +#import "BagelUtility.h" static BagelConfiguration* defaultConfiguration; diff --git a/iOS/Source/BagelController.m b/iOS/Source/BagelController.m index ffc8290..05f0044 100644 --- a/iOS/Source/BagelController.m +++ b/iOS/Source/BagelController.m @@ -20,6 +20,7 @@ // THE SOFTWARE. #import "BagelController.h" +#import "BagelCarrierDelegate.h" static NSString* queueId = @"com.yagiz.bagel.injectController"; diff --git a/iOS/Source/BagelDeviceModel.h b/iOS/Source/BagelDeviceModel.h index 854286e..3a9cd08 100644 --- a/iOS/Source/BagelDeviceModel.h +++ b/iOS/Source/BagelDeviceModel.h @@ -19,9 +19,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#import "BagelBaseModel.h" +@import Foundation; -@interface BagelDeviceModel : NSObject +@interface BagelDeviceModel : NSObject @property (nonatomic, strong) NSString* deviceId; @property (nonatomic, strong) NSString* deviceName; diff --git a/iOS/Source/BagelProjectModel.h b/iOS/Source/BagelProjectModel.h index a349a6f..7037594 100644 --- a/iOS/Source/BagelProjectModel.h +++ b/iOS/Source/BagelProjectModel.h @@ -19,9 +19,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#import "BagelBaseModel.h" +@import Foundation; -@interface BagelProjectModel : NSObject +@interface BagelProjectModel : NSObject @property (nonatomic, strong) NSString* projectName; diff --git a/iOS/Source/BagelRequestPacket.m b/iOS/Source/BagelRequestPacket.m index 4a80fed..e64a124 100644 --- a/iOS/Source/BagelRequestPacket.m +++ b/iOS/Source/BagelRequestPacket.m @@ -20,6 +20,13 @@ // THE SOFTWARE. #import "BagelRequestPacket.h" +#import "BagelBaseModel.h" + +@interface BagelProjectModel() +@end + +@interface BagelDeviceModel() +@end @implementation BagelRequestPacket diff --git a/iOS/Source/BagelUtility.h b/iOS/Source/BagelUtility.h index 74950c8..070bb11 100644 --- a/iOS/Source/BagelUtility.h +++ b/iOS/Source/BagelUtility.h @@ -19,8 +19,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#import -#import +@import Foundation; @interface BagelUtility : NSObject diff --git a/iOS/Source/BagelUtility.m b/iOS/Source/BagelUtility.m index 83a18f1..3e820da 100644 --- a/iOS/Source/BagelUtility.m +++ b/iOS/Source/BagelUtility.m @@ -19,6 +19,12 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. +@import Foundation; + +#if TARGET_OS_IOS +@import UIKit; +#endif + #import "BagelUtility.h" @implementation BagelUtility @@ -40,17 +46,24 @@ + (NSString*)deviceId + (NSString*)deviceName { - return [UIDevice currentDevice].name; +#if TARGET_OS_IOS + return [UIDevice currentDevice].name; +#else + return [[NSHost currentHost] localizedName];; +#endif } + (NSString*)deviceDescription { - NSString* information = @""; + NSString* information = nil; +#if TARGET_OS_IOS information = [UIDevice currentDevice].model; information = [NSString stringWithFormat:@"%@ %@", information, [UIDevice currentDevice].systemName]; information = [NSString stringWithFormat:@"%@ %@", information, [UIDevice currentDevice].systemVersion]; - +#else + information = [[NSProcessInfo processInfo] operatingSystemVersionString]; +#endif return information; }