From 290a59525986e5d2d424558d5a726d202091f64b Mon Sep 17 00:00:00 2001 From: Ari Lazier Date: Wed, 21 Oct 2015 19:12:36 -0700 Subject: [PATCH 1/3] update to latest core --- RealmJS.xcodeproj/project.pbxproj | 8 ++++---- src/RJSUtil.mm | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/RealmJS.xcodeproj/project.pbxproj b/RealmJS.xcodeproj/project.pbxproj index 1abb8a9c..e4b0e238 100644 --- a/RealmJS.xcodeproj/project.pbxproj +++ b/RealmJS.xcodeproj/project.pbxproj @@ -574,7 +574,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = ": ${REALM_CORE_VERSION:=0.92.1.1} # set to \"current\" to always use the current build\n\necho \"Downloading dependency: core ${REALM_CORE_VERSION}\"\nTMP_DIR=\"$TMPDIR/core_bin\"\nmkdir -p \"${TMP_DIR}\"\nCORE_TMP_TAR=\"${TMP_DIR}/core-${REALM_CORE_VERSION}.tar.bz2.tmp\"\nCORE_TAR=\"${TMP_DIR}/core-${REALM_CORE_VERSION}.tar.bz2\"\nif [ ! -f \"${CORE_TAR}\" ]; then\ncurl -f -L -s \"http://static.realm.io/downloads/core/realm-core-${REALM_CORE_VERSION}.tar.bz2\" -o \"${CORE_TMP_TAR}\" ||\n(echo \"Downloading core failed. Please try again once you have an Internet connection.\" && exit 1)\nmv \"${CORE_TMP_TAR}\" \"${CORE_TAR}\"\nfi\n\n(\ncd \"${TMP_DIR}\"\nrm -rf core\ntar xjf \"${CORE_TAR}\"\nmv core core-${REALM_CORE_VERSION}\n)\n\nrm -rf core-${REALM_CORE_VERSION} core\nmv ${TMP_DIR}/core-${REALM_CORE_VERSION} .\nln -s core-${REALM_CORE_VERSION} core"; + shellScript = ": ${REALM_CORE_VERSION:=0.94.3} # set to \"current\" to always use the current build\n\necho \"Downloading dependency: core ${REALM_CORE_VERSION}\"\nTMP_DIR=\"$TMPDIR/core_bin\"\nmkdir -p \"${TMP_DIR}\"\nCORE_TMP_TAR=\"${TMP_DIR}/core-${REALM_CORE_VERSION}.tar.bz2.tmp\"\nCORE_TAR=\"${TMP_DIR}/core-${REALM_CORE_VERSION}.tar.bz2\"\nif [ ! -f \"${CORE_TAR}\" ]; then\ncurl -f -L -s \"http://static.realm.io/downloads/core/realm-core-${REALM_CORE_VERSION}.tar.bz2\" -o \"${CORE_TMP_TAR}\" ||\n(echo \"Downloading core failed. Please try again once you have an Internet connection.\" && exit 1)\nmv \"${CORE_TMP_TAR}\" \"${CORE_TAR}\"\nfi\n\n(\ncd \"${TMP_DIR}\"\nrm -rf core\ntar xjf \"${CORE_TAR}\"\nmv core core-${REALM_CORE_VERSION}\n)\n\nrm -rf core-${REALM_CORE_VERSION} core\nmv ${TMP_DIR}/core-${REALM_CORE_VERSION} .\nln -s core-${REALM_CORE_VERSION} core"; }; /* End PBXShellScriptBuildPhase section */ @@ -870,7 +870,7 @@ "-isystem", core/include, ); - OTHER_LDFLAGS = "-lrealm-ios"; + OTHER_LDFLAGS = "-lrealm-ios-bitcode"; OTHER_LIBTOOLFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = "io.realm.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -903,7 +903,7 @@ "-isystem", core/include, ); - OTHER_LDFLAGS = "-lrealm-ios"; + OTHER_LDFLAGS = "-lrealm-ios-bitcode"; OTHER_LIBTOOLFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = "io.realm.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1036,7 +1036,7 @@ "-isystem", core/include, ); - OTHER_LDFLAGS = "-lrealm-ios"; + OTHER_LDFLAGS = "-lrealm-ios-bitcode"; OTHER_LIBTOOLFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = "io.realm.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/src/RJSUtil.mm b/src/RJSUtil.mm index 6429cf3d..c64a3f34 100644 --- a/src/RJSUtil.mm +++ b/src/RJSUtil.mm @@ -150,13 +150,13 @@ struct TrueExpression : realm::Expression { return realm::not_found; } void set_table() override {} - const realm::Table* get_table() override { return nullptr; } + const realm::Table* get_table() const override { return nullptr; } }; struct FalseExpression : realm::Expression { size_t find_first(size_t, size_t) const override { return realm::not_found; } void set_table() override {} - const realm::Table* get_table() override { return nullptr; } + const realm::Table* get_table() const override { return nullptr; } }; NSString *operatorName(NSPredicateOperatorType operatorType) @@ -338,7 +338,7 @@ void process_or_group(realm::Query &query, id array, Func&& func) { // Queries can't be empty, so if there's zero things in the OR group // validation will fail. Work around this by adding an expression which // will never find any rows in a table. - query.expression(new FalseExpression); + query.and_query(new FalseExpression); } query.end_group(); @@ -565,7 +565,7 @@ void update_query_with_predicate(NSPredicate *predicate, realm::Schema &schema, query.end_group(); } else { // NSCompoundPredicate's documentation states that an AND predicate with no subpredicates evaluates to TRUE. - query.expression(new TrueExpression); + query.and_query(new TrueExpression); } break; @@ -634,9 +634,9 @@ void update_query_with_predicate(NSPredicate *predicate, realm::Schema &schema, } } else if ([predicate isEqual:[NSPredicate predicateWithValue:YES]]) { - query.expression(new TrueExpression); + query.and_query(new TrueExpression); } else if ([predicate isEqual:[NSPredicate predicateWithValue:NO]]) { - query.expression(new FalseExpression); + query.and_query(new FalseExpression); } else { // invalid predicate type From 5d78670802f55abc0dc6f0539b1a790a30be29ee Mon Sep 17 00:00:00 2001 From: Ari Lazier Date: Wed, 21 Oct 2015 19:17:22 -0700 Subject: [PATCH 2/3] make ReactTests a subproject of RealmJS --- RealmJS.xcodeproj/project.pbxproj | 43 +++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/RealmJS.xcodeproj/project.pbxproj b/RealmJS.xcodeproj/project.pbxproj index e4b0e238..f1f7ae14 100644 --- a/RealmJS.xcodeproj/project.pbxproj +++ b/RealmJS.xcodeproj/project.pbxproj @@ -124,6 +124,20 @@ remoteGlobalIDString = 02B58CB01AE99CEC009B348C; remoteInfo = RealmJS; }; + 02EE6D891BD87E310016A82E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 02EE6D781BD87E310016A82E /* ReactTests.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 13B07F961A680F5B00A75B9A; + remoteInfo = ReactTests; + }; + 02EE6D8B1BD87E310016A82E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 02EE6D781BD87E310016A82E /* ReactTests.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 00E356EE1AD99517003FC87E; + remoteInfo = RealmReactTests; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -198,6 +212,7 @@ 02C0864C1BCDB27000942F9C /* list.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = list.cpp; path = "src/object-store/list.cpp"; sourceTree = ""; }; 02C0864D1BCDB27000942F9C /* list.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = list.hpp; path = "src/object-store/list.hpp"; sourceTree = ""; }; 02D456D91B7E59A500EE1299 /* ArrayTests.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = ArrayTests.js; path = tests/ArrayTests.js; sourceTree = SOURCE_ROOT; }; + 02EE6D781BD87E310016A82E /* ReactTests.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactTests.xcodeproj; path = tests/ReactTests/ios/ReactTests.xcodeproj; sourceTree = ""; }; F64E1EF01BC3510E00E0E150 /* util.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = util.js; path = tests/util.js; sourceTree = SOURCE_ROOT; }; F68A278A1BC2722A0063D40A /* RJSModuleLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RJSModuleLoader.h; path = tests/RJSModuleLoader.h; sourceTree = SOURCE_ROOT; }; F68A278B1BC2722A0063D40A /* RJSModuleLoader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RJSModuleLoader.m; path = tests/RJSModuleLoader.m; sourceTree = SOURCE_ROOT; }; @@ -305,6 +320,7 @@ isa = PBXGroup; children = ( 02A3C7841BC4317A00B1A7BE /* GCDWebServer.xcodeproj */, + 02EE6D781BD87E310016A82E /* ReactTests.xcodeproj */, 02B58CCF1AE99D8C009B348C /* Frameworks */, 0270BC3D1B7CFBFD00010E03 /* RealmJS */, 02B58CC01AE99CEC009B348C /* RealmJSTests */, @@ -354,6 +370,15 @@ name = Frameworks; sourceTree = ""; }; + 02EE6D791BD87E310016A82E /* Products */ = { + isa = PBXGroup; + children = ( + 02EE6D8A1BD87E310016A82E /* ReactTests.app */, + 02EE6D8C1BD87E310016A82E /* RealmReactTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -487,6 +512,10 @@ ProductGroup = 02A3C7851BC4317A00B1A7BE /* Products */; ProjectRef = 02A3C7841BC4317A00B1A7BE /* GCDWebServer.xcodeproj */; }, + { + ProductGroup = 02EE6D791BD87E310016A82E /* Products */; + ProjectRef = 02EE6D781BD87E310016A82E /* ReactTests.xcodeproj */; + }, ); projectRoot = ""; targets = ( @@ -533,6 +562,20 @@ remoteRef = 02A3C7951BC4317A00B1A7BE /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + 02EE6D8A1BD87E310016A82E /* ReactTests.app */ = { + isa = PBXReferenceProxy; + fileType = wrapper.application; + path = ReactTests.app; + remoteRef = 02EE6D891BD87E310016A82E /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 02EE6D8C1BD87E310016A82E /* RealmReactTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = RealmReactTests.xctest; + remoteRef = 02EE6D8B1BD87E310016A82E /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ From 08a84bd8e9003f35c238a013c338be0d69a7c8a8 Mon Sep 17 00:00:00 2001 From: Ari Lazier Date: Wed, 21 Oct 2015 19:20:45 -0700 Subject: [PATCH 3/3] cleanup scheme and target names --- .../ios/ReactTests.xcodeproj/project.pbxproj | 12 ++++++------ .../{ReactTests.xcscheme => ReactTestApp.xcscheme} | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) rename tests/ReactTests/ios/ReactTests.xcodeproj/xcshareddata/xcschemes/{ReactTests.xcscheme => ReactTestApp.xcscheme} (96%) diff --git a/tests/ReactTests/ios/ReactTests.xcodeproj/project.pbxproj b/tests/ReactTests/ios/ReactTests.xcodeproj/project.pbxproj index 5dc9e31b..5920f141 100644 --- a/tests/ReactTests/ios/ReactTests.xcodeproj/project.pbxproj +++ b/tests/ReactTests/ios/ReactTests.xcodeproj/project.pbxproj @@ -409,9 +409,9 @@ productReference = 00E356EE1AD99517003FC87E /* RealmReactTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; - 13B07F861A680F5B00A75B9A /* ReactTests */ = { + 13B07F861A680F5B00A75B9A /* ReactTestApp */ = { isa = PBXNativeTarget; - buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ReactTests" */; + buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ReactTestApp" */; buildPhases = ( F65C4BCA1BC72C5A000A1793 /* ShellScript */, 13B07F871A680F5B00A75B9A /* Sources */, @@ -424,7 +424,7 @@ dependencies = ( F6F405B81BCE55FB00A1E24F /* PBXTargetDependency */, ); - name = ReactTests; + name = ReactTestApp; productName = "Hello World"; productReference = 13B07F961A680F5B00A75B9A /* ReactTests.app */; productType = "com.apple.product-type.application"; @@ -507,7 +507,7 @@ ); projectRoot = ""; targets = ( - 13B07F861A680F5B00A75B9A /* ReactTests */, + 13B07F861A680F5B00A75B9A /* ReactTestApp */, 00E356ED1AD99517003FC87E /* RealmReactTests */, ); }; @@ -674,7 +674,7 @@ /* Begin PBXTargetDependency section */ 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 13B07F861A680F5B00A75B9A /* ReactTests */; + target = 13B07F861A680F5B00A75B9A /* ReactTestApp */; targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; }; F6F405B81BCE55FB00A1E24F /* PBXTargetDependency */ = { @@ -859,7 +859,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ReactTests" */ = { + 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ReactTestApp" */ = { isa = XCConfigurationList; buildConfigurations = ( 13B07F941A680F5B00A75B9A /* Debug */, diff --git a/tests/ReactTests/ios/ReactTests.xcodeproj/xcshareddata/xcschemes/ReactTests.xcscheme b/tests/ReactTests/ios/ReactTests.xcodeproj/xcshareddata/xcschemes/ReactTestApp.xcscheme similarity index 96% rename from tests/ReactTests/ios/ReactTests.xcodeproj/xcshareddata/xcschemes/ReactTests.xcscheme rename to tests/ReactTests/ios/ReactTests.xcodeproj/xcshareddata/xcschemes/ReactTestApp.xcscheme index 00978f6d..d5061232 100644 --- a/tests/ReactTests/ios/ReactTests.xcodeproj/xcshareddata/xcschemes/ReactTests.xcscheme +++ b/tests/ReactTests/ios/ReactTests.xcodeproj/xcshareddata/xcschemes/ReactTestApp.xcscheme @@ -16,7 +16,7 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "13B07F861A680F5B00A75B9A" BuildableName = "ReactTests.app" - BlueprintName = "ReactTests" + BlueprintName = "ReactTestApp" ReferencedContainer = "container:ReactTests.xcodeproj"> @@ -58,7 +58,7 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "13B07F861A680F5B00A75B9A" BuildableName = "ReactTests.app" - BlueprintName = "ReactTests" + BlueprintName = "ReactTestApp" ReferencedContainer = "container:ReactTests.xcodeproj"> @@ -81,7 +81,7 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "13B07F861A680F5B00A75B9A" BuildableName = "ReactTests.app" - BlueprintName = "ReactTests" + BlueprintName = "ReactTestApp" ReferencedContainer = "container:ReactTests.xcodeproj"> @@ -100,7 +100,7 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "13B07F861A680F5B00A75B9A" BuildableName = "ReactTests.app" - BlueprintName = "ReactTests" + BlueprintName = "ReactTestApp" ReferencedContainer = "container:ReactTests.xcodeproj">