diff --git a/.travis.yml b/.travis.yml
index 29ea41f..2880a10 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,4 +1,4 @@
language: objective-c
osx_image: xcode7.3
script:
-- xcodebuild build test -workspace ManagedObjectAdapter.xcworkspace -scheme ManagedObjectAdapter -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6s,OS=9.3'
+- xcodebuild build test -workspace ManagedObjectAdapter.xcworkspace -scheme 'ManagedObjectAdapter iOS' -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6s,OS=9.3'
diff --git a/Example.xcodeproj/xcuserdata/hongxin.xcuserdatad/xcschemes/xcschememanagement.plist b/Example.xcodeproj/xcuserdata/hongxin.xcuserdatad/xcschemes/xcschememanagement.plist
index 5ffb15b..eb6b6da 100644
--- a/Example.xcodeproj/xcuserdata/hongxin.xcuserdatad/xcschemes/xcschememanagement.plist
+++ b/Example.xcodeproj/xcuserdata/hongxin.xcuserdatad/xcschemes/xcschememanagement.plist
@@ -7,7 +7,7 @@
Example.xcscheme
orderHint
- 2
+ 3
SuppressBuildableAutocreation
diff --git a/ManagedObjectAdapter.xcodeproj/project.pbxproj b/ManagedObjectAdapter.xcodeproj/project.pbxproj
index a2e54b4..1a30589 100644
--- a/ManagedObjectAdapter.xcodeproj/project.pbxproj
+++ b/ManagedObjectAdapter.xcodeproj/project.pbxproj
@@ -12,6 +12,9 @@
D3283CC91D48876C00E1B445 /* ManagedObjectSerializing.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3283CC81D48876C00E1B445 /* ManagedObjectSerializing.swift */; };
D3D39DF11D6AA90F00AECD76 /* ManagedObjectAdapterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3D39DF01D6AA90F00AECD76 /* ManagedObjectAdapterTests.swift */; };
D3D39DF31D6AA90F00AECD76 /* ManagedObjectAdapter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D3283C961D4880C500E1B445 /* ManagedObjectAdapter.framework */; };
+ D3D39E061D6AC4DE00AECD76 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = D304AAA21D5B0A7400013742 /* Constants.swift */; };
+ D3D39E071D6AC4E100AECD76 /* ManagedObjectSerializing.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3283CC81D48876C00E1B445 /* ManagedObjectSerializing.swift */; };
+ D3D39E081D6AC4E400AECD76 /* ManagedObjectAdapter.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3283CC21D4881D900E1B445 /* ManagedObjectAdapter.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -27,12 +30,14 @@
/* Begin PBXFileReference section */
D304AAA21D5B0A7400013742 /* Constants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = ""; };
D3283C961D4880C500E1B445 /* ManagedObjectAdapter.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ManagedObjectAdapter.framework; sourceTree = BUILT_PRODUCTS_DIR; };
- D3283CC01D4881BB00E1B445 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
+ D3283CC01D4881BB00E1B445 /* Info-iOS.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Info-iOS.plist"; sourceTree = ""; };
D3283CC21D4881D900E1B445 /* ManagedObjectAdapter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ManagedObjectAdapter.swift; sourceTree = ""; };
D3283CC81D48876C00E1B445 /* ManagedObjectSerializing.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ManagedObjectSerializing.swift; sourceTree = ""; };
D3D39DEE1D6AA90F00AECD76 /* ManagedObjectAdapterTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ManagedObjectAdapterTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
D3D39DF01D6AA90F00AECD76 /* ManagedObjectAdapterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ManagedObjectAdapterTests.swift; sourceTree = ""; };
D3D39DF21D6AA90F00AECD76 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
+ D3D39DFE1D6AC3B600AECD76 /* ManagedObjectAdapter.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ManagedObjectAdapter.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D3D39E091D6AC93600AECD76 /* Info-watchOS.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Info-watchOS.plist"; sourceTree = ""; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -51,6 +56,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ D3D39DFA1D6AC3B600AECD76 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
@@ -68,6 +80,7 @@
children = (
D3283C961D4880C500E1B445 /* ManagedObjectAdapter.framework */,
D3D39DEE1D6AA90F00AECD76 /* ManagedObjectAdapterTests.xctest */,
+ D3D39DFE1D6AC3B600AECD76 /* ManagedObjectAdapter.framework */,
);
name = Products;
sourceTree = "";
@@ -86,7 +99,8 @@
D3283CBF1D4881A200E1B445 /* Supporting Files */ = {
isa = PBXGroup;
children = (
- D3283CC01D4881BB00E1B445 /* Info.plist */,
+ D3283CC01D4881BB00E1B445 /* Info-iOS.plist */,
+ D3D39E091D6AC93600AECD76 /* Info-watchOS.plist */,
);
path = "Supporting Files";
sourceTree = "";
@@ -110,12 +124,19 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ D3D39DFB1D6AC3B600AECD76 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
- D3283C951D4880C500E1B445 /* ManagedObjectAdapter */ = {
+ D3283C951D4880C500E1B445 /* ManagedObjectAdapter iOS */ = {
isa = PBXNativeTarget;
- buildConfigurationList = D3283C9E1D4880C500E1B445 /* Build configuration list for PBXNativeTarget "ManagedObjectAdapter" */;
+ buildConfigurationList = D3283C9E1D4880C500E1B445 /* Build configuration list for PBXNativeTarget "ManagedObjectAdapter iOS" */;
buildPhases = (
D3283C911D4880C500E1B445 /* Sources */,
D3283C921D4880C500E1B445 /* Frameworks */,
@@ -126,7 +147,7 @@
);
dependencies = (
);
- name = ManagedObjectAdapter;
+ name = "ManagedObjectAdapter iOS";
productName = ManagedObjectAdapter;
productReference = D3283C961D4880C500E1B445 /* ManagedObjectAdapter.framework */;
productType = "com.apple.product-type.framework";
@@ -149,6 +170,24 @@
productReference = D3D39DEE1D6AA90F00AECD76 /* ManagedObjectAdapterTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
+ D3D39DFD1D6AC3B600AECD76 /* ManagedObjectAdapter watchOS */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = D3D39E031D6AC3B600AECD76 /* Build configuration list for PBXNativeTarget "ManagedObjectAdapter watchOS" */;
+ buildPhases = (
+ D3D39DF91D6AC3B600AECD76 /* Sources */,
+ D3D39DFA1D6AC3B600AECD76 /* Frameworks */,
+ D3D39DFB1D6AC3B600AECD76 /* Headers */,
+ D3D39DFC1D6AC3B600AECD76 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "ManagedObjectAdapter watchOS";
+ productName = "ManagedObjectAdapter watchOS";
+ productReference = D3D39DFE1D6AC3B600AECD76 /* ManagedObjectAdapter.framework */;
+ productType = "com.apple.product-type.framework";
+ };
/* End PBXNativeTarget section */
/* Begin PBXProject section */
@@ -165,6 +204,9 @@
D3D39DED1D6AA90F00AECD76 = {
CreatedOnToolsVersion = 7.3.1;
};
+ D3D39DFD1D6AC3B600AECD76 = {
+ CreatedOnToolsVersion = 7.3.1;
+ };
};
};
buildConfigurationList = D3283C901D4880C500E1B445 /* Build configuration list for PBXProject "ManagedObjectAdapter" */;
@@ -179,7 +221,8 @@
projectDirPath = "";
projectRoot = "";
targets = (
- D3283C951D4880C500E1B445 /* ManagedObjectAdapter */,
+ D3283C951D4880C500E1B445 /* ManagedObjectAdapter iOS */,
+ D3D39DFD1D6AC3B600AECD76 /* ManagedObjectAdapter watchOS */,
D3D39DED1D6AA90F00AECD76 /* ManagedObjectAdapterTests */,
);
};
@@ -200,6 +243,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ D3D39DFC1D6AC3B600AECD76 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@@ -221,12 +271,22 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ D3D39DF91D6AC3B600AECD76 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D3D39E071D6AC4E100AECD76 /* ManagedObjectSerializing.swift in Sources */,
+ D3D39E061D6AC4DE00AECD76 /* Constants.swift in Sources */,
+ D3D39E081D6AC4E400AECD76 /* ManagedObjectAdapter.swift in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
D3D39DF51D6AA90F00AECD76 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
- target = D3283C951D4880C500E1B445 /* ManagedObjectAdapter */;
+ target = D3283C951D4880C500E1B445 /* ManagedObjectAdapter iOS */;
targetProxy = D3D39DF41D6AA90F00AECD76 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
@@ -331,11 +391,11 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
- INFOPLIST_FILE = "$(SRCROOT)/ManagedObjectAdapter/Supporting Files/Info.plist";
+ INFOPLIST_FILE = "$(SRCROOT)/ManagedObjectAdapter/Supporting Files/Info-iOS.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = Teambition.ManagedObjectAdapter;
- PRODUCT_NAME = "$(TARGET_NAME)";
+ PRODUCT_NAME = ManagedObjectAdapter;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
@@ -349,11 +409,11 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
- INFOPLIST_FILE = "$(SRCROOT)/ManagedObjectAdapter/Supporting Files/Info.plist";
+ INFOPLIST_FILE = "$(SRCROOT)/ManagedObjectAdapter/Supporting Files/Info-iOS.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = Teambition.ManagedObjectAdapter;
- PRODUCT_NAME = "$(TARGET_NAME)";
+ PRODUCT_NAME = ManagedObjectAdapter;
SKIP_INSTALL = YES;
};
name = Release;
@@ -380,6 +440,46 @@
};
name = Release;
};
+ D3D39E041D6AC3B600AECD76 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ APPLICATION_EXTENSION_API_ONLY = YES;
+ DEFINES_MODULE = YES;
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ INFOPLIST_FILE = "$(SRCROOT)/ManagedObjectAdapter/Supporting Files/Info-watchOS.plist";
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ PRODUCT_BUNDLE_IDENTIFIER = "Teambition.ManagedObjectAdapter-watchOS";
+ PRODUCT_NAME = ManagedObjectAdapter;
+ SDKROOT = watchos;
+ SKIP_INSTALL = YES;
+ TARGETED_DEVICE_FAMILY = 4;
+ WATCHOS_DEPLOYMENT_TARGET = 2.2;
+ };
+ name = Debug;
+ };
+ D3D39E051D6AC3B600AECD76 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ APPLICATION_EXTENSION_API_ONLY = YES;
+ DEFINES_MODULE = YES;
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ INFOPLIST_FILE = "$(SRCROOT)/ManagedObjectAdapter/Supporting Files/Info-watchOS.plist";
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ PRODUCT_BUNDLE_IDENTIFIER = "Teambition.ManagedObjectAdapter-watchOS";
+ PRODUCT_NAME = ManagedObjectAdapter;
+ SDKROOT = watchos;
+ SKIP_INSTALL = YES;
+ TARGETED_DEVICE_FAMILY = 4;
+ WATCHOS_DEPLOYMENT_TARGET = 2.2;
+ };
+ name = Release;
+ };
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
@@ -392,7 +492,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
- D3283C9E1D4880C500E1B445 /* Build configuration list for PBXNativeTarget "ManagedObjectAdapter" */ = {
+ D3283C9E1D4880C500E1B445 /* Build configuration list for PBXNativeTarget "ManagedObjectAdapter iOS" */ = {
isa = XCConfigurationList;
buildConfigurations = (
D3283C9F1D4880C500E1B445 /* Debug */,
@@ -409,6 +509,14 @@
);
defaultConfigurationIsVisible = 0;
};
+ D3D39E031D6AC3B600AECD76 /* Build configuration list for PBXNativeTarget "ManagedObjectAdapter watchOS" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ D3D39E041D6AC3B600AECD76 /* Debug */,
+ D3D39E051D6AC3B600AECD76 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ };
/* End XCConfigurationList section */
};
rootObject = D3283C8D1D4880C500E1B445 /* Project object */;
diff --git a/ManagedObjectAdapter.xcodeproj/xcshareddata/xcschemes/ManagedObjectAdapter.xcscheme b/ManagedObjectAdapter.xcodeproj/xcshareddata/xcschemes/ManagedObjectAdapter iOS.xcscheme
similarity index 94%
rename from ManagedObjectAdapter.xcodeproj/xcshareddata/xcschemes/ManagedObjectAdapter.xcscheme
rename to ManagedObjectAdapter.xcodeproj/xcshareddata/xcschemes/ManagedObjectAdapter iOS.xcscheme
index 79310a0..75d8f28 100644
--- a/ManagedObjectAdapter.xcodeproj/xcshareddata/xcschemes/ManagedObjectAdapter.xcscheme
+++ b/ManagedObjectAdapter.xcodeproj/xcshareddata/xcschemes/ManagedObjectAdapter iOS.xcscheme
@@ -16,7 +16,7 @@
BuildableIdentifier = "primary"
BlueprintIdentifier = "D3283C951D4880C500E1B445"
BuildableName = "ManagedObjectAdapter.framework"
- BlueprintName = "ManagedObjectAdapter"
+ BlueprintName = "ManagedObjectAdapter iOS"
ReferencedContainer = "container:ManagedObjectAdapter.xcodeproj">
@@ -44,7 +44,7 @@
BuildableIdentifier = "primary"
BlueprintIdentifier = "D3283C951D4880C500E1B445"
BuildableName = "ManagedObjectAdapter.framework"
- BlueprintName = "ManagedObjectAdapter"
+ BlueprintName = "ManagedObjectAdapter iOS"
ReferencedContainer = "container:ManagedObjectAdapter.xcodeproj">
@@ -66,7 +66,7 @@
BuildableIdentifier = "primary"
BlueprintIdentifier = "D3283C951D4880C500E1B445"
BuildableName = "ManagedObjectAdapter.framework"
- BlueprintName = "ManagedObjectAdapter"
+ BlueprintName = "ManagedObjectAdapter iOS"
ReferencedContainer = "container:ManagedObjectAdapter.xcodeproj">
@@ -84,7 +84,7 @@
BuildableIdentifier = "primary"
BlueprintIdentifier = "D3283C951D4880C500E1B445"
BuildableName = "ManagedObjectAdapter.framework"
- BlueprintName = "ManagedObjectAdapter"
+ BlueprintName = "ManagedObjectAdapter iOS"
ReferencedContainer = "container:ManagedObjectAdapter.xcodeproj">
diff --git a/ManagedObjectAdapter.xcodeproj/xcshareddata/xcschemes/ManagedObjectAdapter watchOS.xcscheme b/ManagedObjectAdapter.xcodeproj/xcshareddata/xcschemes/ManagedObjectAdapter watchOS.xcscheme
new file mode 100644
index 0000000..e33e5fc
--- /dev/null
+++ b/ManagedObjectAdapter.xcodeproj/xcshareddata/xcschemes/ManagedObjectAdapter watchOS.xcscheme
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ManagedObjectAdapter.xcodeproj/xcuserdata/hongxin.xcuserdatad/xcschemes/xcschememanagement.plist b/ManagedObjectAdapter.xcodeproj/xcuserdata/hongxin.xcuserdatad/xcschemes/xcschememanagement.plist
index 7477392..80546c2 100644
--- a/ManagedObjectAdapter.xcodeproj/xcuserdata/hongxin.xcuserdatad/xcschemes/xcschememanagement.plist
+++ b/ManagedObjectAdapter.xcodeproj/xcuserdata/hongxin.xcuserdatad/xcschemes/xcschememanagement.plist
@@ -4,16 +4,21 @@
SchemeUserState
- ManagedObjectAdapter.xcscheme_^#shared#^_
+ ManagedObjectAdapter iOS.xcscheme_^#shared#^_
orderHint
0
- ManagedObjectAdapterTests.xcscheme
+ ManagedObjectAdapter watchOS.xcscheme_^#shared#^_
orderHint
1
+ ManagedObjectAdapterTests.xcscheme
+
+ orderHint
+ 2
+
SuppressBuildableAutocreation
@@ -27,6 +32,11 @@
primary
+ D3D39DFD1D6AC3B600AECD76
+
+ primary
+
+
diff --git a/ManagedObjectAdapter/ManagedObjectAdapter.swift b/ManagedObjectAdapter/ManagedObjectAdapter.swift
index a2d3178..517d8f6 100644
--- a/ManagedObjectAdapter/ManagedObjectAdapter.swift
+++ b/ManagedObjectAdapter/ManagedObjectAdapter.swift
@@ -15,11 +15,15 @@ internal func performInContext(context: NSManagedObjectContext?, block: () -> Vo
return
}
+ #if os(watchOS)
+ context.performBlockAndWait(block)
+ #else
if context.concurrencyType == .ConfinementConcurrencyType {
block()
} else {
context.performBlockAndWait(block)
}
+ #endif
}
public extension ManagedObjectSerializing {
diff --git a/ManagedObjectAdapter/Supporting Files/Info.plist b/ManagedObjectAdapter/Supporting Files/Info-iOS.plist
similarity index 100%
rename from ManagedObjectAdapter/Supporting Files/Info.plist
rename to ManagedObjectAdapter/Supporting Files/Info-iOS.plist
diff --git a/ManagedObjectAdapter/Supporting Files/Info-watchOS.plist b/ManagedObjectAdapter/Supporting Files/Info-watchOS.plist
new file mode 100644
index 0000000..5f59404
--- /dev/null
+++ b/ManagedObjectAdapter/Supporting Files/Info-watchOS.plist
@@ -0,0 +1,26 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ en
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+ CFBundleIdentifier
+ $(PRODUCT_BUNDLE_IDENTIFIER)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ $(PRODUCT_NAME)
+ CFBundlePackageType
+ FMWK
+ CFBundleShortVersionString
+ 0.0.1
+ CFBundleSignature
+ ????
+ CFBundleVersion
+ $(CURRENT_PROJECT_VERSION)
+ NSPrincipalClass
+
+
+