Compare commits

..

No commits in common. "master" and "issue426" have entirely different histories.

120 changed files with 4517 additions and 6747 deletions

View File

@ -1,5 +1,5 @@
language: objective-c
osx_image: xcode9.2
osx_image: xcode8.3
before_script:
- export LANG=en_US.UTF-8

View File

@ -140,12 +140,6 @@ framework module YapDatabase {
header "YapDatabaseConnectionProxy.h"
}
// Extension: ConnectionPool
explicit module YapDatabaseConnectionPool {
header "YapDatabaseConnectionPool.h"
}
// Extension: ActionManager
explicit module YapDatabaseActionManager {

View File

@ -16,7 +16,6 @@
@import YapDatabase.YapDatabaseHooks;
@import YapDatabase.YapDatabaseRTreeIndex;
@import YapDatabase.YapDatabaseConnectionProxy;
@import YapDatabase.YapDatabaseConnectionPool;
@import YapDatabase.YapDatabaseActionManager;
#if !TARGET_OS_WATCH
@import YapDatabase.YapDatabaseCloudKit;

View File

@ -140,12 +140,6 @@ framework module YapDatabase {
header "YapDatabaseConnectionProxy.h"
}
// Extension: ConnectionPool
explicit module YapDatabaseConnectionPool {
header "YapDatabaseConnectionPool.h"
}
// Extension: ActionManager
explicit module YapDatabaseActionManager {

View File

@ -140,12 +140,6 @@ framework module YapDatabase {
header "YapDatabaseConnectionProxy.h"
}
// Extension: ConnectionPool
explicit module YapDatabaseConnectionPool {
header "YapDatabaseConnectionPool.h"
}
// Extension: ActionManager
explicit module YapDatabaseActionManager {

View File

@ -140,12 +140,6 @@ framework module YapDatabase {
header "YapDatabaseConnectionProxy.h"
}
// Extension: ConnectionPool
explicit module YapDatabaseConnectionPool {
header "YapDatabaseConnectionPool.h"
}
// Extension: ActionManager
explicit module YapDatabaseActionManager {

View File

@ -28,6 +28,8 @@ It has the following features:
* **Performance**. Fetch thousands of objects on the main thread without dropping a frame.
* **Objective-C**. A simple to use Objective-C API means you'll be up and running in no time.
<br/>
**[See what the API looks like in "hello world" for YapDatabase](https://github.com/yapstudios/YapDatabase/wiki/Hello-World)**<br/>

View File

@ -50,7 +50,7 @@
YapDatabaseConnection *connection = [database newConnection];
YapDatabaseFullTextSearchHandler *handler = [YapDatabaseFullTextSearchHandler withObjectBlock:
^(YapDatabaseReadTransaction *transaction, NSMutableDictionary *dict, NSString *collection, NSString *key, id object){
^(NSMutableDictionary *dict, NSString *collection, NSString *key, id object){
[dict setObject:object forKey:@"content"];
}];
@ -169,7 +169,7 @@
YapDatabaseConnection *connection = [database newConnection];
YapDatabaseFullTextSearchHandler *handler = [YapDatabaseFullTextSearchHandler withObjectBlock:
^(YapDatabaseReadTransaction *transaction, NSMutableDictionary *dict, NSString *collection, NSString *key, id object){
^(NSMutableDictionary *dict, NSString *collection, NSString *key, id object){
[dict setObject:object forKey:@"content"];
}];

View File

@ -4292,66 +4292,6 @@
}];
}
/**
* Issue #399 refers to a crash when:
* - manual edges are being used
* - an edge is being immediately deleted
* - but the NotInDatabase flag wasn't being set
*
* We discovered a similar crash when using protocolEdges.
**/
- (void)testIssue399_protocol
{
NSString *databasePath = [self databasePath:NSStringFromSelector(_cmd)];
[[NSFileManager defaultManager] removeItemAtPath:databasePath error:NULL];
YapDatabase *database = [[YapDatabase alloc] initWithPath:databasePath];
XCTAssertNotNil(database);
YapDatabaseConnection *connection = [database newConnection];
YapDatabaseRelationship *relationship = [[YapDatabaseRelationship alloc] init];
BOOL registered = [database registerExtension:relationship withName:@"relationship"];
XCTAssertTrue(registered, @"Error registering extension");
__block Node_Standard *node = nil;
[connection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
[transaction setObject:@"string" forKey:@"valid" inCollection:nil];
node = [[Node_Standard alloc] init];
node.childKeys = @[@"valid", @"invalid-1"];
// The node.childKeys has 2 items,
// and so it will attempt to create 2 edges.
// - The first is valid
// - The second is invalid
//
// The invalid edge should be deleted during [YapDBRelationshipTransaction flush].
//
// Note:
// In this case, 'node' is a newly inserted item in the database.
// Which means the code path taken is different from a modified item.
// So we need another unit test to achieve proper unit test coverage for this issue.
//
[transaction setObject:node forKey:node.key inCollection:nil];
}];
[connection readWriteWithBlock:^(YapDatabaseReadWriteTransaction * _Nonnull transaction) {
node = [transaction objectForKey:node.key inCollection:nil];
node.childKeys = @[@"valid", @"invalid-2"];
// In this case, 'node' is a modified item in the database.
// Which means the code path taken is different from an inserted item.
//
[transaction setObject:node forKey:node.key inCollection:nil];
}];
}
/**
* Issue #426 - https://github.com/yapstudios/YapDatabase/issues/426

View File

@ -169,7 +169,7 @@
// Setup FTS
YapDatabaseFullTextSearchHandler *handler = [YapDatabaseFullTextSearchHandler withObjectBlock:
^(YapDatabaseReadTransaction *transaction, NSMutableDictionary *dict, NSString *collection, NSString *key, id object){
^(NSMutableDictionary *dict, NSString *collection, NSString *key, id object){
[dict setObject:object forKey:@"content"];
}];
@ -259,7 +259,7 @@
// Setup FTS
YapDatabaseFullTextSearchHandler *handler = [YapDatabaseFullTextSearchHandler withObjectBlock:
^(YapDatabaseReadTransaction *transaction, NSMutableDictionary *dict, NSString *collection, NSString *key, id object){
^(NSMutableDictionary *dict, NSString *collection, NSString *key, id object){
[dict setObject:object forKey:@"content"];
}];

View File

@ -1,9 +1,9 @@
PODS:
- CocoaLumberjack (3.4.1):
- CocoaLumberjack/Default (= 3.4.1)
- CocoaLumberjack/Extensions (= 3.4.1)
- CocoaLumberjack/Default (3.4.1)
- CocoaLumberjack/Extensions (3.4.1):
- CocoaLumberjack (3.3.0):
- CocoaLumberjack/Default (= 3.3.0)
- CocoaLumberjack/Extensions (= 3.3.0)
- CocoaLumberjack/Default (3.3.0)
- CocoaLumberjack/Extensions (3.3.0):
- CocoaLumberjack/Default
- YapDatabase (3.0.2):
- YapDatabase/Standard (= 3.0.2)
@ -18,7 +18,6 @@ PODS:
- YapDatabase/Standard/Extensions/AutoView (= 3.0.2)
- YapDatabase/Standard/Extensions/CloudCore (= 3.0.2)
- YapDatabase/Standard/Extensions/CloudKit (= 3.0.2)
- YapDatabase/Standard/Extensions/ConnectionPool (= 3.0.2)
- YapDatabase/Standard/Extensions/ConnectionProxy (= 3.0.2)
- YapDatabase/Standard/Extensions/CrossProcessNotification (= 3.0.2)
- YapDatabase/Standard/Extensions/FilteredView (= 3.0.2)
@ -40,8 +39,6 @@ PODS:
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/CloudKit (3.0.2):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/ConnectionPool (3.0.2):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/ConnectionProxy (3.0.2):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/CrossProcessNotification (3.0.2):
@ -77,9 +74,9 @@ EXTERNAL SOURCES:
:path: ../../
SPEC CHECKSUMS:
CocoaLumberjack: 2e258a064cacc8eb9a2aca318e24d02a0a7fd56d
YapDatabase: 972eccb0c997d0dafe8192dccf7f58351914baf1
CocoaLumberjack: 3c8c74683302f9012bb168e1c4b7ae3c0b558431
YapDatabase: 299a32de9d350d37a9ac5b0532609d87d5d2a5de
PODFILE CHECKSUM: 8dceb5c937bc6e9558d8d75103d141eef959b637
PODFILE CHECKSUM: 27f2264941859e807f069adfc2aa0a50167ae03d
COCOAPODS: 1.4.0
COCOAPODS: 1.3.1

View File

@ -279,14 +279,13 @@ unsigned long long const kDDDefaultLogFilesDiskQuota = 20 * 1024 * 1024; // 20
- (BOOL)isLogFile:(NSString *)fileName {
NSString *appName = [self applicationName];
// We need to add a space to the name as otherwise we could match applications that have the name prefix.
BOOL hasProperPrefix = [fileName hasPrefix:[appName stringByAppendingString:@" "]];
BOOL hasProperPrefix = [fileName hasPrefix:appName];
BOOL hasProperSuffix = [fileName hasSuffix:@".log"];
return (hasProperPrefix && hasProperSuffix);
}
// if you change formatter, then change sortedLogFileInfos method also accordingly
//if you change formater , then change sortedLogFileInfos method also accordingly
- (NSDateFormatter *)logFileDateFormatter {
NSMutableDictionary *dictionary = [[NSThread currentThread]
threadDictionary];

View File

@ -351,16 +351,17 @@ static NSUInteger _numProcessors;
// Dispatch semaphores call down to the kernel only when the calling thread needs to be blocked.
// If the calling semaphore does not need to block, no kernel call is made.
dispatch_semaphore_wait(_queueSemaphore, DISPATCH_TIME_FOREVER);
// We've now sure we won't overflow the queue.
// It is time to queue our log message.
dispatch_block_t logBlock = ^{
dispatch_semaphore_wait(_queueSemaphore, DISPATCH_TIME_FOREVER);
@autoreleasepool {
[self lt_log:logMessage];
}
};
// We've now sure we won't overflow the queue.
// It is time to queue our log message.
if (asyncFlag) {
dispatch_async(_loggingQueue, logBlock);
} else {

View File

@ -25,6 +25,7 @@
/**
* This class provides a logger for the Apple os_log facility.
**/
API_AVAILABLE(ios(10.0), macos(10.12), tvos(10.0), watchos(3.0))
@interface DDOSLogger : DDAbstractLogger <DDLogger>
/**

View File

@ -48,30 +48,26 @@ static DDOSLogger *sharedInstance;
return;
}
if(@available(iOS 10.0, macOS 10.12, tvOS 10.0, watchOS 3.0, *)) {
NSString * message = _logFormatter ? [_logFormatter formatLogMessage:logMessage] : logMessage->_message;
if (message) {
const char *msg = [message UTF8String];
NSString * message = _logFormatter ? [_logFormatter formatLogMessage:logMessage] : logMessage->_message;
if (message) {
const char *msg = [message UTF8String];
switch (logMessage->_flag) {
case DDLogFlagError :
os_log_error(OS_LOG_DEFAULT, "%{public}s", msg);
break;
case DDLogFlagWarning :
case DDLogFlagInfo :
os_log_info(OS_LOG_DEFAULT, "%{public}s", msg);
break;
case DDLogFlagDebug :
case DDLogFlagVerbose :
default :
os_log_debug(OS_LOG_DEFAULT, "%{public}s", msg);
break;
}
switch (logMessage->_flag) {
case DDLogFlagError :
os_log_error(OS_LOG_DEFAULT, "%{public}s", msg);
break;
case DDLogFlagWarning :
case DDLogFlagInfo :
os_log_info(OS_LOG_DEFAULT, "%{public}s", msg);
break;
case DDLogFlagDebug :
case DDLogFlagVerbose :
default :
os_log_debug(OS_LOG_DEFAULT, "%{public}s", msg);
break;
}
}
}
- (NSString *)loggerName {

View File

@ -151,16 +151,14 @@ Configure your logging however you want. Change log levels per file (perfect for
### Requirements
The current version of Lumberjack requires:
- Xcode 9 or later
- Swift 4.0 or later
- iOS 6 or later
- OS X 10.8 or later
- Xcode 8 or later
- Swift 3.0 or later
- iOS 5 or later
- OS X 10.7 or later
- WatchOS 2 or later
- TVOS 9 or later
#### Backwards compability
- for iOS 5 and OS X 10.7, use the 3.3 version
- for Xcode 8 and Swift 3, use the 3.2 version
- for Xcode 7.3 and Swift 2.3, use the 2.4.0 version
- for Xcode 7.3 and Swift 2.2, use the 2.3.0 version
- for Xcode 7.2 and 7.1, use the 2.2.0 version

View File

@ -1 +0,0 @@
../../../../../../YapDatabase/Extensions/ConnectionPool/YapDatabaseConnectionPool.h

View File

@ -1 +0,0 @@
../../../../../../YapDatabase/Utilities/YapDatabaseCryptoUtils.h

View File

@ -1 +0,0 @@
../../../../../../YapDatabase/Extensions/ConnectionPool/YapDatabaseConnectionPool.h

View File

@ -1 +0,0 @@
../../../../../../YapDatabase/Utilities/YapDatabaseCryptoUtils.h

View File

@ -12,7 +12,7 @@
"tag": "3.0.2"
},
"platforms": {
"osx": "10.10",
"osx": "10.9",
"ios": "8.0",
"tvos": "9.0",
"watchos": "2.0"
@ -139,10 +139,6 @@
"name": "ConnectionProxy",
"source_files": "YapDatabase/Extensions/ConnectionProxy/**/*.{h,m,mm,c}"
},
{
"name": "ConnectionPool",
"source_files": "YapDatabase/Extensions/ConnectionPool/**/*.{h,m,mm,c}"
},
{
"name": "ActionManager",
"osx": {
@ -292,10 +288,6 @@
"name": "ConnectionProxy",
"source_files": "YapDatabase/Extensions/ConnectionProxy/**/*.{h,m,mm,c}"
},
{
"name": "ConnectionPool",
"source_files": "YapDatabase/Extensions/ConnectionPool/**/*.{h,m,mm,c}"
},
{
"name": "ActionManager",
"osx": {

View File

@ -1,9 +1,9 @@
PODS:
- CocoaLumberjack (3.4.1):
- CocoaLumberjack/Default (= 3.4.1)
- CocoaLumberjack/Extensions (= 3.4.1)
- CocoaLumberjack/Default (3.4.1)
- CocoaLumberjack/Extensions (3.4.1):
- CocoaLumberjack (3.3.0):
- CocoaLumberjack/Default (= 3.3.0)
- CocoaLumberjack/Extensions (= 3.3.0)
- CocoaLumberjack/Default (3.3.0)
- CocoaLumberjack/Extensions (3.3.0):
- CocoaLumberjack/Default
- YapDatabase (3.0.2):
- YapDatabase/Standard (= 3.0.2)
@ -18,7 +18,6 @@ PODS:
- YapDatabase/Standard/Extensions/AutoView (= 3.0.2)
- YapDatabase/Standard/Extensions/CloudCore (= 3.0.2)
- YapDatabase/Standard/Extensions/CloudKit (= 3.0.2)
- YapDatabase/Standard/Extensions/ConnectionPool (= 3.0.2)
- YapDatabase/Standard/Extensions/ConnectionProxy (= 3.0.2)
- YapDatabase/Standard/Extensions/CrossProcessNotification (= 3.0.2)
- YapDatabase/Standard/Extensions/FilteredView (= 3.0.2)
@ -40,8 +39,6 @@ PODS:
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/CloudKit (3.0.2):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/ConnectionPool (3.0.2):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/ConnectionProxy (3.0.2):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/CrossProcessNotification (3.0.2):
@ -77,9 +74,9 @@ EXTERNAL SOURCES:
:path: ../../
SPEC CHECKSUMS:
CocoaLumberjack: 2e258a064cacc8eb9a2aca318e24d02a0a7fd56d
YapDatabase: 972eccb0c997d0dafe8192dccf7f58351914baf1
CocoaLumberjack: 3c8c74683302f9012bb168e1c4b7ae3c0b558431
YapDatabase: 299a32de9d350d37a9ac5b0532609d87d5d2a5de
PODFILE CHECKSUM: 8dceb5c937bc6e9558d8d75103d141eef959b637
PODFILE CHECKSUM: 27f2264941859e807f069adfc2aa0a50167ae03d
COCOAPODS: 1.4.0
COCOAPODS: 1.3.1

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/CocoaLumberjack
CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/CocoaLumberjack
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/CocoaLumberjack" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/YapDatabase"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}
PODS_TARGET_SRCROOT = ${PODS_ROOT}/CocoaLumberjack
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}

View File

@ -6,14 +6,10 @@ mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
# Used as a return value for each invocation of `strip_invalid_archs` function.
STRIP_BINARY_RETVAL=0
# This protects against multiple targets copying the same framework dependency at the same time. The solution
# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
# Copies and strips a vendored framework
install_framework()
{
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
@ -62,31 +58,12 @@ install_framework()
fi
}
# Copies and strips a vendored dSYM
# Copies the dSYM of a vendored framework
install_dsym() {
local source="$1"
if [ -r "$source" ]; then
# Copy the dSYM into a the targets temp dir.
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}"
local basename
basename="$(basename -s .framework.dSYM "$source")"
binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}"
# Strip invalid architectures so "fat" simulator / device frameworks work on device
if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then
strip_invalid_archs "$binary"
fi
if [[ $STRIP_BINARY_RETVAL == 1 ]]; then
# Move the stripped file into its final destination.
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}"
else
# The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing.
touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM"
fi
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}"
fi
}
@ -108,18 +85,10 @@ code_sign_if_enabled() {
# Strip invalid architectures
strip_invalid_archs() {
binary="$1"
# Get architectures for current target binary
binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)"
# Intersect them with the architectures we are building for
intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)"
# If there are no archs supported by this binary then warn the user
if [[ -z "$intersected_archs" ]]; then
echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)."
STRIP_BINARY_RETVAL=0
return
fi
# Get architectures for current file
archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
stripped=""
for arch in $binary_archs; do
for arch in $archs; do
if ! [[ "${ARCHS}" == *"$arch"* ]]; then
# Strip non-valid architectures in-place
lipo -remove "$arch" -output "$binary" "$binary" || exit 1
@ -129,7 +98,6 @@ strip_invalid_archs() {
if [[ "$stripped" ]]; then
echo "Stripped $binary of architectures:$stripped"
fi
STRIP_BINARY_RETVAL=1
}
if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then

View File

@ -1,9 +1,9 @@
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/YapDatabase"
LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CocoaLumberjack" "${PODS_CONFIGURATION_BUILD_DIR}/YapDatabase"
LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/CocoaLumberjack" "$PODS_CONFIGURATION_BUILD_DIR/YapDatabase"
OTHER_CFLAGS = $(inherited) -DYAP_STANDARD_SQLITE $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/CocoaLumberjack" -isystem "${PODS_ROOT}/Headers/Public/YapDatabase"
OTHER_LDFLAGS = $(inherited) -ObjC -l"CocoaLumberjack" -l"YapDatabase" -l"c++" -l"sqlite3" -framework "SystemConfiguration"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods

View File

@ -1,9 +1,9 @@
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/YapDatabase"
LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CocoaLumberjack" "${PODS_CONFIGURATION_BUILD_DIR}/YapDatabase"
LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/CocoaLumberjack" "$PODS_CONFIGURATION_BUILD_DIR/YapDatabase"
OTHER_CFLAGS = $(inherited) -DYAP_STANDARD_SQLITE $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/CocoaLumberjack" -isystem "${PODS_ROOT}/Headers/Public/YapDatabase"
OTHER_LDFLAGS = $(inherited) -ObjC -l"CocoaLumberjack" -l"YapDatabase" -l"c++" -l"sqlite3" -framework "SystemConfiguration"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods

View File

@ -6,14 +6,10 @@ mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
# Used as a return value for each invocation of `strip_invalid_archs` function.
STRIP_BINARY_RETVAL=0
# This protects against multiple targets copying the same framework dependency at the same time. The solution
# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
# Copies and strips a vendored framework
install_framework()
{
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
@ -62,31 +58,12 @@ install_framework()
fi
}
# Copies and strips a vendored dSYM
# Copies the dSYM of a vendored framework
install_dsym() {
local source="$1"
if [ -r "$source" ]; then
# Copy the dSYM into a the targets temp dir.
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}"
local basename
basename="$(basename -s .framework.dSYM "$source")"
binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}"
# Strip invalid architectures so "fat" simulator / device frameworks work on device
if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then
strip_invalid_archs "$binary"
fi
if [[ $STRIP_BINARY_RETVAL == 1 ]]; then
# Move the stripped file into its final destination.
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}"
else
# The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing.
touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM"
fi
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}"
fi
}
@ -108,18 +85,10 @@ code_sign_if_enabled() {
# Strip invalid architectures
strip_invalid_archs() {
binary="$1"
# Get architectures for current target binary
binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)"
# Intersect them with the architectures we are building for
intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)"
# If there are no archs supported by this binary then warn the user
if [[ -z "$intersected_archs" ]]; then
echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)."
STRIP_BINARY_RETVAL=0
return
fi
# Get architectures for current file
archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
stripped=""
for arch in $binary_archs; do
for arch in $archs; do
if ! [[ "${ARCHS}" == *"$arch"* ]]; then
# Strip non-valid architectures in-place
lipo -remove "$arch" -output "$binary" "$binary" || exit 1
@ -129,7 +98,6 @@ strip_invalid_archs() {
if [[ "$stripped" ]]; then
echo "Stripped $binary of architectures:$stripped"
fi
STRIP_BINARY_RETVAL=1
}
if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then

View File

@ -1,9 +1,9 @@
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/YapDatabase"
LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CocoaLumberjack" "${PODS_CONFIGURATION_BUILD_DIR}/YapDatabase"
LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/CocoaLumberjack" "$PODS_CONFIGURATION_BUILD_DIR/YapDatabase"
OTHER_CFLAGS = $(inherited) -DYAP_STANDARD_SQLITE $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/CocoaLumberjack" -isystem "${PODS_ROOT}/Headers/Public/YapDatabase"
OTHER_LDFLAGS = $(inherited) -ObjC -l"CocoaLumberjack" -l"YapDatabase" -l"c++" -l"sqlite3" -framework "SystemConfiguration"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods

View File

@ -1,9 +1,9 @@
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/YapDatabase"
LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CocoaLumberjack" "${PODS_CONFIGURATION_BUILD_DIR}/YapDatabase"
LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/CocoaLumberjack" "$PODS_CONFIGURATION_BUILD_DIR/YapDatabase"
OTHER_CFLAGS = $(inherited) -DYAP_STANDARD_SQLITE $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/CocoaLumberjack" -isystem "${PODS_ROOT}/Headers/Public/YapDatabase"
OTHER_LDFLAGS = $(inherited) -ObjC -l"CocoaLumberjack" -l"YapDatabase" -l"c++" -l"sqlite3" -framework "SystemConfiguration"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods

View File

@ -6,14 +6,10 @@ mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
# Used as a return value for each invocation of `strip_invalid_archs` function.
STRIP_BINARY_RETVAL=0
# This protects against multiple targets copying the same framework dependency at the same time. The solution
# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
# Copies and strips a vendored framework
install_framework()
{
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
@ -62,31 +58,12 @@ install_framework()
fi
}
# Copies and strips a vendored dSYM
# Copies the dSYM of a vendored framework
install_dsym() {
local source="$1"
if [ -r "$source" ]; then
# Copy the dSYM into a the targets temp dir.
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}"
local basename
basename="$(basename -s .framework.dSYM "$source")"
binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}"
# Strip invalid architectures so "fat" simulator / device frameworks work on device
if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then
strip_invalid_archs "$binary"
fi
if [[ $STRIP_BINARY_RETVAL == 1 ]]; then
# Move the stripped file into its final destination.
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}"
else
# The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing.
touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM"
fi
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}"
fi
}
@ -108,18 +85,10 @@ code_sign_if_enabled() {
# Strip invalid architectures
strip_invalid_archs() {
binary="$1"
# Get architectures for current target binary
binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)"
# Intersect them with the architectures we are building for
intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)"
# If there are no archs supported by this binary then warn the user
if [[ -z "$intersected_archs" ]]; then
echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)."
STRIP_BINARY_RETVAL=0
return
fi
# Get architectures for current file
archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
stripped=""
for arch in $binary_archs; do
for arch in $archs; do
if ! [[ "${ARCHS}" == *"$arch"* ]]; then
# Strip non-valid architectures in-place
lipo -remove "$arch" -output "$binary" "$binary" || exit 1
@ -129,7 +98,6 @@ strip_invalid_archs() {
if [[ "$stripped" ]]; then
echo "Stripped $binary of architectures:$stripped"
fi
STRIP_BINARY_RETVAL=1
}
if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then

View File

@ -1,9 +1,9 @@
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/YapDatabase"
LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CocoaLumberjack" "${PODS_CONFIGURATION_BUILD_DIR}/YapDatabase"
LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/CocoaLumberjack" "$PODS_CONFIGURATION_BUILD_DIR/YapDatabase"
OTHER_CFLAGS = $(inherited) -DYAP_STANDARD_SQLITE $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/CocoaLumberjack" -isystem "${PODS_ROOT}/Headers/Public/YapDatabase"
OTHER_LDFLAGS = $(inherited) -ObjC -l"CocoaLumberjack" -l"YapDatabase" -l"c++" -l"sqlite3" -framework "SystemConfiguration"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods

View File

@ -1,9 +1,9 @@
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/YapDatabase"
LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CocoaLumberjack" "${PODS_CONFIGURATION_BUILD_DIR}/YapDatabase"
LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/CocoaLumberjack" "$PODS_CONFIGURATION_BUILD_DIR/YapDatabase"
OTHER_CFLAGS = $(inherited) -DYAP_STANDARD_SQLITE $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/CocoaLumberjack" -isystem "${PODS_ROOT}/Headers/Public/YapDatabase"
OTHER_LDFLAGS = $(inherited) -ObjC -l"CocoaLumberjack" -l"YapDatabase" -l"c++" -l"sqlite3" -framework "SystemConfiguration"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods

View File

@ -1,11 +1,11 @@
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/YapDatabase
CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/YapDatabase
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/YapDatabase" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/YapDatabase"
LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CocoaLumberjack"
LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/CocoaLumberjack"
OTHER_CFLAGS = $(inherited) -DYAP_STANDARD_SQLITE
OTHER_LDFLAGS = -l"c++" -l"sqlite3" -framework "SystemConfiguration"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}
PODS_TARGET_SRCROOT = ${PODS_ROOT}/../../..
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}

View File

@ -40,6 +40,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
@ -69,6 +70,7 @@
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@ -1,72 +1,69 @@
PODS:
- CocoaLumberjack (3.4.1):
- CocoaLumberjack/Default (= 3.4.1)
- CocoaLumberjack/Extensions (= 3.4.1)
- CocoaLumberjack/Default (3.4.1)
- CocoaLumberjack/Extensions (3.4.1):
- CocoaLumberjack (3.2.0):
- CocoaLumberjack/Default (= 3.2.0)
- CocoaLumberjack/Extensions (= 3.2.0)
- CocoaLumberjack/Default (3.2.0)
- CocoaLumberjack/Extensions (3.2.0):
- CocoaLumberjack/Default
- YapDatabase (3.0.2):
- YapDatabase/Standard (= 3.0.2)
- YapDatabase/Standard (3.0.2):
- YapDatabase/Standard/Core (= 3.0.2)
- YapDatabase/Standard/Extensions (= 3.0.2)
- YapDatabase/Standard/Core (3.0.2):
- YapDatabase (3.0):
- YapDatabase/Standard (= 3.0)
- YapDatabase/Standard (3.0):
- YapDatabase/Standard/Core (= 3.0)
- YapDatabase/Standard/Extensions (= 3.0)
- YapDatabase/Standard/Core (3.0):
- CocoaLumberjack
- YapDatabase/Standard/Extensions (3.0.2):
- YapDatabase/Standard/Extensions (3.0):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/ActionManager (= 3.0.2)
- YapDatabase/Standard/Extensions/AutoView (= 3.0.2)
- YapDatabase/Standard/Extensions/CloudCore (= 3.0.2)
- YapDatabase/Standard/Extensions/CloudKit (= 3.0.2)
- YapDatabase/Standard/Extensions/ConnectionPool (= 3.0.2)
- YapDatabase/Standard/Extensions/ConnectionProxy (= 3.0.2)
- YapDatabase/Standard/Extensions/CrossProcessNotification (= 3.0.2)
- YapDatabase/Standard/Extensions/FilteredView (= 3.0.2)
- YapDatabase/Standard/Extensions/FullTextSearch (= 3.0.2)
- YapDatabase/Standard/Extensions/Hooks (= 3.0.2)
- YapDatabase/Standard/Extensions/ManualView (= 3.0.2)
- YapDatabase/Standard/Extensions/Relationships (= 3.0.2)
- YapDatabase/Standard/Extensions/RTreeIndex (= 3.0.2)
- YapDatabase/Standard/Extensions/SearchResultsView (= 3.0.2)
- YapDatabase/Standard/Extensions/SecondaryIndex (= 3.0.2)
- YapDatabase/Standard/Extensions/View (= 3.0.2)
- YapDatabase/Standard/Extensions/ActionManager (3.0.2):
- YapDatabase/Standard/Extensions/ActionManager (= 3.0)
- YapDatabase/Standard/Extensions/AutoView (= 3.0)
- YapDatabase/Standard/Extensions/CloudCore (= 3.0)
- YapDatabase/Standard/Extensions/CloudKit (= 3.0)
- YapDatabase/Standard/Extensions/ConnectionProxy (= 3.0)
- YapDatabase/Standard/Extensions/CrossProcessNotification (= 3.0)
- YapDatabase/Standard/Extensions/FilteredView (= 3.0)
- YapDatabase/Standard/Extensions/FullTextSearch (= 3.0)
- YapDatabase/Standard/Extensions/Hooks (= 3.0)
- YapDatabase/Standard/Extensions/ManualView (= 3.0)
- YapDatabase/Standard/Extensions/Relationships (= 3.0)
- YapDatabase/Standard/Extensions/RTreeIndex (= 3.0)
- YapDatabase/Standard/Extensions/SearchResultsView (= 3.0)
- YapDatabase/Standard/Extensions/SecondaryIndex (= 3.0)
- YapDatabase/Standard/Extensions/View (= 3.0)
- YapDatabase/Standard/Extensions/ActionManager (3.0):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/AutoView
- YapDatabase/Standard/Extensions/AutoView (3.0.2):
- YapDatabase/Standard/Extensions/AutoView (3.0):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/View
- YapDatabase/Standard/Extensions/CloudCore (3.0.2):
- YapDatabase/Standard/Extensions/CloudCore (3.0):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/CloudKit (3.0.2):
- YapDatabase/Standard/Extensions/CloudKit (3.0):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/ConnectionPool (3.0.2):
- YapDatabase/Standard/Extensions/ConnectionProxy (3.0):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/ConnectionProxy (3.0.2):
- YapDatabase/Standard/Extensions/CrossProcessNotification (3.0):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/CrossProcessNotification (3.0.2):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/FilteredView (3.0.2):
- YapDatabase/Standard/Extensions/FilteredView (3.0):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/View
- YapDatabase/Standard/Extensions/FullTextSearch (3.0.2):
- YapDatabase/Standard/Extensions/FullTextSearch (3.0):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/Hooks (3.0.2):
- YapDatabase/Standard/Extensions/Hooks (3.0):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/ManualView (3.0.2):
- YapDatabase/Standard/Extensions/ManualView (3.0):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/View
- YapDatabase/Standard/Extensions/Relationships (3.0.2):
- YapDatabase/Standard/Extensions/Relationships (3.0):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/RTreeIndex (3.0.2):
- YapDatabase/Standard/Extensions/RTreeIndex (3.0):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/SearchResultsView (3.0.2):
- YapDatabase/Standard/Extensions/SearchResultsView (3.0):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/AutoView
- YapDatabase/Standard/Extensions/FullTextSearch
- YapDatabase/Standard/Extensions/SecondaryIndex (3.0.2):
- YapDatabase/Standard/Extensions/SecondaryIndex (3.0):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/View (3.0.2):
- YapDatabase/Standard/Extensions/View (3.0):
- YapDatabase/Standard/Core
DEPENDENCIES:
@ -77,9 +74,9 @@ EXTERNAL SOURCES:
:path: ../../
SPEC CHECKSUMS:
CocoaLumberjack: 2e258a064cacc8eb9a2aca318e24d02a0a7fd56d
YapDatabase: 972eccb0c997d0dafe8192dccf7f58351914baf1
CocoaLumberjack: 9b4aed7073d242f29cc2f62068d995faf67f703a
YapDatabase: 0cef6c79948169c924ae325d430ffcfa8a5231c2
PODFILE CHECKSUM: 56e0faf7e85fac2003da53b861394c2731e637d4
COCOAPODS: 1.4.0
COCOAPODS: 1.2.1

View File

@ -86,10 +86,10 @@ public func DDLogError(_ message: @autoclosure () -> String, level: DDLogLevel =
public func CurrentFileName(_ fileName: StaticString = #file) -> String {
var str = String(describing: fileName)
if let idx = str.range(of: "/", options: .backwards)?.upperBound {
str = String(str[idx...])
str = str.substring(from: idx)
}
if let idx = str.range(of: ".", options: .backwards)?.lowerBound {
str = String(str[..<idx])
str = str.substring(to: idx)
}
return str
}

View File

@ -397,7 +397,7 @@ extern unsigned long long const kDDDefaultLogFilesDiskQuota;
* You can optionally force the current log file to be rolled with this method.
* CompletionBlock will be called on main queue.
*/
- (void)rollLogFileWithCompletionBlock:(void (^)(void))completionBlock NS_SWIFT_NAME(rollLogFile(withCompletion:));
- (void)rollLogFileWithCompletionBlock:(void (^)())completionBlock NS_SWIFT_NAME(rollLogFile(withCompletion:));
/**
* Method is deprecated.

View File

@ -279,18 +279,47 @@ unsigned long long const kDDDefaultLogFilesDiskQuota = 20 * 1024 * 1024; // 20
- (BOOL)isLogFile:(NSString *)fileName {
NSString *appName = [self applicationName];
// We need to add a space to the name as otherwise we could match applications that have the name prefix.
BOOL hasProperPrefix = [fileName hasPrefix:[appName stringByAppendingString:@" "]];
BOOL hasProperPrefix = [fileName hasPrefix:appName];
BOOL hasProperSuffix = [fileName hasSuffix:@".log"];
return (hasProperPrefix && hasProperSuffix);
BOOL hasProperDate = NO;
if (hasProperPrefix && hasProperSuffix) {
NSUInteger lengthOfMiddle = fileName.length - appName.length - @".log".length;
// Date string should have at least 16 characters - " 2013-12-03 17-14"
if (lengthOfMiddle >= 17) {
NSRange range = NSMakeRange(appName.length, lengthOfMiddle);
NSString *middle = [fileName substringWithRange:range];
NSArray *components = [middle componentsSeparatedByString:@" "];
// When creating logfile if there is existing file with the same name, we append attemp number at the end.
// Thats why here we can have three or four components. For details see createNewLogFile method.
//
// Components:
// "", "2013-12-03", "17-14"
// or
// "", "2013-12-03", "17-14", "1"
if (components.count == 3 || components.count == 4) {
NSString *dateString = [NSString stringWithFormat:@"%@ %@", components[1], components[2]];
NSDateFormatter *dateFormatter = [self logFileDateFormatter];
NSDate *date = [dateFormatter dateFromString:dateString];
if (date) {
hasProperDate = YES;
}
}
}
}
return (hasProperPrefix && hasProperDate && hasProperSuffix);
}
// if you change formatter, then change sortedLogFileInfos method also accordingly
- (NSDateFormatter *)logFileDateFormatter {
NSMutableDictionary *dictionary = [[NSThread currentThread]
threadDictionary];
NSString *dateFormat = @"yyyy'-'MM'-'dd'--'HH'-'mm'-'ss'-'SSS'";
NSString *dateFormat = @"yyyy'-'MM'-'dd' 'HH'-'mm'";
NSString *key = [NSString stringWithFormat:@"logFileDateFormatter.%@", dateFormat];
NSDateFormatter *dateFormatter = dictionary[key];
@ -388,35 +417,13 @@ unsigned long long const kDDDefaultLogFilesDiskQuota = 20 * 1024 * 1024; // 20
}
- (NSArray *)sortedLogFileInfos {
return [[self unsortedLogFileInfos] sortedArrayUsingComparator:^NSComparisonResult(DDLogFileInfo * _Nonnull obj1, DDLogFileInfo * _Nonnull obj2) {
NSDate *date1 = [NSDate new];
NSDate *date2 = [NSDate new];
NSArray<NSString *> *arrayComponent = [[obj1 fileName] componentsSeparatedByString:@" "];
if (arrayComponent.count > 0) {
NSString *stringDate = arrayComponent.lastObject;
stringDate = [stringDate stringByReplacingOccurrencesOfString:@".log" withString:@""];
stringDate = [stringDate stringByReplacingOccurrencesOfString:@".archived" withString:@""];
date1 = [[self logFileDateFormatter] dateFromString:stringDate] ?: [obj1 creationDate];
}
arrayComponent = [[obj2 fileName] componentsSeparatedByString:@" "];
if (arrayComponent.count > 0) {
NSString *stringDate = arrayComponent.lastObject;
stringDate = [stringDate stringByReplacingOccurrencesOfString:@".log" withString:@""];
stringDate = [stringDate stringByReplacingOccurrencesOfString:@".archived" withString:@""];
date2 = [[self logFileDateFormatter] dateFromString:stringDate] ?: [obj2 creationDate];
}
return [date2 compare:date1 ?: [NSDate new]];
}];
return [[self unsortedLogFileInfos] sortedArrayUsingSelector:@selector(reverseCompareByCreationDate:)];
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma mark Creation
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//if you change newLogFileName , then change isLogFile method also accordingly
- (NSString *)newLogFileName {
NSString *appName = [self applicationName];
@ -772,7 +779,7 @@ unsigned long long const kDDDefaultLogFilesDiskQuota = 20 * 1024 * 1024; // 20
[self rollLogFileWithCompletionBlock:nil];
}
- (void)rollLogFileWithCompletionBlock:(void (^)(void))completionBlock {
- (void)rollLogFileWithCompletionBlock:(void (^)())completionBlock {
// This method is public.
// We need to execute the rolling on our logging thread/queue.

View File

@ -351,16 +351,17 @@ static NSUInteger _numProcessors;
// Dispatch semaphores call down to the kernel only when the calling thread needs to be blocked.
// If the calling semaphore does not need to block, no kernel call is made.
dispatch_semaphore_wait(_queueSemaphore, DISPATCH_TIME_FOREVER);
// We've now sure we won't overflow the queue.
// It is time to queue our log message.
dispatch_block_t logBlock = ^{
dispatch_semaphore_wait(_queueSemaphore, DISPATCH_TIME_FOREVER);
@autoreleasepool {
[self lt_log:logMessage];
}
};
// We've now sure we won't overflow the queue.
// It is time to queue our log message.
if (asyncFlag) {
dispatch_async(_loggingQueue, logBlock);
} else {

View File

@ -25,6 +25,7 @@
/**
* This class provides a logger for the Apple os_log facility.
**/
API_AVAILABLE(ios(10.0), macos(10.12), tvos(10.0), watchos(3.0))
@interface DDOSLogger : DDAbstractLogger <DDLogger>
/**

View File

@ -48,30 +48,26 @@ static DDOSLogger *sharedInstance;
return;
}
if(@available(iOS 10.0, macOS 10.12, tvOS 10.0, watchOS 3.0, *)) {
NSString * message = _logFormatter ? [_logFormatter formatLogMessage:logMessage] : logMessage->_message;
if (message) {
const char *msg = [message UTF8String];
NSString * message = _logFormatter ? [_logFormatter formatLogMessage:logMessage] : logMessage->_message;
if (message) {
const char *msg = [message UTF8String];
switch (logMessage->_flag) {
case DDLogFlagError :
os_log_error(OS_LOG_DEFAULT, "%{public}s", msg);
break;
case DDLogFlagWarning :
case DDLogFlagInfo :
os_log_info(OS_LOG_DEFAULT, "%{public}s", msg);
break;
case DDLogFlagDebug :
case DDLogFlagVerbose :
default :
os_log_debug(OS_LOG_DEFAULT, "%{public}s", msg);
break;
}
switch (logMessage->_flag) {
case DDLogFlagError :
os_log_error(OS_LOG_DEFAULT, msg);
break;
case DDLogFlagWarning :
case DDLogFlagInfo :
os_log_info(OS_LOG_DEFAULT, msg);
break;
case DDLogFlagDebug :
case DDLogFlagVerbose :
default :
os_log_debug(OS_LOG_DEFAULT, msg);
break;
}
}
}
- (NSString *)loggerName {

View File

@ -14,7 +14,7 @@
// prior written permission of Deusty, LLC.
#import "DDContextFilterLogFormatter.h"
#import <pthread/pthread.h>
#import <libkern/OSAtomic.h>
#if !__has_feature(objc_arc)
#error This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
@ -131,7 +131,7 @@
@interface DDLoggingContextSet () {
pthread_mutex_t _mutex;
OSSpinLock _lock;
NSMutableSet *_set;
}
@ -143,40 +143,36 @@
- (instancetype)init {
if ((self = [super init])) {
_set = [[NSMutableSet alloc] init];
pthread_mutex_init(&_mutex, NULL);
_lock = OS_SPINLOCK_INIT;
}
return self;
}
- (void)dealloc {
pthread_mutex_destroy(&_mutex);
}
- (void)addToSet:(NSUInteger)loggingContext {
pthread_mutex_lock(&_mutex);
OSSpinLockLock(&_lock);
{
[_set addObject:@(loggingContext)];
}
pthread_mutex_unlock(&_mutex);
OSSpinLockUnlock(&_lock);
}
- (void)removeFromSet:(NSUInteger)loggingContext {
pthread_mutex_lock(&_mutex);
OSSpinLockLock(&_lock);
{
[_set removeObject:@(loggingContext)];
}
pthread_mutex_unlock(&_mutex);
OSSpinLockUnlock(&_lock);
}
- (NSArray *)currentSet {
NSArray *result = nil;
pthread_mutex_lock(&_mutex);
OSSpinLockLock(&_lock);
{
result = [_set allObjects];
}
pthread_mutex_unlock(&_mutex);
OSSpinLockUnlock(&_lock);
return result;
}
@ -184,11 +180,11 @@
- (BOOL)isInSet:(NSUInteger)loggingContext {
BOOL result = NO;
pthread_mutex_lock(&_mutex);
OSSpinLockLock(&_lock);
{
result = [_set containsObject:@(loggingContext)];
}
pthread_mutex_unlock(&_mutex);
OSSpinLockUnlock(&_lock);
return result;
}

View File

@ -14,9 +14,10 @@
// prior written permission of Deusty, LLC.
#import "DDDispatchQueueLogFormatter.h"
#import <pthread/pthread.h>
#import <libkern/OSAtomic.h>
#import <objc/runtime.h>
#if !__has_feature(objc_arc)
#error This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
#endif
@ -28,7 +29,7 @@
int32_t _atomicLoggerCount;
NSDateFormatter *_threadUnsafeDateFormatter; // Use [self stringFromDate]
pthread_mutex_t _mutex;
OSSpinLock _lock;
NSUInteger _minQueueLength; // _prefix == Only access via atomic property
NSUInteger _maxQueueLength; // _prefix == Only access via atomic property
@ -62,7 +63,7 @@
_minQueueLength = 0;
_maxQueueLength = 0;
pthread_mutex_init(&_mutex, NULL);
_lock = OS_SPINLOCK_INIT;
_replacements = [[NSMutableDictionary alloc] init];
// Set default replacements:
@ -80,10 +81,6 @@
return self;
}
- (void)dealloc {
pthread_mutex_destroy(&_mutex);
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma mark Configuration
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -94,17 +91,17 @@
- (NSString *)replacementStringForQueueLabel:(NSString *)longLabel {
NSString *result = nil;
pthread_mutex_lock(&_mutex);
OSSpinLockLock(&_lock);
{
result = _replacements[longLabel];
}
pthread_mutex_unlock(&_mutex);
OSSpinLockUnlock(&_lock);
return result;
}
- (void)setReplacementString:(NSString *)shortLabel forQueueLabel:(NSString *)longLabel {
pthread_mutex_lock(&_mutex);
OSSpinLockLock(&_lock);
{
if (shortLabel) {
_replacements[longLabel] = shortLabel;
@ -112,7 +109,7 @@
[_replacements removeObjectForKey:longLabel];
}
}
pthread_mutex_unlock(&_mutex);
OSSpinLockUnlock(&_lock);
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -217,11 +214,11 @@
fullLabel = logMessage->_threadName;
}
pthread_mutex_lock(&_mutex);
OSSpinLockLock(&_lock);
{
abrvLabel = _replacements[fullLabel];
}
pthread_mutex_unlock(&_mutex);
OSSpinLockUnlock(&_lock);
if (abrvLabel) {
queueThreadLabel = abrvLabel;

View File

@ -151,16 +151,14 @@ Configure your logging however you want. Change log levels per file (perfect for
### Requirements
The current version of Lumberjack requires:
- Xcode 9 or later
- Swift 4.0 or later
- iOS 6 or later
- OS X 10.8 or later
- Xcode 8 or later
- Swift 3.0 or later
- iOS 5 or later
- OS X 10.7 or later
- WatchOS 2 or later
- TVOS 9 or later
#### Backwards compability
- for iOS 5 and OS X 10.7, use the 3.3 version
- for Xcode 8 and Swift 3, use the 3.2 version
- for Xcode 7.3 and Swift 2.3, use the 2.4.0 version
- for Xcode 7.3 and Swift 2.2, use the 2.3.0 version
- for Xcode 7.2 and 7.1, use the 2.2.0 version

View File

@ -1 +0,0 @@
../../../../../../YapDatabase/Extensions/ConnectionPool/YapDatabaseConnectionPool.h

View File

@ -1 +0,0 @@
../../../../../../YapDatabase/Utilities/YapDatabaseCryptoUtils.h

View File

@ -1 +0,0 @@
../../../../../../YapDatabase/Extensions/ConnectionPool/YapDatabaseConnectionPool.h

View File

@ -1 +0,0 @@
../../../../../../YapDatabase/Utilities/YapDatabaseCryptoUtils.h

View File

@ -1,6 +1,6 @@
{
"name": "YapDatabase",
"version": "3.0.2",
"version": "3.0",
"summary": "A key/value store built atop sqlite for iOS & Mac.",
"homepage": "https://github.com/yapstudios/YapDatabase",
"license": "MIT",
@ -9,10 +9,10 @@
},
"source": {
"git": "https://github.com/yapstudios/YapDatabase.git",
"tag": "3.0.2"
"tag": "3.0"
},
"platforms": {
"osx": "10.10",
"osx": "10.9",
"ios": "8.0",
"tvos": "9.0",
"watchos": "2.0"
@ -139,10 +139,6 @@
"name": "ConnectionProxy",
"source_files": "YapDatabase/Extensions/ConnectionProxy/**/*.{h,m,mm,c}"
},
{
"name": "ConnectionPool",
"source_files": "YapDatabase/Extensions/ConnectionPool/**/*.{h,m,mm,c}"
},
{
"name": "ActionManager",
"osx": {
@ -292,10 +288,6 @@
"name": "ConnectionProxy",
"source_files": "YapDatabase/Extensions/ConnectionProxy/**/*.{h,m,mm,c}"
},
{
"name": "ConnectionPool",
"source_files": "YapDatabase/Extensions/ConnectionPool/**/*.{h,m,mm,c}"
},
{
"name": "ActionManager",
"osx": {

View File

@ -1,72 +1,69 @@
PODS:
- CocoaLumberjack (3.4.1):
- CocoaLumberjack/Default (= 3.4.1)
- CocoaLumberjack/Extensions (= 3.4.1)
- CocoaLumberjack/Default (3.4.1)
- CocoaLumberjack/Extensions (3.4.1):
- CocoaLumberjack (3.2.0):
- CocoaLumberjack/Default (= 3.2.0)
- CocoaLumberjack/Extensions (= 3.2.0)
- CocoaLumberjack/Default (3.2.0)
- CocoaLumberjack/Extensions (3.2.0):
- CocoaLumberjack/Default
- YapDatabase (3.0.2):
- YapDatabase/Standard (= 3.0.2)
- YapDatabase/Standard (3.0.2):
- YapDatabase/Standard/Core (= 3.0.2)
- YapDatabase/Standard/Extensions (= 3.0.2)
- YapDatabase/Standard/Core (3.0.2):
- YapDatabase (3.0):
- YapDatabase/Standard (= 3.0)
- YapDatabase/Standard (3.0):
- YapDatabase/Standard/Core (= 3.0)
- YapDatabase/Standard/Extensions (= 3.0)
- YapDatabase/Standard/Core (3.0):
- CocoaLumberjack
- YapDatabase/Standard/Extensions (3.0.2):
- YapDatabase/Standard/Extensions (3.0):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/ActionManager (= 3.0.2)
- YapDatabase/Standard/Extensions/AutoView (= 3.0.2)
- YapDatabase/Standard/Extensions/CloudCore (= 3.0.2)
- YapDatabase/Standard/Extensions/CloudKit (= 3.0.2)
- YapDatabase/Standard/Extensions/ConnectionPool (= 3.0.2)
- YapDatabase/Standard/Extensions/ConnectionProxy (= 3.0.2)
- YapDatabase/Standard/Extensions/CrossProcessNotification (= 3.0.2)
- YapDatabase/Standard/Extensions/FilteredView (= 3.0.2)
- YapDatabase/Standard/Extensions/FullTextSearch (= 3.0.2)
- YapDatabase/Standard/Extensions/Hooks (= 3.0.2)
- YapDatabase/Standard/Extensions/ManualView (= 3.0.2)
- YapDatabase/Standard/Extensions/Relationships (= 3.0.2)
- YapDatabase/Standard/Extensions/RTreeIndex (= 3.0.2)
- YapDatabase/Standard/Extensions/SearchResultsView (= 3.0.2)
- YapDatabase/Standard/Extensions/SecondaryIndex (= 3.0.2)
- YapDatabase/Standard/Extensions/View (= 3.0.2)
- YapDatabase/Standard/Extensions/ActionManager (3.0.2):
- YapDatabase/Standard/Extensions/ActionManager (= 3.0)
- YapDatabase/Standard/Extensions/AutoView (= 3.0)
- YapDatabase/Standard/Extensions/CloudCore (= 3.0)
- YapDatabase/Standard/Extensions/CloudKit (= 3.0)
- YapDatabase/Standard/Extensions/ConnectionProxy (= 3.0)
- YapDatabase/Standard/Extensions/CrossProcessNotification (= 3.0)
- YapDatabase/Standard/Extensions/FilteredView (= 3.0)
- YapDatabase/Standard/Extensions/FullTextSearch (= 3.0)
- YapDatabase/Standard/Extensions/Hooks (= 3.0)
- YapDatabase/Standard/Extensions/ManualView (= 3.0)
- YapDatabase/Standard/Extensions/Relationships (= 3.0)
- YapDatabase/Standard/Extensions/RTreeIndex (= 3.0)
- YapDatabase/Standard/Extensions/SearchResultsView (= 3.0)
- YapDatabase/Standard/Extensions/SecondaryIndex (= 3.0)
- YapDatabase/Standard/Extensions/View (= 3.0)
- YapDatabase/Standard/Extensions/ActionManager (3.0):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/AutoView
- YapDatabase/Standard/Extensions/AutoView (3.0.2):
- YapDatabase/Standard/Extensions/AutoView (3.0):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/View
- YapDatabase/Standard/Extensions/CloudCore (3.0.2):
- YapDatabase/Standard/Extensions/CloudCore (3.0):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/CloudKit (3.0.2):
- YapDatabase/Standard/Extensions/CloudKit (3.0):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/ConnectionPool (3.0.2):
- YapDatabase/Standard/Extensions/ConnectionProxy (3.0):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/ConnectionProxy (3.0.2):
- YapDatabase/Standard/Extensions/CrossProcessNotification (3.0):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/CrossProcessNotification (3.0.2):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/FilteredView (3.0.2):
- YapDatabase/Standard/Extensions/FilteredView (3.0):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/View
- YapDatabase/Standard/Extensions/FullTextSearch (3.0.2):
- YapDatabase/Standard/Extensions/FullTextSearch (3.0):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/Hooks (3.0.2):
- YapDatabase/Standard/Extensions/Hooks (3.0):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/ManualView (3.0.2):
- YapDatabase/Standard/Extensions/ManualView (3.0):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/View
- YapDatabase/Standard/Extensions/Relationships (3.0.2):
- YapDatabase/Standard/Extensions/Relationships (3.0):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/RTreeIndex (3.0.2):
- YapDatabase/Standard/Extensions/RTreeIndex (3.0):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/SearchResultsView (3.0.2):
- YapDatabase/Standard/Extensions/SearchResultsView (3.0):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/AutoView
- YapDatabase/Standard/Extensions/FullTextSearch
- YapDatabase/Standard/Extensions/SecondaryIndex (3.0.2):
- YapDatabase/Standard/Extensions/SecondaryIndex (3.0):
- YapDatabase/Standard/Core
- YapDatabase/Standard/Extensions/View (3.0.2):
- YapDatabase/Standard/Extensions/View (3.0):
- YapDatabase/Standard/Core
DEPENDENCIES:
@ -77,9 +74,9 @@ EXTERNAL SOURCES:
:path: ../../
SPEC CHECKSUMS:
CocoaLumberjack: 2e258a064cacc8eb9a2aca318e24d02a0a7fd56d
YapDatabase: 972eccb0c997d0dafe8192dccf7f58351914baf1
CocoaLumberjack: 9b4aed7073d242f29cc2f62068d995faf67f703a
YapDatabase: 0cef6c79948169c924ae325d430ffcfa8a5231c2
PODFILE CHECKSUM: 56e0faf7e85fac2003da53b861394c2731e637d4
COCOAPODS: 1.4.0
COCOAPODS: 1.2.1

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/CocoaLumberjack
CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/CocoaLumberjack
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/CocoaLumberjack" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/YapDatabase"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}
PODS_TARGET_SRCROOT = ${PODS_ROOT}/CocoaLumberjack
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}

View File

@ -6,14 +6,6 @@ mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
# Used as a return value for each invocation of `strip_invalid_archs` function.
STRIP_BINARY_RETVAL=0
# This protects against multiple targets copying the same framework dependency at the same time. The solution
# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
# Copies and strips a vendored framework
install_framework()
{
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
@ -31,9 +23,9 @@ install_framework()
source="$(readlink "${source}")"
fi
# Use filter instead of exclude so missing patterns don't throw errors.
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
# use filter instead of exclude so missing patterns dont' throw errors
echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
local basename
basename="$(basename -s .framework "$1")"
@ -62,34 +54,6 @@ install_framework()
fi
}
# Copies and strips a vendored dSYM
install_dsym() {
local source="$1"
if [ -r "$source" ]; then
# Copy the dSYM into a the targets temp dir.
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}"
local basename
basename="$(basename -s .framework.dSYM "$source")"
binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}"
# Strip invalid architectures so "fat" simulator / device frameworks work on device
if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then
strip_invalid_archs "$binary"
fi
if [[ $STRIP_BINARY_RETVAL == 1 ]]; then
# Move the stripped file into its final destination.
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}"
else
# The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing.
touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM"
fi
fi
}
# Signs a framework with the provided identity
code_sign_if_enabled() {
if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
@ -108,19 +72,11 @@ code_sign_if_enabled() {
# Strip invalid architectures
strip_invalid_archs() {
binary="$1"
# Get architectures for current target binary
binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)"
# Intersect them with the architectures we are building for
intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)"
# If there are no archs supported by this binary then warn the user
if [[ -z "$intersected_archs" ]]; then
echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)."
STRIP_BINARY_RETVAL=0
return
fi
# Get architectures for current file
archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
stripped=""
for arch in $binary_archs; do
if ! [[ "${ARCHS}" == *"$arch"* ]]; then
for arch in $archs; do
if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then
# Strip non-valid architectures in-place
lipo -remove "$arch" -output "$binary" "$binary" || exit 1
stripped="$stripped $arch"
@ -129,7 +85,6 @@ strip_invalid_archs() {
if [[ "$stripped" ]]; then
echo "Stripped $binary of architectures:$stripped"
fi
STRIP_BINARY_RETVAL=1
}
if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then

View File

@ -8,10 +8,6 @@ RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
XCASSET_FILES=()
# This protects against multiple targets copying the same framework dependency at the same time. The solution
# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
case "${TARGETED_DEVICE_FAMILY}" in
1,2)
TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
@ -48,29 +44,29 @@ EOM
fi
case $RESOURCE_PATH in
*.storyboard)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
;;
*.xib)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
;;
*.framework)
echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
;;
*.xcdatamodel)
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\""
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
;;
*.xcdatamodeld)
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\""
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
;;
*.xcmappingmodel)
echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true
echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\""
xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
;;
*.xcassets)
@ -78,7 +74,7 @@ EOM
XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
;;
*)
echo "$RESOURCE_PATH" || true
echo "$RESOURCE_PATH"
echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
;;
esac

View File

@ -1,9 +1,9 @@
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/YapDatabase"
LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CocoaLumberjack" "${PODS_CONFIGURATION_BUILD_DIR}/YapDatabase"
LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/CocoaLumberjack" "$PODS_CONFIGURATION_BUILD_DIR/YapDatabase"
OTHER_CFLAGS = $(inherited) -DYAP_STANDARD_SQLITE $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/CocoaLumberjack" -isystem "${PODS_ROOT}/Headers/Public/YapDatabase"
OTHER_LDFLAGS = $(inherited) -ObjC -l"CocoaLumberjack" -l"YapDatabase" -l"c++" -l"sqlite3" -framework "SystemConfiguration"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods

View File

@ -1,9 +1,9 @@
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/YapDatabase"
LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CocoaLumberjack" "${PODS_CONFIGURATION_BUILD_DIR}/YapDatabase"
LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/CocoaLumberjack" "$PODS_CONFIGURATION_BUILD_DIR/YapDatabase"
OTHER_CFLAGS = $(inherited) -DYAP_STANDARD_SQLITE $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/CocoaLumberjack" -isystem "${PODS_ROOT}/Headers/Public/YapDatabase"
OTHER_LDFLAGS = $(inherited) -ObjC -l"CocoaLumberjack" -l"YapDatabase" -l"c++" -l"sqlite3" -framework "SystemConfiguration"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods

View File

@ -6,14 +6,6 @@ mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
# Used as a return value for each invocation of `strip_invalid_archs` function.
STRIP_BINARY_RETVAL=0
# This protects against multiple targets copying the same framework dependency at the same time. The solution
# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
# Copies and strips a vendored framework
install_framework()
{
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
@ -31,9 +23,9 @@ install_framework()
source="$(readlink "${source}")"
fi
# Use filter instead of exclude so missing patterns don't throw errors.
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
# use filter instead of exclude so missing patterns dont' throw errors
echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
local basename
basename="$(basename -s .framework "$1")"
@ -62,34 +54,6 @@ install_framework()
fi
}
# Copies and strips a vendored dSYM
install_dsym() {
local source="$1"
if [ -r "$source" ]; then
# Copy the dSYM into a the targets temp dir.
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}"
local basename
basename="$(basename -s .framework.dSYM "$source")"
binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}"
# Strip invalid architectures so "fat" simulator / device frameworks work on device
if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then
strip_invalid_archs "$binary"
fi
if [[ $STRIP_BINARY_RETVAL == 1 ]]; then
# Move the stripped file into its final destination.
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}"
else
# The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing.
touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM"
fi
fi
}
# Signs a framework with the provided identity
code_sign_if_enabled() {
if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
@ -108,19 +72,11 @@ code_sign_if_enabled() {
# Strip invalid architectures
strip_invalid_archs() {
binary="$1"
# Get architectures for current target binary
binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)"
# Intersect them with the architectures we are building for
intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)"
# If there are no archs supported by this binary then warn the user
if [[ -z "$intersected_archs" ]]; then
echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)."
STRIP_BINARY_RETVAL=0
return
fi
# Get architectures for current file
archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
stripped=""
for arch in $binary_archs; do
if ! [[ "${ARCHS}" == *"$arch"* ]]; then
for arch in $archs; do
if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then
# Strip non-valid architectures in-place
lipo -remove "$arch" -output "$binary" "$binary" || exit 1
stripped="$stripped $arch"
@ -129,7 +85,6 @@ strip_invalid_archs() {
if [[ "$stripped" ]]; then
echo "Stripped $binary of architectures:$stripped"
fi
STRIP_BINARY_RETVAL=1
}
if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then

View File

@ -8,10 +8,6 @@ RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
XCASSET_FILES=()
# This protects against multiple targets copying the same framework dependency at the same time. The solution
# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
case "${TARGETED_DEVICE_FAMILY}" in
1,2)
TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
@ -48,29 +44,29 @@ EOM
fi
case $RESOURCE_PATH in
*.storyboard)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
;;
*.xib)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
;;
*.framework)
echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
;;
*.xcdatamodel)
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\""
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
;;
*.xcdatamodeld)
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\""
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
;;
*.xcmappingmodel)
echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true
echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\""
xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
;;
*.xcassets)
@ -78,7 +74,7 @@ EOM
XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
;;
*)
echo "$RESOURCE_PATH" || true
echo "$RESOURCE_PATH"
echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
;;
esac

View File

@ -1,9 +1,9 @@
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/YapDatabase"
LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CocoaLumberjack" "${PODS_CONFIGURATION_BUILD_DIR}/YapDatabase"
LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/CocoaLumberjack" "$PODS_CONFIGURATION_BUILD_DIR/YapDatabase"
OTHER_CFLAGS = $(inherited) -DYAP_STANDARD_SQLITE $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/CocoaLumberjack" -isystem "${PODS_ROOT}/Headers/Public/YapDatabase"
OTHER_LDFLAGS = $(inherited) -ObjC -l"CocoaLumberjack" -l"YapDatabase" -l"c++" -l"sqlite3" -framework "SystemConfiguration"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods

View File

@ -1,9 +1,9 @@
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/YapDatabase"
LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CocoaLumberjack" "${PODS_CONFIGURATION_BUILD_DIR}/YapDatabase"
LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/CocoaLumberjack" "$PODS_CONFIGURATION_BUILD_DIR/YapDatabase"
OTHER_CFLAGS = $(inherited) -DYAP_STANDARD_SQLITE $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/CocoaLumberjack" -isystem "${PODS_ROOT}/Headers/Public/YapDatabase"
OTHER_LDFLAGS = $(inherited) -ObjC -l"CocoaLumberjack" -l"YapDatabase" -l"c++" -l"sqlite3" -framework "SystemConfiguration"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods

View File

@ -1,11 +1,11 @@
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/YapDatabase
CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/YapDatabase
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/YapDatabase" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/YapDatabase"
LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CocoaLumberjack"
LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/CocoaLumberjack"
OTHER_CFLAGS = $(inherited) -DYAP_STANDARD_SQLITE
OTHER_LDFLAGS = -l"c++" -l"sqlite3" -framework "SystemConfiguration"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}
PODS_TARGET_SRCROOT = ${PODS_ROOT}/../../..
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}

View File

@ -553,16 +553,13 @@
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-YapDatabase-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
3397BBC53BC83C63A5C6FE2F /* [CP] Copy Pods Resources */ = {
@ -629,16 +626,13 @@
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-YapDatabaseTests-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

View File

@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "YapDatabase"
s.version = "3.1.1"
s.version = "3.0.2"
s.summary = "A key/value store built atop sqlite for iOS & Mac."
s.homepage = "https://github.com/yapstudios/YapDatabase"
s.license = 'MIT'
@ -13,7 +13,7 @@ Pod::Spec.new do |s|
:tag => s.version.to_s
}
s.osx.deployment_target = '10.10'
s.osx.deployment_target = '10.9'
s.ios.deployment_target = '8.0'
s.tvos.deployment_target = '9.0'
s.watchos.deployment_target = '2.0'
@ -109,10 +109,6 @@ Pod::Spec.new do |s|
sse.subspec 'ConnectionProxy' do |ssee|
ssee.source_files = 'YapDatabase/Extensions/ConnectionProxy/**/*.{h,m,mm,c}'
end
sse.subspec 'ConnectionPool' do |ssee|
ssee.source_files = 'YapDatabase/Extensions/ConnectionPool/**/*.{h,m,mm,c}'
end
sse.subspec 'ActionManager' do |ssee|
ssee.osx.framework = 'SystemConfiguration'
@ -214,10 +210,6 @@ Pod::Spec.new do |s|
sse.subspec 'ConnectionProxy' do |ssee|
ssee.source_files = 'YapDatabase/Extensions/ConnectionProxy/**/*.{h,m,mm,c}'
end
sse.subspec 'ConnectionPool' do |ssee|
ssee.source_files = 'YapDatabase/Extensions/ConnectionPool/**/*.{h,m,mm,c}'
end
sse.subspec 'ActionManager' do |ssee|
ssee.osx.framework = 'SystemConfiguration'

View File

@ -685,14 +685,6 @@
DCAF52501C4867B000562C92 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = DCAF524F1C4867B000562C92 /* main.m */; };
DCAF52541C48681000562C92 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DCAF52521C48681000562C92 /* Main.storyboard */; };
DCAF52581C48685400562C92 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DCAF52571C48685400562C92 /* Assets.xcassets */; };
DCB8AD0020604A26000B2D76 /* YapDatabaseConnectionPool.m in Sources */ = {isa = PBXBuildFile; fileRef = DCB8ACFE20604A25000B2D76 /* YapDatabaseConnectionPool.m */; };
DCB8AD0120604A26000B2D76 /* YapDatabaseConnectionPool.h in Headers */ = {isa = PBXBuildFile; fileRef = DCB8ACFF20604A25000B2D76 /* YapDatabaseConnectionPool.h */; settings = {ATTRIBUTES = (Public, ); }; };
DCB8AD0220604A89000B2D76 /* YapDatabaseConnectionPool.m in Sources */ = {isa = PBXBuildFile; fileRef = DCB8ACFE20604A25000B2D76 /* YapDatabaseConnectionPool.m */; };
DCB8AD0320604A8A000B2D76 /* YapDatabaseConnectionPool.m in Sources */ = {isa = PBXBuildFile; fileRef = DCB8ACFE20604A25000B2D76 /* YapDatabaseConnectionPool.m */; };
DCB8AD0420604A8B000B2D76 /* YapDatabaseConnectionPool.m in Sources */ = {isa = PBXBuildFile; fileRef = DCB8ACFE20604A25000B2D76 /* YapDatabaseConnectionPool.m */; };
DCB8AD0520604A9D000B2D76 /* YapDatabaseConnectionPool.h in Headers */ = {isa = PBXBuildFile; fileRef = DCB8ACFF20604A25000B2D76 /* YapDatabaseConnectionPool.h */; settings = {ATTRIBUTES = (Public, ); }; };
DCB8AD0620604A9E000B2D76 /* YapDatabaseConnectionPool.h in Headers */ = {isa = PBXBuildFile; fileRef = DCB8ACFF20604A25000B2D76 /* YapDatabaseConnectionPool.h */; settings = {ATTRIBUTES = (Public, ); }; };
DCB8AD0720604A9E000B2D76 /* YapDatabaseConnectionPool.h in Headers */ = {isa = PBXBuildFile; fileRef = DCB8ACFF20604A25000B2D76 /* YapDatabaseConnectionPool.h */; settings = {ATTRIBUTES = (Public, ); }; };
DCBA3C4B1FAE0EC50086289D /* YapDatabaseCloudCoreConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = DCBA3C331FAE0EC50086289D /* YapDatabaseCloudCoreConnection.m */; };
DCBA3C4C1FAE0EC50086289D /* YapDatabaseCloudCoreConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = DCBA3C331FAE0EC50086289D /* YapDatabaseCloudCoreConnection.m */; };
DCBA3C4D1FAE0EC50086289D /* YapDatabaseCloudCoreConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = DCBA3C331FAE0EC50086289D /* YapDatabaseCloudCoreConnection.m */; };
@ -1394,8 +1386,6 @@
DCAF52531C48681000562C92 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Main.storyboard; sourceTree = "<group>"; };
DCAF52551C48683200562C92 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = "Framework/TestModuleMap-Mac/Info.plist"; sourceTree = "<group>"; };
DCAF52571C48685400562C92 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = "Framework/TestModuleMap-Mac/Assets.xcassets"; sourceTree = "<group>"; };
DCB8ACFE20604A25000B2D76 /* YapDatabaseConnectionPool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YapDatabaseConnectionPool.m; sourceTree = "<group>"; };
DCB8ACFF20604A25000B2D76 /* YapDatabaseConnectionPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YapDatabaseConnectionPool.h; sourceTree = "<group>"; };
DCBA3C331FAE0EC50086289D /* YapDatabaseCloudCoreConnection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YapDatabaseCloudCoreConnection.m; sourceTree = "<group>"; };
DCBA3C341FAE0EC50086289D /* YapDatabaseCloudCoreTransaction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YapDatabaseCloudCoreTransaction.h; sourceTree = "<group>"; };
DCBA3C351FAE0EC50086289D /* YapDatabaseCloudCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YapDatabaseCloudCore.h; sourceTree = "<group>"; };
@ -1629,11 +1619,10 @@
children = (
DC6C28D91CAAFE3B00166CE4 /* ActionManager */,
371A7B851EF18AB0004176EC /* AutoView */,
DC6C28BC1CAAF8DF00166CE4 /* CrossProcessNotification */,
DCAF523C1C48636C00562C92 /* ConnectionProxy */,
DCBA3C321FAE0EC50086289D /* CloudCore */,
DC651F191BCEC77E00188E23 /* CloudKit */,
DCB8ACFD20604A25000B2D76 /* ConnectionPool */,
DCAF523C1C48636C00562C92 /* ConnectionProxy */,
DC6C28BC1CAAF8DF00166CE4 /* CrossProcessNotification */,
DC651F391BCEC77E00188E23 /* FilteredView */,
DC651F441BCEC77E00188E23 /* FullTextSearch */,
DC651F511BCEC77E00188E23 /* Hooks */,
@ -2108,15 +2097,6 @@
name = "TestModuleMap-Shared";
sourceTree = "<group>";
};
DCB8ACFD20604A25000B2D76 /* ConnectionPool */ = {
isa = PBXGroup;
children = (
DCB8ACFF20604A25000B2D76 /* YapDatabaseConnectionPool.h */,
DCB8ACFE20604A25000B2D76 /* YapDatabaseConnectionPool.m */,
);
path = ConnectionPool;
sourceTree = "<group>";
};
DCBA3C321FAE0EC50086289D /* CloudCore */ = {
isa = PBXGroup;
children = (
@ -2320,7 +2300,6 @@
DCBA3C5A1FAE0EC50086289D /* YapDatabaseCloudCoreOptions.h in Headers */,
DC6266591D80D14B00557968 /* YapDatabaseCrossProcessNotificationConnection.h in Headers */,
DC6266571D80D14400557968 /* YapDatabaseCrossProcessNotification.h in Headers */,
DCB8AD0720604A9E000B2D76 /* YapDatabaseConnectionPool.h in Headers */,
DC62664F1D80D11700557968 /* YapDatabaseExtension.h in Headers */,
DC6266421D80D0EA00557968 /* YapDatabaseStatement.h in Headers */,
DCDAF73C1D81DC2A00C827C6 /* YapReachability.h in Headers */,
@ -2552,7 +2531,6 @@
DCE7611A1D78B638009C83A0 /* YapDatabaseSecondaryIndexPrivate.h in Headers */,
DCE761001D78B5CF009C83A0 /* YapDatabaseViewChangePrivate.h in Headers */,
DCE761521D78B742009C83A0 /* YapDatabaseRelationshipConnection.h in Headers */,
DCB8AD0620604A9E000B2D76 /* YapDatabaseConnectionPool.h in Headers */,
DCE760E71D78B556009C83A0 /* YapDatabaseCloudKitOptions.h in Headers */,
DCE761361D78B6BC009C83A0 /* YapDatabaseFullTextSearchConnection.h in Headers */,
DCE7615B1D78B775009C83A0 /* YapDatabaseRTreeIndexPrivate.h in Headers */,
@ -2697,7 +2675,6 @@
DC65204F1BCEC77E00188E23 /* YapDatabaseHooksPrivate.h in Headers */,
DC6520871BCEC77E00188E23 /* YapDatabaseRTreeIndexPrivate.h in Headers */,
DC65212F1BCEC77E00188E23 /* YapProxyObjectPrivate.h in Headers */,
DCB8AD0120604A26000B2D76 /* YapDatabaseConnectionPool.h in Headers */,
DC6C28C51CAAF8DF00166CE4 /* YapDatabaseCrossProcessNotificationPrivate.h in Headers */,
DC6521351BCEC77E00188E23 /* YapTouch.h in Headers */,
DC6C28F01CAAFE3B00166CE4 /* YapDatabaseActionManager.h in Headers */,
@ -2842,7 +2819,6 @@
DC6520501BCEC77E00188E23 /* YapDatabaseHooksPrivate.h in Headers */,
DC6520881BCEC77E00188E23 /* YapDatabaseRTreeIndexPrivate.h in Headers */,
DC6521301BCEC77E00188E23 /* YapProxyObjectPrivate.h in Headers */,
DCB8AD0520604A9D000B2D76 /* YapDatabaseConnectionPool.h in Headers */,
DC6C28C61CAAF8DF00166CE4 /* YapDatabaseCrossProcessNotificationPrivate.h in Headers */,
DC6521361BCEC77E00188E23 /* YapTouch.h in Headers */,
DC6C28F11CAAFE3B00166CE4 /* YapDatabaseActionManager.h in Headers */,
@ -3222,7 +3198,6 @@
DC6266781D80D1E300557968 /* YapDatabaseRelationshipEdge.m in Sources */,
DC62665E1D80D16400557968 /* YapDatabaseConnectionProxy.m in Sources */,
DC6266801D80D20700557968 /* YapDatabaseRTreeIndex.m in Sources */,
DCB8AD0420604A8B000B2D76 /* YapDatabaseConnectionPool.m in Sources */,
DC6266A51D80D2A300557968 /* YapDatabaseViewMappings.m in Sources */,
DC62665C1D80D15600557968 /* YapDatabaseCrossProcessNotificationTransaction.m in Sources */,
DC6266261D80D08C00557968 /* YapCache.m in Sources */,
@ -3389,7 +3364,6 @@
DCE760F31D78B582009C83A0 /* YDBCKChangeRecord.m in Sources */,
DCE7612A1D78B67B009C83A0 /* YapDatabaseSearchQueue.m in Sources */,
DCE7610B1D78B5F1009C83A0 /* YapDatabaseViewChange.m in Sources */,
DCB8AD0320604A8A000B2D76 /* YapDatabaseConnectionPool.m in Sources */,
DCE760B01D78B0DA009C83A0 /* YapMurmurHash.m in Sources */,
DCE761091D78B5EA009C83A0 /* YapDatabaseViewState.m in Sources */,
DCE7609E1D78B075009C83A0 /* YapDatabase.m in Sources */,
@ -3517,7 +3491,6 @@
DC6520531BCEC77E00188E23 /* YapDatabaseHooks.m in Sources */,
DC6521571BCEC77E00188E23 /* YapDatabase.m in Sources */,
DC6520FD1BCEC77E00188E23 /* YapDatabaseViewOptions.m in Sources */,
DCB8AD0020604A26000B2D76 /* YapDatabaseConnectionPool.m in Sources */,
DC6520411BCEC77E00188E23 /* YapDatabaseFullTextSearchConnection.m in Sources */,
DC6520BD1BCEC77E00188E23 /* YapDatabaseSecondaryIndex.m in Sources */,
DC6C28C91CAAF8DF00166CE4 /* YapDatabaseCrossProcessNotification.m in Sources */,
@ -3634,7 +3607,6 @@
DC6520541BCEC77E00188E23 /* YapDatabaseHooks.m in Sources */,
DC6521581BCEC77E00188E23 /* YapDatabase.m in Sources */,
DC6520FE1BCEC77E00188E23 /* YapDatabaseViewOptions.m in Sources */,
DCB8AD0220604A89000B2D76 /* YapDatabaseConnectionPool.m in Sources */,
DC6520421BCEC77E00188E23 /* YapDatabaseFullTextSearchConnection.m in Sources */,
DC6520BE1BCEC77E00188E23 /* YapDatabaseSecondaryIndex.m in Sources */,
DC6C28CA1CAAF8DF00166CE4 /* YapDatabaseCrossProcessNotification.m in Sources */,

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@ -12,7 +12,7 @@
* See YapDatabaseLogging.h for more information.
**/
#if DEBUG
static const int ydbLogLevel = YDB_LOG_LEVEL_WARN;
static const int ydbLogLevel = YDB_LOG_LEVEL_VERBOSE | YDB_LOG_FLAG_TRACE;
#else
static const int ydbLogLevel = YDB_LOG_LEVEL_WARN;
#endif
@ -549,8 +549,6 @@
}
} usingBlock:^(NSString *collection, NSString *key, id object, NSUInteger index, BOOL *stop) {
#pragma clang diagnostic push // silence warnings: synchronous access
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
//
// Processing Block
@ -585,8 +583,6 @@
}
}
}
#pragma clang diagnostic pop
}];
}

View File

@ -124,13 +124,9 @@
__block YapDatabaseViewSorting *mostRecentSorting = nil;
dispatch_block_t block = ^{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
mostRecentGrouping = grouping;
mostRecentSorting = sorting;
#pragma clang diagnostic pop
};
__strong YapDatabase *database = self.registeredDatabase;

View File

@ -33,9 +33,6 @@
- (BOOL)populateView
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
YDBLogAutoTrace();
// Remove everything from the database
@ -392,8 +389,6 @@
}
return YES;
#pragma clang diagnostic pop
}
- (void)repopulateView
@ -422,8 +417,6 @@
// The changeset mechanism will automatically consolidate all changes to the minimum.
[self enumerateGroupsUsingBlock:^(NSString *group, BOOL __unused *outerStop) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
// We must add the changes in reverse order.
// Either that, or the change index of each item would have to be zero,
@ -440,8 +433,6 @@
}];
[parentConnection->changes addObject:[YapDatabaseViewSectionChange deleteGroup:group]];
#pragma clang diagnostic pop
}];
isRepopulate = YES;
@ -528,8 +519,6 @@
// This block will be invoked repeatedly as we calculate the insertion index.
NSComparisonResult (^compare)(NSUInteger) = ^NSComparisonResult (NSUInteger index){
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
int64_t anotherRowid = 0;
[self getRowid:&anotherRowid atIndex:index inGroup:group];
@ -592,8 +581,6 @@
collectionKey.collection, collectionKey.key, object, metadata,
another.collection, another.key, anotherObject, anotherMetadata);
}
#pragma clang diagnostic pop
};
NSComparisonResult cmp;
@ -1333,8 +1320,6 @@
(YapDatabaseViewFindWithKeyBlock)find.findBlock;
compare = ^NSComparisonResult (NSUInteger index){
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
int64_t rowid = 0;
[self getRowid:&rowid atIndex:index inGroup:group];
@ -1342,8 +1327,6 @@
YapCollectionKey *ck = [databaseTransaction collectionKeyForRowid:rowid];
return findBlock(ck.collection, ck.key);
#pragma clang diagnostic pop
};
break;
@ -1354,8 +1337,6 @@
(YapDatabaseViewFindWithObjectBlock)find.findBlock;
compare = ^NSComparisonResult (NSUInteger index){
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
int64_t rowid = 0;
[self getRowid:&rowid atIndex:index inGroup:group];
@ -1365,8 +1346,6 @@
[databaseTransaction getCollectionKey:&ck object:&object forRowid:rowid];
return findBlock(ck.collection, ck.key, object);
#pragma clang diagnostic pop
};
break;
@ -1377,8 +1356,6 @@
(YapDatabaseViewFindWithMetadataBlock)find.findBlock;
compare = ^NSComparisonResult (NSUInteger index){
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
int64_t rowid = 0;
[self getRowid:&rowid atIndex:index inGroup:group];
@ -1388,8 +1365,6 @@
[databaseTransaction getCollectionKey:&ck metadata:&metadata forRowid:rowid];
return findBlock(ck.collection, ck.key, metadata);
#pragma clang diagnostic pop
};
break;
@ -1400,8 +1375,6 @@
(YapDatabaseViewFindWithRowBlock)find.findBlock;
compare = ^NSComparisonResult (NSUInteger index){
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
int64_t rowid = 0;
[self getRowid:&rowid atIndex:index inGroup:group];
@ -1412,8 +1385,6 @@
[databaseTransaction getCollectionKey:&ck object:&object metadata:&metadata forRowid:rowid];
return findBlock(ck.collection, ck.key, object, metadata);
#pragma clang diagnostic pop
};
}
@ -1556,8 +1527,6 @@
NSDictionary *extensionDependencies = databaseTransaction->connection->extensionDependencies;
[extensionDependencies enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL __unused *stop){
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
__unsafe_unretained NSString *extName = (NSString *)key;
__unsafe_unretained NSSet *extDependencies = (NSSet *)obj;
@ -1572,8 +1541,6 @@
[(id <YapDatabaseViewDependency>)extTransaction view:registeredName didRepopulateWithFlags:flags];
}
}
#pragma clang diagnostic pop
}];
}

View File

@ -120,16 +120,12 @@
[newOperations addObjectsFromArray:insertedOperations];
[indexesToReplace enumerateIndexesUsingBlock:^(NSUInteger index, BOOL *stop) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
YapDatabaseCloudCoreOperation *oldOperation = operations[index];
YapDatabaseCloudCoreOperation *newOperation = modifiedOperations[oldOperation.uuid];
[newOperations replaceObjectAtIndex:index withObject:newOperation];
[matchedModifiedOperations addObject:newOperation];
#pragma clang diagnostic pop
}];
operations = [[self class] sortOperationsByPriority:newOperations];

View File

@ -127,12 +127,8 @@ NSString *const YDBCloudCore_EphemeralKey_Hold = @"hold";
__block YapDatabaseCloudCore *owner = nil;
dispatch_block_t block = ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
owner = _atomic_owner;
#pragma clang diagnostic pop
}};
if (dispatch_get_specific(IsOnQueueKey))
@ -148,16 +144,12 @@ NSString *const YDBCloudCore_EphemeralKey_Hold = @"hold";
__block BOOL wasOwnerSet = NO;
dispatch_block_t block = ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
if (!_atomic_owner && inOwner)
{
_atomic_owner = inOwner;
wasOwnerSet = YES;
}
#pragma clang diagnostic pop
}};
if (dispatch_get_specific(IsOnQueueKey))
@ -184,8 +176,6 @@ NSString *const YDBCloudCore_EphemeralKey_Hold = @"hold";
__block YapDatabaseCloudCoreOperation *match = nil;
dispatch_block_t block = ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
for (YapDatabaseCloudCoreGraph *graph in graphs)
{
@ -198,8 +188,6 @@ NSString *const YDBCloudCore_EphemeralKey_Hold = @"hold";
}
}
}
#pragma clang diagnostic pop
}};
if (dispatch_get_specific(IsOnQueueKey))
@ -225,8 +213,6 @@ NSString *const YDBCloudCore_EphemeralKey_Hold = @"hold";
__block NSMutableArray<NSArray<YapDatabaseCloudCoreOperation *> *> *graphOperations = nil;
dispatch_block_t block = ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
graphOperations = [NSMutableArray arrayWithCapacity:graphs.count];
@ -234,8 +220,6 @@ NSString *const YDBCloudCore_EphemeralKey_Hold = @"hold";
{
[graphOperations addObject:graph.operations];
}
#pragma clang diagnostic pop
}};
if (dispatch_get_specific(IsOnQueueKey))
@ -266,12 +250,8 @@ NSString *const YDBCloudCore_EphemeralKey_Hold = @"hold";
__block NSUInteger graphCount = 0;
dispatch_block_t block = ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
graphCount = graphs.count;
#pragma clang diagnostic pop
}};
if (dispatch_get_specific(IsOnQueueKey))
@ -287,8 +267,6 @@ NSString *const YDBCloudCore_EphemeralKey_Hold = @"hold";
__block NSMutableArray<NSArray<YapDatabaseCloudCoreOperation *> *> *graphOperations = nil;
dispatch_block_t block = ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
graphOperations = [NSMutableArray arrayWithCapacity:graphs.count];
@ -296,8 +274,6 @@ NSString *const YDBCloudCore_EphemeralKey_Hold = @"hold";
{
[graphOperations addObject:graph.operations];
}
#pragma clang diagnostic pop
}};
if (dispatch_get_specific(IsOnQueueKey))
@ -314,16 +290,12 @@ NSString *const YDBCloudCore_EphemeralKey_Hold = @"hold";
__block uint64_t graphID = 0;
dispatch_block_t block = ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
if (idx <= graphs.count)
{
found = YES;
graphID = graphs[idx].persistentOrder;
}
#pragma clang diagnostic pop
}};
if (dispatch_get_specific(IsOnQueueKey))
@ -340,16 +312,12 @@ NSString *const YDBCloudCore_EphemeralKey_Hold = @"hold";
__block uint64_t nextGraphID = 0;
dispatch_block_t block = ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
YapDatabaseCloudCoreGraph *lastGraph = [graphs lastObject];
if (lastGraph)
{
nextGraphID = lastGraph.persistentOrder + 1;
}
#pragma clang diagnostic pop
}};
if (dispatch_get_specific(IsOnQueueKey))
@ -375,13 +343,9 @@ NSString *const YDBCloudCore_EphemeralKey_Hold = @"hold";
__block id result = nil;
dispatch_block_t block = ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
NSMutableDictionary *opInfo = ephemeralInfo[opUUID];
result = opInfo[key];
#pragma clang diagnostic pop
}};
if (dispatch_get_specific(IsOnQueueKey))
@ -401,8 +365,6 @@ NSString *const YDBCloudCore_EphemeralKey_Hold = @"hold";
if (uuid == nil) return;
dispatch_block_t block = ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
NSMutableDictionary *opInfo = ephemeralInfo[uuid];
if (opInfo)
@ -421,8 +383,6 @@ NSString *const YDBCloudCore_EphemeralKey_Hold = @"hold";
opInfo[key] = object;
}
#pragma clang diagnostic pop
}};
if (dispatch_get_specific(IsOnQueueKey))
@ -436,8 +396,6 @@ NSString *const YDBCloudCore_EphemeralKey_Hold = @"hold";
__block BOOL allowed = YES;
dispatch_block_t block = ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
NSMutableDictionary *opInfo = ephemeralInfo[uuid];
if (opInfo == nil)
@ -463,8 +421,6 @@ NSString *const YDBCloudCore_EphemeralKey_Hold = @"hold";
{
opInfo[YDBCloudCore_EphemeralKey_Status] = @(status);
}
#pragma clang diagnostic pop
}};
if (dispatch_get_specific(IsOnQueueKey))
@ -487,8 +443,6 @@ NSString *const YDBCloudCore_EphemeralKey_Hold = @"hold";
__block NSDate *hold = nil;
dispatch_block_t block = ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
NSMutableDictionary *opInfo = ephemeralInfo[opUUID];
if (opInfo)
@ -497,8 +451,6 @@ NSString *const YDBCloudCore_EphemeralKey_Hold = @"hold";
status = opInfo[YDBCloudCore_EphemeralKey_Status];
hold = opInfo[YDBCloudCore_EphemeralKey_Hold];
}
#pragma clang diagnostic pop
}};
if (dispatch_get_specific(IsOnQueueKey))
@ -553,16 +505,11 @@ NSString *const YDBCloudCore_EphemeralKey_Hold = @"hold";
{
if (opUUID == nil) return;
__weak YapDatabaseCloudCorePipeline *weakSelf = self;
dispatch_block_t block = ^{ @autoreleasepool {
__strong YapDatabaseCloudCorePipeline *strongSelf = weakSelf;
if (strongSelf == nil) return;
if ([strongSelf _setStatus:YDBCloudOperationStatus_Started forOperationUUID:opUUID])
if ([self _setStatus:YDBCloudOperationStatus_Started forOperationUUID:opUUID])
{
[strongSelf->startedOpUUIDs addObject:opUUID];
[startedOpUUIDs addObject:opUUID];
}
}};
@ -581,18 +528,13 @@ NSString *const YDBCloudCore_EphemeralKey_Hold = @"hold";
{
if (opUUID == nil) return;
__weak YapDatabaseCloudCorePipeline *weakSelf = self;
dispatch_block_t block = ^{ @autoreleasepool {
__strong YapDatabaseCloudCorePipeline *strongSelf = weakSelf;
if (strongSelf == nil) return;
BOOL changed = [strongSelf _setStatus:YDBCloudOperationStatus_Pending forOperationUUID:opUUID];
BOOL changed = [self _setStatus:YDBCloudOperationStatus_Pending forOperationUUID:opUUID];
if (changed)
{
[strongSelf->startedOpUUIDs removeObject:opUUID];
[strongSelf startNextOperationIfPossible];
[startedOpUUIDs removeObject:opUUID];
[self startNextOperationIfPossible];
}
}};
@ -613,27 +555,21 @@ NSString *const YDBCloudCore_EphemeralKey_Hold = @"hold";
retryDelay:(NSTimeInterval)delay
{
NSDate *hold = nil;
if (delay > 0.0) {
if (delay > 0.0)
hold = [NSDate dateWithTimeIntervalSinceNow:delay];
}
__weak YapDatabaseCloudCorePipeline *weakSelf = self;
dispatch_block_t block = ^{ @autoreleasepool {
__strong YapDatabaseCloudCorePipeline *strongSelf = weakSelf;
if (strongSelf == nil) return;
BOOL changed = [strongSelf _setStatus:YDBCloudOperationStatus_Pending forOperationUUID:opUUID];
BOOL changed = [self _setStatus:YDBCloudOperationStatus_Pending forOperationUUID:opUUID];
if (changed)
{
[strongSelf _setEphemeralInfo:hold
forKey:YDBCloudCore_EphemeralKey_Hold
operationUUID:opUUID];
[self _setEphemeralInfo:hold
forKey:YDBCloudCore_EphemeralKey_Hold
operationUUID:opUUID];
[strongSelf->startedOpUUIDs removeObject:opUUID];
[strongSelf updateHoldTimer];
[strongSelf startNextOperationIfPossible];
[startedOpUUIDs removeObject:opUUID];
[self updateHoldTimer];
[self startNextOperationIfPossible];
}
}};
@ -953,12 +889,8 @@ NSString *const YDBCloudCore_EphemeralKey_Hold = @"hold";
__block BOOL status = NO;
dispatch_block_t block = ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
status = isActive;
#pragma clang diagnostic pop
}};
if (dispatch_get_specific(IsOnQueueKey))
@ -1050,22 +982,17 @@ NSString *const YDBCloudCore_EphemeralKey_Hold = @"hold";
{
YDBLogAutoTrace();
__weak YapDatabaseCloudCorePipeline *weakSelf = self;
dispatch_block_t block = ^{ @autoreleasepool {
__strong YapDatabaseCloudCorePipeline *strongSelf = weakSelf;
if (strongSelf == nil) return;
for (YapDatabaseCloudCoreGraph *graph in inGraphs)
{
graph.pipeline = self;
}
[strongSelf->graphs addObjectsFromArray:inGraphs];
[graphs addObjectsFromArray:inGraphs];
if (strongSelf->graphs.count > 0) {
[strongSelf startNextOperationIfPossible];
if (graphs.count > 0) {
[self startNextOperationIfPossible];
}
}};
@ -1082,8 +1009,6 @@ NSString *const YDBCloudCore_EphemeralKey_Hold = @"hold";
YDBLogAutoTrace();
dispatch_block_t block = ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
if (graph)
{
@ -1148,8 +1073,6 @@ NSString *const YDBCloudCore_EphemeralKey_Hold = @"hold";
// Notify listeners that the operation list in the queue changed.
[self postQueueChangedNotification];
}
#pragma clang diagnostic pop
}};
if (dispatch_get_specific(IsOnQueueKey))
@ -1174,19 +1097,14 @@ NSString *const YDBCloudCore_EphemeralKey_Hold = @"hold";
int const flagOn = 1;
BOOL didSetFlagOn = OSAtomicCompareAndSwapInt(flagOff, flagOn, &needsStartNextOperationFlag);
if (didSetFlagOn)
{
__weak YapDatabaseCloudCorePipeline *weakSelf = self;
dispatch_async(queue, ^{ @autoreleasepool {
__strong YapDatabaseCloudCorePipeline *strongSelf = weakSelf;
if (strongSelf)
{
OSAtomicCompareAndSwapInt(flagOn, flagOff, &strongSelf->needsStartNextOperationFlag);
[strongSelf startNextOperationIfPossible];
}
OSAtomicCompareAndSwapInt(flagOn, flagOff, &needsStartNextOperationFlag);
[self startNextOperationIfPossible];
}});
}
}

View File

@ -152,7 +152,6 @@
/**
* Compares the receiver with the given operation.
* Subclasses should override this method, and add their own comparisons.
**/
- (BOOL)isEqualToOperation:(YapDatabaseCloudCoreOperation *)operation;

View File

@ -241,7 +241,7 @@ NSString *const YDBCloudCoreOperationIsReadyToStartNotification = @"YDBCloudCore
- (BOOL)pendingStatusIsSkippedOrCompleted
{
if (pendingStatus != nil)
if (pendingStatus)
{
YDBCloudCoreOperationStatus status = (YDBCloudCoreOperationStatus)[pendingStatus integerValue];
@ -255,7 +255,7 @@ NSString *const YDBCloudCoreOperationIsReadyToStartNotification = @"YDBCloudCore
- (BOOL)pendingStatusIsCompleted
{
if (pendingStatus != nil)
if (pendingStatus)
return ([pendingStatus integerValue] == YDBCloudOperationStatus_Completed);
else
return NO;
@ -263,7 +263,7 @@ NSString *const YDBCloudCoreOperationIsReadyToStartNotification = @"YDBCloudCore
- (BOOL)pendingStatusIsSkipped
{
if (pendingStatus != nil)
if (pendingStatus)
return ([pendingStatus integerValue] == YDBCloudOperationStatus_Skipped);
else
return NO;

View File

@ -4,8 +4,6 @@
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/**
* A many-to-many cache has the following features:
*
@ -91,7 +89,7 @@ NS_ASSUME_NONNULL_BEGIN
* And then the key/value tuple is moved to the beginning of the most-recently-used linked-list.
**/
- (void)insertKey:(id)key value:(id)value;
- (void)insertKey:(id)key value:(id)value metadata:(nullable id)metadata;
- (void)insertKey:(id)key value:(id)value metadata:(id)metadata;
/**
* Returns whether or not the cache contains the key/value tuple.
@ -109,7 +107,7 @@ NS_ASSUME_NONNULL_BEGIN
*
* If the key/value tuple exists, it's moved to the beginning of the most-recently-used linked-list.
**/
- (nullable id)metadataForKey:(id)key value:(id)value;
- (id)metadataForKey:(id)key value:(id)value;
/**
* Returns YES if the given key or value has 1 or more entries in the cache.
@ -130,15 +128,15 @@ NS_ASSUME_NONNULL_BEGIN
*
* All key/value tuples accessed during enumeration are moved to the beginning of the most-recently-used linked-list.
**/
- (void)enumerateValuesForKey:(id)key withBlock:(void (^)(id value, __nullable id metadata, BOOL *stop))block;
- (void)enumerateKeysForValue:(id)value withBlock:(void (^)(id value, __nullable id metadata, BOOL *stop))block;
- (void)enumerateValuesForKey:(id)key withBlock:(void (^)(id value, id metadata, BOOL *stop))block;
- (void)enumerateKeysForValue:(id)value withBlock:(void (^)(id value, id metadata, BOOL *stop))block;
/**
* Enumerates all key/value pairs in the cache.
*
* As this method is designed to enumerate all values, it ddes not affect the most-recently-used linked-list.
**/
- (void)enumerateWithBlock:(void (^)(id key, id value, __nullable id metadata, BOOL *stop))block;
- (void)enumerateWithBlock:(void (^)(id key, id value, id metadata, BOOL *stop))block;
/**
* Removes the tuple that matches the given key/value pair.
@ -163,5 +161,3 @@ NS_ASSUME_NONNULL_BEGIN
- (void)debug;
@end
NS_ASSUME_NONNULL_END

View File

@ -276,8 +276,6 @@ withRegisteredExtensions:(NSDictionary __unused *)registeredExtensions
__block YapDatabaseCloudCorePipeline *pipeline = nil;
dispatch_block_t block = ^{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
pipeline = pipelines[name];
@ -289,8 +287,6 @@ withRegisteredExtensions:(NSDictionary __unused *)registeredExtensions
pipeline = pipelines[alias];
}
}
#pragma clang diagnostic pop
};
if (dispatch_get_specific(IsOnQueueKey))
@ -320,8 +316,6 @@ withRegisteredExtensions:(NSDictionary __unused *)registeredExtensions
__block BOOL result = YES;
dispatch_block_t block = ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
if (pipelines[pipeline.name] != nil)
{
@ -348,8 +342,6 @@ withRegisteredExtensions:(NSDictionary __unused *)registeredExtensions
if (suspendCount > 0) {
[pipeline suspendWithCount:suspendCount];
}
#pragma clang diagnostic pop
}};
if (dispatch_get_specific(IsOnQueueKey))
@ -368,12 +360,8 @@ withRegisteredExtensions:(NSDictionary __unused *)registeredExtensions
__block NSArray *allPipelines = nil;
dispatch_block_t block = ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
allPipelines = [pipelines allValues];
#pragma clang diagnostic pop
}};
if (dispatch_get_specific(IsOnQueueKey))
@ -392,12 +380,8 @@ withRegisteredExtensions:(NSDictionary __unused *)registeredExtensions
__block NSArray *allPipelineNames = nil;
dispatch_block_t block = ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
allPipelineNames = [pipelines allKeys];
#pragma clang diagnostic pop
}};
if (dispatch_get_specific(IsOnQueueKey))
@ -417,12 +401,8 @@ withRegisteredExtensions:(NSDictionary __unused *)registeredExtensions
__block NSArray *allNames = nil;
dispatch_block_t block = ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
allNames = [pipelines allKeys];
#pragma clang diagnostic pop
}};
if (dispatch_get_specific(IsOnQueueKey))
@ -450,12 +430,7 @@ withRegisteredExtensions:(NSDictionary __unused *)registeredExtensions
__block NSUInteger result = 0;
dispatch_block_t block = ^{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
result = suspendCount;
#pragma clang diagnostic pop
};
if (dispatch_get_specific(IsOnQueueKey))
@ -476,8 +451,6 @@ withRegisteredExtensions:(NSDictionary __unused *)registeredExtensions
__block NSUInteger newSuspendCount = 0;
dispatch_block_t block = ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
if (suspendCount <= (NSUIntegerMax - suspendCountIncrement))
suspendCount += suspendCountIncrement;
@ -491,8 +464,6 @@ withRegisteredExtensions:(NSDictionary __unused *)registeredExtensions
{
[pipeline suspendWithCount:suspendCountIncrement];
}
#pragma clang diagnostic pop
}};
if (dispatch_get_specific(IsOnQueueKey))
@ -508,9 +479,7 @@ withRegisteredExtensions:(NSDictionary __unused *)registeredExtensions
__block NSUInteger newSuspendCount = 0;
dispatch_block_t block = ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
if (suspendCount > 0) {
suspendCount--;
}
@ -521,8 +490,6 @@ withRegisteredExtensions:(NSDictionary __unused *)registeredExtensions
{
[pipeline resume];
}
#pragma clang diagnostic pop
}};
if (dispatch_get_specific(IsOnQueueKey))
@ -546,8 +513,6 @@ withRegisteredExtensions:(NSDictionary __unused *)registeredExtensions
YDBLogAutoTrace();
dispatch_block_t block = ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
[rowidsToPipelineName enumerateKeysAndObjectsUsingBlock:^(NSNumber *rowid, NSString *pipelineName, BOOL *stop){
@ -557,8 +522,6 @@ withRegisteredExtensions:(NSDictionary __unused *)registeredExtensions
pipeline.rowid = [rowid longLongValue];
}
}];
#pragma clang diagnostic pop
}};
if (dispatch_get_specific(IsOnQueueKey))
@ -575,8 +538,6 @@ withRegisteredExtensions:(NSDictionary __unused *)registeredExtensions
YDBLogAutoTrace();
dispatch_block_t block = ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
[sortedGraphsPerPipeline enumerateKeysAndObjectsUsingBlock:
^(NSString *pipelineName, NSArray *sortedGraphs, BOOL *stop)
@ -587,8 +548,6 @@ withRegisteredExtensions:(NSDictionary __unused *)registeredExtensions
[pipeline restoreGraphs:sortedGraphs];
}
}];
#pragma clang diagnostic pop
}};
if (dispatch_get_specific(IsOnQueueKey))
@ -614,8 +573,6 @@ withRegisteredExtensions:(NSDictionary __unused *)registeredExtensions
}
dispatch_block_t block = ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
for (YapDatabaseCloudCorePipeline *pipeline in [pipelines objectEnumerator])
{
@ -626,8 +583,6 @@ withRegisteredExtensions:(NSDictionary __unused *)registeredExtensions
insertedOperations:insertedForPipeline
modifiedOperations:modifiedOperations];
}
#pragma clang diagnostic pop
}};
if (dispatch_get_specific(IsOnQueueKey))

View File

@ -318,15 +318,11 @@
else
{
[modifiedMappings enumerateWithBlock:^(NSNumber *rowid, NSString *path, id metadata, BOOL *stop) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
if (metadata == YDBCloudCore_DiryMappingMetadata_NeedsRemove)
{
[cleanMappingCache removeItemWithKey:rowid value:path];
}
#pragma clang diagnostic pop
}];
}

View File

@ -110,18 +110,6 @@
**/
- (YapDatabaseCloudCoreOperation *)operationWithUUID:(NSUUID *)uuid inPipeline:(NSString *)pipelineName;
/**
* Fetches the graph index that corresponds to newly added operations.
* That is, operations that are added during this commit (read-write transaction).
*
* This may be useful if you need to find and modify operations added during the current read/write transaction.
*
* @return
* The index of the graph that will contain newly added operations from this commit.
* Or NSNotFound if the pipeline isn't found.
**/
- (NSUInteger)graphForAddedOperationsInPipeline:(NSString *)pipelineName;
/**
* @param operation
* The operation to search for.
@ -170,25 +158,6 @@
usingBlock:(void (^)(YapDatabaseCloudCoreOperation *operation,
NSUInteger graphIdx, BOOL *stop))enumBlock;
/**
* Enumerates only those operations that have been added during this commit.
*
* That is, the operations added via the `addOperation:` method,
* within the current readWriteTransaction.
**/
- (void)enumerateAddedOperationsUsingBlock:(void (^)(YapDatabaseCloudCorePipeline *pipeline,
YapDatabaseCloudCoreOperation *operation,
NSUInteger graphIdx, BOOL *stop))enumBlock;
/**
* Enumerates only those operations that have been added during this commit.
*
* That is, the operations added via the `addOperation:` method,
* within the current readWriteTransaction.
**/
- (void)enumerateAddedOperationsInPipeline:(NSString *)pipeline
usingBlock:(void (^)(YapDatabaseCloudCoreOperation *operation,
NSUInteger graphIdx, BOOL *stop))enumBlock;
#pragma mark Tag Support
/**

View File

@ -2402,26 +2402,6 @@ static NSString *const ext_key_versionTag = @"versionTag";
return matchedOp;
}
/**
* Fetches the graph index that corresponds to newly added operations.
* That is, operations that are added during this commit (read-write transaction).
*
* This may be useful if you need to find and modify operations added during the current read/write transaction.
*
* @return
* The index of the graph that will contain newly added operations from this commit.
* Or NSNotFound if the pipeline isn't found.
**/
- (NSUInteger)graphForAddedOperationsInPipeline:(NSString *)pipelineName
{
YapDatabaseCloudCorePipeline *pipeline = [parentConnection->parent pipelineWithName:pipelineName];
if (pipeline)
return pipeline.graphCount;
else
return NSNotFound;
}
/**
* @param operation
* The operation to search for.
@ -2526,49 +2506,6 @@ static NSString *const ext_key_versionTag = @"versionTag";
}];
}
/**
* Public API
**/
- (void)enumerateAddedOperationsUsingBlock:(void (^)(YapDatabaseCloudCorePipeline *pipeline,
YapDatabaseCloudCoreOperation *operation,
NSUInteger graphIdx, BOOL *stop))enumBlock
{
if (enumBlock == nil) return;
if (databaseTransaction->isReadWriteTransaction == NO) return;
[self _enumerateAndModifyOperations:YDBCloudCore_EnumOps_Added
usingBlock:
^YapDatabaseCloudCoreOperation *(YapDatabaseCloudCorePipeline *pipeline,
YapDatabaseCloudCoreOperation *operation,
NSUInteger graphIdx, BOOL *stop)
{
enumBlock(pipeline, [operation copy], graphIdx, stop);
return nil;
}];
}
/**
* Public API
**/
- (void)enumerateAddedOperationsInPipeline:(NSString *)pipelineName
usingBlock:(void (^)(YapDatabaseCloudCoreOperation *operation,
NSUInteger graphIdx, BOOL *stop))enumBlock
{
if (enumBlock == nil) return;
if (databaseTransaction->isReadWriteTransaction == NO) return;
YapDatabaseCloudCorePipeline *pipeline = [parentConnection->parent pipelineWithName:pipelineName];
[self _enumerateAndModifyOperations:YDBCloudCore_EnumOps_All
inPipeline:pipeline
usingBlock:
^YapDatabaseCloudCoreOperation *(YapDatabaseCloudCoreOperation *operation, NSUInteger graphIdx, BOOL *stop)
{
enumBlock([operation copy], graphIdx, stop);
return nil;
}];
}
/**
* Internal enumerate method.
*
@ -2703,68 +2640,65 @@ static NSString *const ext_key_versionTag = @"versionTag";
if (enumBlock == nil) return;
__block BOOL stop = NO;
__block BOOL pipelineHasOps = NO;
__block NSUInteger lastGraphIdx = 0;
NSArray<NSArray<YapDatabaseCloudCoreOperation *> *> *graphOperations = pipeline.graphOperations;
[graphOperations enumerateObjectsUsingBlock:
^(NSArray<YapDatabaseCloudCoreOperation *> *operations, NSUInteger idx, BOOL *innerStop)
[pipeline _enumerateOperationsUsingBlock:
^(YapDatabaseCloudCoreOperation *queuedOp, NSUInteger graphIdx, BOOL *innerStop)
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
pipelineHasOps = YES;
if (lastGraphIdx != graphIdx)
{
if (flags & YDBCloudCore_EnumOps_Inserted)
{
NSDictionary *insertedGraphs = parentConnection->operations_inserted[pipeline.name];
NSMutableArray<YapDatabaseCloudCoreOperation *> *insertedOps = insertedGraphs[@(lastGraphIdx)];
for (NSUInteger i = 0; i < insertedOps.count; i++)
{
YapDatabaseCloudCoreOperation *op = insertedOps[i];
YapDatabaseCloudCoreOperation *modifiedOp = enumBlock(op, lastGraphIdx, &stop);
if (modifiedOp)
{
insertedOps[i] = modifiedOp;
}
if (stop) break;
}
if (stop) {
*innerStop = YES;
return;
}
}
lastGraphIdx = graphIdx;
}
if (flags & YDBCloudCore_EnumOps_Existing)
{
for (YapDatabaseCloudCoreOperation *queuedOp in operations)
YapDatabaseCloudCoreOperation *modifiedOp = parentConnection->operations_modified[queuedOp.uuid];
if (modifiedOp)
modifiedOp = enumBlock(modifiedOp, graphIdx, &stop);
else
modifiedOp = enumBlock(queuedOp, graphIdx, &stop);
if (modifiedOp)
{
YapDatabaseCloudCoreOperation *modifiedOp = parentConnection->operations_modified[queuedOp.uuid];
if (modifiedOp)
modifiedOp = enumBlock(modifiedOp, idx, &stop);
else
modifiedOp = enumBlock(queuedOp, idx, &stop);
if (modifiedOp)
{
parentConnection->operations_modified[modifiedOp.uuid] = modifiedOp;
}
if (stop) {
*innerStop = YES;
return;
}
parentConnection->operations_modified[modifiedOp.uuid] = modifiedOp;
}
}
if (flags & YDBCloudCore_EnumOps_Inserted)
{
NSDictionary *insertedGraphs = parentConnection->operations_inserted[pipeline.name];
NSMutableArray<YapDatabaseCloudCoreOperation *> *insertedOps = insertedGraphs[@(idx)];
for (NSUInteger i = 0; i < insertedOps.count; i++)
{
YapDatabaseCloudCoreOperation *op = insertedOps[i];
YapDatabaseCloudCoreOperation *modifiedOp = enumBlock(op, idx, &stop);
if (modifiedOp)
{
insertedOps[i] = modifiedOp;
}
if (stop) {
*innerStop = YES;
return;
}
}
if (stop) *innerStop = YES;
}
#pragma clang diagnostic pop
}];
if (!stop && (flags & YDBCloudCore_EnumOps_Added))
{
NSUInteger lastGraphIdx = graphOperations.count;
NSUInteger nextGraphIdx = (lastGraphIdx == 0) ? 0 : (lastGraphIdx + 1);
NSUInteger nextGraphIdx = pipelineHasOps ? (lastGraphIdx + 1) : 0;
NSMutableArray<YapDatabaseCloudCoreOperation *> *addedOps =
parentConnection->operations_added[pipeline.name];
@ -3389,23 +3323,18 @@ static NSString *const ext_key_versionTag = @"versionTag";
[parentConnection->operations_added enumerateKeysAndObjectsUsingBlock:
^(NSString *pipelineName, NSArray *allAddedOperationsForPipeline, BOOL *stop)
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
YapDatabaseCloudCorePipeline *pipeline = [parentConnection->parent pipelineWithName:pipelineName];
NSUInteger graphIdx = pipeline.graphCount;
{
YapDatabaseCloudCorePipeline *pipeline = [parentConnection->parent pipelineWithName:pipelineName];
NSUInteger graphIdx = pipeline.graphCount;
NSArray *processedOperationsForPipeline =
[self processOperations:allAddedOperationsForPipeline inPipeline:pipeline withGraphIdx:graphIdx];
if (processedOperationsForPipeline.count > 0)
{
processedAddedOps[pipelineName] = processedOperationsForPipeline;
}
#pragma clang diagnostic pop
}];
NSArray *processedOperationsForPipeline =
[self processOperations:allAddedOperationsForPipeline inPipeline:pipeline withGraphIdx:graphIdx];
if (processedOperationsForPipeline.count > 0)
{
processedAddedOps[pipelineName] = processedOperationsForPipeline;
}
}];
}
// Step 3 of 5:
@ -3415,9 +3344,6 @@ static NSString *const ext_key_versionTag = @"versionTag";
[processedAddedOps enumerateKeysAndObjectsUsingBlock:
^(NSString *pipelineName, NSArray *operations, BOOL *stop)
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
YapDatabaseCloudCorePipeline *pipeline = [parentConnection->parent pipelineWithName:pipelineName];
uint64_t nextGraphID = [pipeline nextGraphID];
@ -3429,8 +3355,6 @@ static NSString *const ext_key_versionTag = @"versionTag";
[[YapDatabaseCloudCoreGraph alloc] initWithPersistentOrder:nextGraphID operations:operations];
[parentConnection->graphs_added setObject:graph forKey:pipelineName];
#pragma clang diagnostic pop
}];
for (YapDatabaseCloudCorePipeline *pipeline in pipelines)
@ -3474,7 +3398,7 @@ static NSString *const ext_key_versionTag = @"versionTag";
{
[self mappingTable_insertRowWithRowid:[rowid unsignedLongLongValue] cloudURI:cloudURI];
[self->parentConnection->cleanMappingCache insertKey:rowid value:cloudURI];
[parentConnection->cleanMappingCache insertKey:rowid value:cloudURI];
}
else if (metadata == YDBCloudCore_DiryMappingMetadata_NeedsRemove)
{
@ -3505,7 +3429,7 @@ static NSString *const ext_key_versionTag = @"versionTag";
{
[self tagTable_insertOrUpdateRowWithKey:key identifier:identifier tag:tag];
[self->parentConnection->tagCache setObject:tag forKey:tuple];
[parentConnection->tagCache setObject:tag forKey:tuple];
}
}];
}

View File

@ -132,10 +132,10 @@
[inOriginalValues enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
if ([self->originalValues objectForKey:key] == nil)
if ([originalValues objectForKey:key] == nil)
{
if (newOriginalValues == nil)
newOriginalValues = [self->originalValues mutableCopy];
newOriginalValues = [originalValues mutableCopy];
[newOriginalValues setObject:obj forKey:key];
}

View File

@ -53,9 +53,9 @@
{
[newerOriginalValues enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
if ([self->originalValues objectForKey:key] == nil)
if ([originalValues objectForKey:key] == nil)
{
[self->originalValues setObject:obj forKey:key];
[originalValues setObject:obj forKey:key];
}
}];
}

View File

@ -479,70 +479,63 @@ NSString *const YapDatabaseCloudKitInFlightChangeSetChangedNotification = @"YDBC
{
YDBLogAutoTrace();
__weak YapDatabaseCloudKit *weakSelf = self;
// The 'forceNotification' parameter will be YES when this method
// is being called after successfully completing a previous operation.
dispatch_queue_t bgQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
dispatch_async(bgQueue, ^{ @autoreleasepool {
__strong YapDatabaseCloudKit *strongSelf = weakSelf;
[strongSelf maybeDispatchNextOperation:forceNotification];
if (self.isSuspended) // this method is thread-safe
{
YDBLogVerbose(@"Skipping dispatch operation - suspended");
if (forceNotification) {
[self postInFlightChangeSetChangedNotification:[masterQueue currentChangeSetUUID]];
}
return;
}
BOOL isAlreadyInFlight = NO;
YDBCKChangeSet *nextChangeSet = nil;
nextChangeSet = [masterQueue makeInFlightChangeSet:&isAlreadyInFlight]; // this method is thread-safe
if (nextChangeSet == nil)
{
if (isAlreadyInFlight) { // <- { brackets } required when YapDatabaseLoggingTechnique_Disabled
YDBLogVerbose(@"Skipping dispatch operation - upload in progress");
}
else {
YDBLogVerbose(@"Skipping dispatch operation - nothing to upload");
}
if (forceNotification) {
[self postInFlightChangeSetChangedNotification:[masterQueue currentChangeSetUUID]];
}
return;
}
if ([nextChangeSet->deletedRecordIDs count] == 0 &&
[nextChangeSet->modifiedRecords count] == 0)
{
YDBLogVerbose(@"Dropping empty queued operation: %@", nextChangeSet);
NSString *changeSetUUID = nextChangeSet.uuid;
[self handleCompletedOperationWithChangeSet:nextChangeSet savedRecords:nil deletedRecordIDs:nil];
[self postInFlightChangeSetChangedNotification:changeSetUUID];
}
else
{
YDBLogVerbose(@"Queueing operation: %@", nextChangeSet);
NSString *changeSetUUID = nextChangeSet.uuid;
[self queueOperationForChangeSet:nextChangeSet];
[self postInFlightChangeSetChangedNotification:changeSetUUID];
}
}});
}
- (void)maybeDispatchNextOperation:(BOOL)forceNotification
{
// The 'forceNotification' parameter will be YES when this method
// is being called after successfully completing a previous operation.
if (self.isSuspended) // this method is thread-safe
{
YDBLogVerbose(@"Skipping dispatch operation - suspended");
if (forceNotification) {
[self postInFlightChangeSetChangedNotification:[masterQueue currentChangeSetUUID]];
}
return;
}
BOOL isAlreadyInFlight = NO;
YDBCKChangeSet *nextChangeSet = nil;
nextChangeSet = [masterQueue makeInFlightChangeSet:&isAlreadyInFlight]; // this method is thread-safe
if (nextChangeSet == nil)
{
if (isAlreadyInFlight) { // <- { brackets } required when YapDatabaseLoggingTechnique_Disabled
YDBLogVerbose(@"Skipping dispatch operation - upload in progress");
}
else {
YDBLogVerbose(@"Skipping dispatch operation - nothing to upload");
}
if (forceNotification) {
[self postInFlightChangeSetChangedNotification:[masterQueue currentChangeSetUUID]];
}
return;
}
if ([nextChangeSet->deletedRecordIDs count] == 0 &&
[nextChangeSet->modifiedRecords count] == 0)
{
YDBLogVerbose(@"Dropping empty queued operation: %@", nextChangeSet);
NSString *changeSetUUID = nextChangeSet.uuid;
[self handleCompletedOperationWithChangeSet:nextChangeSet savedRecords:nil deletedRecordIDs:nil];
[self postInFlightChangeSetChangedNotification:changeSetUUID];
}
else
{
YDBLogVerbose(@"Queueing operation: %@", nextChangeSet);
NSString *changeSetUUID = nextChangeSet.uuid;
[self queueOperationForChangeSet:nextChangeSet];
[self postInFlightChangeSetChangedNotification:changeSetUUID];
}
}
- (YapDatabaseConnection *)completionDatabaseConnection
{
@ -684,12 +677,8 @@ NSString *const YapDatabaseCloudKitInFlightChangeSetChangedNotification = @"YDBC
NSString *databaseIdentifier = changeSet.databaseIdentifier;
dispatch_async(dispatch_get_main_queue(), ^{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
opErrorBlock(databaseIdentifier, operationError);
#pragma clang diagnostic pop
});
}
@ -752,13 +741,10 @@ NSString *const YapDatabaseCloudKitInFlightChangeSetChangedNotification = @"YDBC
deletedRecordIDs:success_deletedRecordIDs];
} completionBlock:^{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
// Inform the user about the problem via the operationErrorBlock.
opErrorBlock(databaseIdentifier, operationError);
#pragma clang diagnostic pop
opErrorBlock(databaseIdentifier, operationError);
}];
}

View File

@ -472,16 +472,12 @@ static BOOL ClassVersionsAreCompatible(int oldClassVersion, int newClassVersion)
(YapDatabaseCloudKitRecordWithKeyBlock)recordHandler->block;
RestoreRecordBlock = ^(int64_t rowid, CKRecord **inOutRecord, YDBCKRecordInfo *recordInfo) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
YapCollectionKey *ck = [databaseTransaction collectionKeyForRowid:rowid];
if (ck)
{
recordBlock(databaseTransaction, inOutRecord, recordInfo, ck.collection, ck.key);
}
#pragma clang diagnostic pop
};
}
else if (recordHandler->blockType == YapDatabaseBlockTypeWithObject)
@ -490,8 +486,6 @@ static BOOL ClassVersionsAreCompatible(int oldClassVersion, int newClassVersion)
(YapDatabaseCloudKitRecordWithObjectBlock)recordHandler->block;
RestoreRecordBlock = ^(int64_t rowid, CKRecord **inOutRecord, YDBCKRecordInfo *recordInfo) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
YapCollectionKey *ck = nil;
id object = nil;
@ -500,8 +494,6 @@ static BOOL ClassVersionsAreCompatible(int oldClassVersion, int newClassVersion)
{
recordBlock(databaseTransaction, inOutRecord, recordInfo, ck.collection, ck.key, object);
}
#pragma clang diagnostic pop
};
}
else if (recordHandler->blockType == YapDatabaseBlockTypeWithMetadata)
@ -510,8 +502,6 @@ static BOOL ClassVersionsAreCompatible(int oldClassVersion, int newClassVersion)
(YapDatabaseCloudKitRecordWithMetadataBlock)recordHandler->block;
RestoreRecordBlock = ^(int64_t rowid, CKRecord **inOutRecord, YDBCKRecordInfo *recordInfo) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
YapCollectionKey *ck = nil;
id metadata = nil;
@ -520,8 +510,6 @@ static BOOL ClassVersionsAreCompatible(int oldClassVersion, int newClassVersion)
{
recordBlock(databaseTransaction, inOutRecord, recordInfo, ck.collection, ck.key, metadata);
}
#pragma clang diagnostic pop
};
}
else // if (recordHandler->blockType == YapDatabaseBlockTypeWithRow)
@ -530,8 +518,6 @@ static BOOL ClassVersionsAreCompatible(int oldClassVersion, int newClassVersion)
(YapDatabaseCloudKitRecordWithRowBlock)recordHandler->block;
RestoreRecordBlock = ^(int64_t rowid, CKRecord **inOutRecord, YDBCKRecordInfo *recordInfo) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
YapCollectionKey *ck = nil;
id object = nil;
@ -541,8 +527,6 @@ static BOOL ClassVersionsAreCompatible(int oldClassVersion, int newClassVersion)
{
recordBlock(databaseTransaction, inOutRecord, recordInfo, ck.collection, ck.key, object, metadata);
}
#pragma clang diagnostic pop
};
}
@ -592,8 +576,6 @@ static BOOL ClassVersionsAreCompatible(int oldClassVersion, int newClassVersion)
void (^InsertRecord)(CKRecord*, YDBCKRecordInfo*, int64_t);
InsertRecord = ^(CKRecord *record, YDBCKRecordInfo *recordInfo, int64_t rowid) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
NSString *databaseIdentifier = recordInfo.databaseIdentifier;
NSString *hash = [self hashRecordID:record.recordID databaseIdentifier:databaseIdentifier];
@ -633,8 +615,6 @@ static BOOL ClassVersionsAreCompatible(int oldClassVersion, int newClassVersion)
[dirtyRecordTableInfo incrementOwnerCount];
[dirtyRecordTableInfo mergeOriginalValues:recordInfo.originalValues];
}
#pragma clang diagnostic pop
};
YDBCKRecordInfo *recordInfo = [[YDBCKRecordInfo alloc] init];
@ -656,7 +636,7 @@ static BOOL ClassVersionsAreCompatible(int oldClassVersion, int newClassVersion)
recordInfo.databaseIdentifier = nil;
recordInfo.originalValues = nil;
recordBlock(self->databaseTransaction, &record, recordInfo, collection, key);
recordBlock(databaseTransaction, &record, recordInfo, collection, key);
if (record) {
InsertRecord(record, recordInfo, rowid);
@ -669,7 +649,7 @@ static BOOL ClassVersionsAreCompatible(int oldClassVersion, int newClassVersion)
if ([allowedCollections isAllowed:collection])
{
[self->databaseTransaction _enumerateKeysInCollections:@[ collection ] usingBlock:enumBlock];
[databaseTransaction _enumerateKeysInCollections:@[ collection ] usingBlock:enumBlock];
}
}];
}
@ -690,7 +670,7 @@ static BOOL ClassVersionsAreCompatible(int oldClassVersion, int newClassVersion)
recordInfo.databaseIdentifier = nil;
recordInfo.originalValues = nil;
recordBlock(self->databaseTransaction, &record, recordInfo, collection, key, object);
recordBlock(databaseTransaction, &record, recordInfo, collection, key, object);
if (record) {
InsertRecord(record, recordInfo, rowid);
@ -703,7 +683,7 @@ static BOOL ClassVersionsAreCompatible(int oldClassVersion, int newClassVersion)
if ([allowedCollections isAllowed:collection])
{
[self->databaseTransaction _enumerateKeysAndObjectsInCollections:@[ collection ] usingBlock:enumBlock];
[databaseTransaction _enumerateKeysAndObjectsInCollections:@[ collection ] usingBlock:enumBlock];
}
}];
}
@ -724,7 +704,7 @@ static BOOL ClassVersionsAreCompatible(int oldClassVersion, int newClassVersion)
recordInfo.databaseIdentifier = nil;
recordInfo.originalValues = nil;
recordBlock(self->databaseTransaction, &record, recordInfo, collection, key, metadata);
recordBlock(databaseTransaction, &record, recordInfo, collection, key, metadata);
if (record) {
InsertRecord(record, recordInfo, rowid);
@ -737,7 +717,7 @@ static BOOL ClassVersionsAreCompatible(int oldClassVersion, int newClassVersion)
if ([allowedCollections isAllowed:collection])
{
[self->databaseTransaction _enumerateKeysAndMetadataInCollections:@[ collection ] usingBlock:enumBlock];
[databaseTransaction _enumerateKeysAndMetadataInCollections:@[ collection ] usingBlock:enumBlock];
}
}];
}
@ -758,7 +738,7 @@ static BOOL ClassVersionsAreCompatible(int oldClassVersion, int newClassVersion)
recordInfo.databaseIdentifier = nil;
recordInfo.originalValues = nil;
recordBlock(self->databaseTransaction, &record, recordInfo, collection, key, object, metadata);
recordBlock(databaseTransaction, &record, recordInfo, collection, key, object, metadata);
if (record) {
InsertRecord(record, recordInfo, rowid);
@ -771,7 +751,7 @@ static BOOL ClassVersionsAreCompatible(int oldClassVersion, int newClassVersion)
if ([allowedCollections isAllowed:collection])
{
[self->databaseTransaction _enumerateRowsInCollections:@[ collection ] usingBlock:enumBlock];
[databaseTransaction _enumerateRowsInCollections:@[ collection ] usingBlock:enumBlock];
}
}];
}
@ -836,7 +816,7 @@ static BOOL ClassVersionsAreCompatible(int oldClassVersion, int newClassVersion)
enumBlock = ^(int64_t rowid, NSString *collection, NSString *key, BOOL *stop) {
enumHelperBlock(rowid);
recordBlock(self->databaseTransaction, &record, recordInfo, collection, key);
recordBlock(databaseTransaction, &record, recordInfo, collection, key);
[self processRecord:record recordInfo:recordInfo
preCalculatedHash:nil
@ -852,7 +832,7 @@ static BOOL ClassVersionsAreCompatible(int oldClassVersion, int newClassVersion)
if ([allowedCollections isAllowed:collection])
{
[self->databaseTransaction _enumerateKeysInCollections:@[ collection ] usingBlock:enumBlock];
[databaseTransaction _enumerateKeysInCollections:@[ collection ] usingBlock:enumBlock];
}
}];
}
@ -870,7 +850,7 @@ static BOOL ClassVersionsAreCompatible(int oldClassVersion, int newClassVersion)
enumBlock = ^(int64_t rowid, NSString *collection, NSString *key, id object, BOOL *stop) {
enumHelperBlock(rowid);
recordBlock(self->databaseTransaction, &record, recordInfo, collection, key, object);
recordBlock(databaseTransaction, &record, recordInfo, collection, key, object);
[self processRecord:record recordInfo:recordInfo
preCalculatedHash:nil
@ -886,7 +866,7 @@ static BOOL ClassVersionsAreCompatible(int oldClassVersion, int newClassVersion)
if ([allowedCollections isAllowed:collection])
{
[self->databaseTransaction _enumerateKeysAndObjectsInCollections:@[ collection ] usingBlock:enumBlock];
[databaseTransaction _enumerateKeysAndObjectsInCollections:@[ collection ] usingBlock:enumBlock];
}
}];
}
@ -904,7 +884,7 @@ static BOOL ClassVersionsAreCompatible(int oldClassVersion, int newClassVersion)
enumBlock = ^(int64_t rowid, NSString *collection, NSString *key, id metadata, BOOL *stop) {
enumHelperBlock(rowid);
recordBlock(self->databaseTransaction, &record, recordInfo, collection, key, metadata);
recordBlock(databaseTransaction, &record, recordInfo, collection, key, metadata);
[self processRecord:record recordInfo:recordInfo
preCalculatedHash:nil
@ -920,7 +900,7 @@ static BOOL ClassVersionsAreCompatible(int oldClassVersion, int newClassVersion)
if ([allowedCollections isAllowed:collection])
{
[self->databaseTransaction _enumerateKeysAndMetadataInCollections:@[ collection ] usingBlock:enumBlock];
[databaseTransaction _enumerateKeysAndMetadataInCollections:@[ collection ] usingBlock:enumBlock];
}
}];
}
@ -938,7 +918,7 @@ static BOOL ClassVersionsAreCompatible(int oldClassVersion, int newClassVersion)
enumBlock = ^(int64_t rowid, NSString *collection, NSString *key, id object, id metadata, BOOL *stop) {
enumHelperBlock(rowid);
recordBlock(self->databaseTransaction, &record, recordInfo, collection, key, object, metadata);
recordBlock(databaseTransaction, &record, recordInfo, collection, key, object, metadata);
[self processRecord:record recordInfo:recordInfo
preCalculatedHash:nil
@ -954,7 +934,7 @@ static BOOL ClassVersionsAreCompatible(int oldClassVersion, int newClassVersion)
if ([allowedCollections isAllowed:collection])
{
[self->databaseTransaction _enumerateRowsInCollections:@[ collection ] usingBlock:enumBlock];
[databaseTransaction _enumerateRowsInCollections:@[ collection ] usingBlock:enumBlock];
}
}];
}
@ -2918,8 +2898,6 @@ static BOOL ClassVersionsAreCompatible(int oldClassVersion, int newClassVersion)
// Update mapping table.
[parentConnection->dirtyMappingTableInfoDict enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
__unsafe_unretained NSNumber *rowidNumber = (NSNumber *)key;
__unsafe_unretained YDBCKDirtyMappingTableInfo *dirtyMappingTableInfo = (YDBCKDirtyMappingTableInfo *)obj;
@ -2945,8 +2923,6 @@ static BOOL ClassVersionsAreCompatible(int oldClassVersion, int newClassVersion)
[parentConnection->changeset_mappingTableInfo setObject:cleanMappingTableInfo forKey:rowidNumber];
[parentConnection->cleanMappingTableInfoCache setObject:cleanMappingTableInfo forKey:rowidNumber];
}
#pragma clang diagnostic pop
}];
// Step 2 of 6:
@ -2954,8 +2930,6 @@ static BOOL ClassVersionsAreCompatible(int oldClassVersion, int newClassVersion)
// Update record table.
[parentConnection->dirtyRecordTableInfoDict enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
__unsafe_unretained NSString *hash = (NSString *)key;
__unsafe_unretained YDBCKDirtyRecordTableInfo *dirtyRecordTableInfo = (YDBCKDirtyRecordTableInfo *)obj;
@ -3011,8 +2985,6 @@ static BOOL ClassVersionsAreCompatible(int oldClassVersion, int newClassVersion)
[parentConnection->changeset_recordTableInfo setObject:cleanRecordTableInfo forKey:hash];
[parentConnection->cleanRecordTableInfoCache setObject:cleanRecordTableInfo forKey:hash];
}
#pragma clang diagnostic pop
}];
// Step 3 of 6:

View File

@ -1,84 +0,0 @@
#import <Foundation/Foundation.h>
#import "YapDatabase.h"
NS_ASSUME_NONNULL_BEGIN
/**
* The connection pool class was designed to help you optimize background read-only transactions.
* As a reminder:
*
* - You're encouraged to use a dedicated read-only connection for the main thread.
* https://github.com/yapstudios/YapDatabase/wiki/Performance-Primer#readonly_vs_readwrite_transactions
*
* - You're encouraged to share the dedicated read-only main-thread connection between your viewControllers:
* https://github.com/yapstudios/YapDatabase/wiki/Performance-Pro#sharing_the_ui_databaseconnection
*
* - You're encouraged to create a dedicated read-write connection for read-write transactions:
* (Because there can only be a single read-write transaction per database at any one time.)
* https://github.com/yapstudios/YapDatabase/wiki/Performance-Primer
*
* This leaves only non-main-thread read-only transactions. What's the recommendation for them?
* You could create a single read-only connection that will be shared by all background tasks.
* However, since all transactions are serialized via the shared connection,
* this implies that background task A may have to wait for background task B to finish its read-only transaction
* before background task A can execute its transaction.
* And for background tasks, this is likely not the intended result.
*
* The connection pool was designed to increase the performance in these scenarios.
* It will create connections on demand, up to (but not over) the connectionLimit.
* And it will vend connections using a simple load balancer that's based on the number of pending
* transactions that each connection has.
* (So you'll be handed the connection with the smallest queue of pending "work".)
*
* This allows for increased parallelization amongst your background tasks.
**/
@interface YapDatabaseConnectionPool : NSObject
/**
* Initializes a new connction pool with default configuration values.
* All database connections are created on demand, so you can configure the pool after initialization.
**/
- (instancetype)initWithDatabase:(YapDatabase *)database;
/**
* Specifies the maximum number of connections the pool is allowed to create.
* Connections are created on demand, so the limit may never be reached.
*
* You can update this property at anytime.
*
* The default value is 3.
* Zero is not a valid number, and will be treated as the default value.
**/
@property (atomic, assign, readwrite) NSUInteger connectionLimit;
/**
* By default, new database connections inherit their default configuration settings via
* YapDatabase.connectionDefaults, the same way that all connections do when one invokes [database newConnection].
* You may optionally configure an alternative set of defaults specifically for connections created via this pool.
*
* The default value for this property is nil,
* which means new database connections will inherit their configuration from YapDatabase.connectionDefaults.
**/
@property (atomic, strong, readwrite) YapDatabaseConnectionConfig *connectionDefaults;
/**
* Allows you to perform additional configuration on a newly created connection.
* This block is invoked BEFORE the connection is returned to the caller.
**/
@property (atomic, copy, readwrite) void(^didCreateNewConnectionBlock)(YapDatabaseConnection *newConnection);
/**
* Returns an existing connection from the pool, or creates a new connection, depending upon the pool's configuration,
* and the number of pending/active transactions for existing connections.
*
* - If there's an existing connection in the pool that doesn't have pending/active transactions,
* then that connection is returned.
* - Otherwise, if the connection count is below connectionCount, a new connection is created & returned.
* - Otherwise, an existing connection will be automatically chosen based on the number of pending/active transactions.
**/
- (YapDatabaseConnection *)connection;
@end
NS_ASSUME_NONNULL_END

View File

@ -1,147 +0,0 @@
#import "YapDatabaseConnectionPool.h"
#define DEFAULT_CONNECTION_LIMIT ((NSUInteger)3)
@implementation YapDatabaseConnectionPool {
YapDatabase *database;
dispatch_queue_t queue;
NSMutableArray<YapDatabaseConnection *> *connections;
NSUInteger connectionLimit;
YapDatabaseConnectionConfig *connectionDefaults;
}
@dynamic connectionLimit;
@dynamic connectionDefaults;
@synthesize didCreateNewConnectionBlock;
- (instancetype)initWithDatabase:(YapDatabase *)inDatabase
{
NSParameterAssert(inDatabase != nil);
if ((self = [super init]))
{
database = inDatabase;
queue = dispatch_queue_create("YapDatabaseConnectionPool", DISPATCH_QUEUE_SERIAL);
connections = [[NSMutableArray alloc] init];
connectionLimit = DEFAULT_CONNECTION_LIMIT;
}
return self;
}
- (NSUInteger)connectionLimit
{
__block NSUInteger result = 0;
dispatch_sync(queue, ^{
result = self->connectionLimit;
});
return result;
}
- (void)setConnectionLimit:(NSUInteger)limit
{
if (limit == 0) {
limit = DEFAULT_CONNECTION_LIMIT;
}
dispatch_sync(queue, ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
connectionLimit = limit;
while (connections.count > connectionLimit)
{
[connections removeLastObject];
}
#pragma clang diagnostic pop
}});
}
- (YapDatabaseConnectionConfig *)connectionDefaults
{
__block YapDatabaseConnectionConfig *result = nil;
dispatch_sync(queue, ^{
result = self->connectionDefaults;
});
return result;
}
- (void)setConnectionDefaults:(YapDatabaseConnectionConfig *)config
{
dispatch_sync(queue, ^{
self->connectionDefaults = config;
});
}
- (YapDatabaseConnection *)connection
{
__block YapDatabaseConnection *result = nil;
__block BOOL isNewConnection = NO;
dispatch_sync(queue, ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
uint64_t minLoad = 0;
for (YapDatabaseConnection *connection in connections)
{
uint64_t load = connection.pendingTransactionCount;
if (!result || load < minLoad)
{
result = connection;
minLoad = load;
}
if (minLoad == 0) {
// Found what we needed.
// We can stop looking now.
break;
}
}
BOOL createNewConnection = NO;
if (result == nil)
{
createNewConnection = YES;
}
else if (minLoad > 0)
{
if (connections.count < connectionLimit) {
createNewConnection = YES;
}
}
if (createNewConnection)
{
result = [database newConnection:connectionDefaults];
[connections addObject:result];
isNewConnection = YES;
}
#pragma clang diagnostic pop
}});
if (isNewConnection)
{
void (^block)(YapDatabaseConnection*) = self.didCreateNewConnectionBlock;
if (block) { @autoreleasepool {
block(result);
}}
}
return result;
}
@end

View File

@ -194,20 +194,35 @@ NS_ASSUME_NONNULL_BEGIN
- (void)removeObjectsForKeys:(NSArray<NSString *> *)keys inCollection:(nullable NSString *)collection;
/**
* Tells the proxy to discard pending changes (if any) for the given <collection, key> tuple.
* Immediately discards all changes that were queued to be written to the database.
* Thus any pending changes are not written to the database,
* and any currently queued readWriteTransaction is aborted.
*
* That is, IF the proxy has a pending change (for the tuple) that it intends to write to the database
* during the next flush, it will drop the pending change (and not write it to the database).
**/
- (void)resetObjectForKey:(NSString *)key inCollection:(nullable NSString *)collection;
/**
* Tells the proxy to discard ALL pending changes.
* This method is typically used if you intend to clear the database.
* For example:
*
* That is, IF the proxy has pending changes that it intends to write to the database
* during the next flush, it will instead drop all those pending changes (and not write any of them).
* // blacklist everything - act as if db is empty
* YapWhitelistBlacklist *whitelist = [[YapWhitelistBlacklist alloc] initWithWhitelist:nil];
* [connectionProxy abortAndReset:whitelist];
*
* // Then actually clear the db - but asynchronously
* [connectionProxy.readWriteConnection asyncReadWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction){
*
* [transaction removeAllObjectsInAllCollections];
*
* } completionBlock:^{
*
* // allow the connectionProxy to start reading from the db again
* connectionProxy.fetchedCollectionsFilter = nil;
* }];
*
* @param fetchedCollectionsFilter
* This parameter allows you to instruct the connectionProxy to act as if
* the readOnlyConnection doesn't see any objects within certain collections.
*
* @see fetchedCollectionsFilter
**/
- (void)reset;
- (void)abortAndReset:(nullable YapWhitelistBlacklist *)fetchedCollectionsFilter;
/**
* The fetchedCollectionsFilter is useful when you need to delete one or more collections from the database.
@ -236,27 +251,6 @@ NS_ASSUME_NONNULL_BEGIN
**/
@property (atomic, strong, readwrite, nullable) YapWhitelistBlacklist *fetchedCollectionsFilter;
/**
* Replace with the following code:
*
* // blacklist everything - act as if db is empty
* YapWhitelistBlacklist *whitelist = [[YapWhitelistBlacklist alloc] initWithWhitelist:nil];
* connectionProxy.fetchedCollectionsFilter = whitelist;
* [connectionProxy reset];
*
* // Then actually clear the db - but asynchronously
* [databaseConnection asyncReadWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction){
*
* [transaction removeAllObjectsInAllCollections];
*
* } completionBlock:^{
*
* // allow the connectionProxy to start reading from the db again
* connectionProxy.fetchedCollectionsFilter = nil;
* }];
**/
- (void)abortAndReset:(nullable YapWhitelistBlacklist *)fetchedCollectionsFilter __attribute((deprecated));
@end
NS_ASSUME_NONNULL_END

View File

@ -49,7 +49,9 @@
NSMutableArray<NSMutableSet *> *pendingObjectBatches;
NSMutableArray<NSMutableSet *> *pendingMetadataBatches;
NSMutableArray<NSNumber *> *pendingBatchCommits;
uint64_t abortAndResetCount;
YapWhitelistBlacklist *fetchedCollectionsFilter;
}
@ -99,6 +101,7 @@
pendingObjectBatches = [[NSMutableArray alloc] initWithCapacity:4];
pendingMetadataBatches = [[NSMutableArray alloc] initWithCapacity:4];
pendingBatchCommits = [[NSMutableArray alloc] initWithCapacity:4];
if (inReadOnlyConnection)
{
@ -136,17 +139,22 @@
#pragma mark Batch Logic
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- (void)queueBatchWithObjects:(NSMutableDictionary **)objectBatchPtr
metadata:(NSMutableDictionary **)metadataBatchPtr
- (void)queueBatchForCommit:(uint64_t)commit
withObjects:(NSMutableDictionary **)objectBatchPtr
metadata:(NSMutableDictionary **)metadataBatchPtr
{
YDBLogAutoTrace();
YDBLogTrace(@"%@ %llu", THIS_METHOD, commit);
__block NSMutableDictionary *objectBatch = nil;
__block NSMutableDictionary *metadataBatch = nil;
dispatch_sync(queue, ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
if (abortAndResetCount > 0) // user asked to abort this write
{
abortAndResetCount--;
return;
}
NSUInteger oCount = currentObjectBatch.count;
NSUInteger mCount = currentMetadataBatch.count;
@ -179,24 +187,28 @@
[pendingObjectBatches addObject:currentObjectBatch];
[pendingMetadataBatches addObject:currentMetadataBatch];
[pendingBatchCommits addObject:@(commit)];
currentObjectBatch = [[NSMutableSet alloc] init];
currentMetadataBatch = [[NSMutableSet alloc] init];
#pragma clang diagnostic pop
}});
if (objectBatchPtr) *objectBatchPtr = objectBatch;
if (metadataBatchPtr) *metadataBatchPtr = metadataBatch;
}
- (void)dequeueBatch
- (void)dequeueBatchForCommit:(uint64_t)commit
{
YDBLogAutoTrace();
YDBLogTrace(@"%@ %llu", THIS_METHOD, commit);
dispatch_block_t block = ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
NSNumber *nextCommit = [pendingBatchCommits firstObject];
if (!nextCommit || (nextCommit.unsignedLongLongValue != commit))
{
// This is not the commit we're looking for
return;
}
for (YapCollectionKey *ck in [pendingObjectBatches firstObject])
{
@ -215,8 +227,7 @@
[pendingObjectBatches removeObjectAtIndex:0];
[pendingMetadataBatches removeObjectAtIndex:0];
#pragma clang diagnostic pop
[pendingBatchCommits removeObjectAtIndex:0];
}};
if (dispatch_get_specific(IsOnQueueKey))
@ -229,18 +240,21 @@
{
YDBLogAutoTrace();
__block uint64_t commit = 0;
__weak YapDatabaseConnectionProxy *weakSelf = self;
#pragma clang diagnostic push
#pragma clang diagnostic warning "-Wimplicit-retain-self" // Turning warnings *** ON ***
#pragma clang diagnostic warning "-Wimplicit-retain-self"
[readWriteConnection asyncReadWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
__strong YapDatabaseConnectionProxy *strongSelf = weakSelf;
if (strongSelf == nil) return;
commit = transaction.connection.snapshot + 1;
NSMutableDictionary *objectBatch = nil;
NSMutableDictionary *metadataBatch = nil;
[strongSelf queueBatchWithObjects:&objectBatch metadata:&metadataBatch];
[strongSelf queueBatchForCommit:commit withObjects:&objectBatch metadata:&metadataBatch];
YapNull *yapnull = [YapNull null];
@ -282,7 +296,7 @@
__strong YapDatabaseConnectionProxy *strongSelf = weakSelf;
if (strongSelf)
{
[strongSelf dequeueBatch];
[strongSelf dequeueBatchForCommit:commit];
}
}];
#pragma clang diagnostic pop
@ -308,16 +322,12 @@
__block BOOL collectionFiltered = NO;
dispatch_sync(queue, ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
object = [pendingObjectCache objectForKey:ck];
if (!object && fetchedCollectionsFilter) {
collectionFiltered = ![fetchedCollectionsFilter isAllowed:collection];
}
#pragma clang diagnostic pop
}});
if (object)
@ -355,16 +365,12 @@
__block BOOL collectionFiltered = NO;
dispatch_sync(queue, ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
metadata = [pendingMetadataCache objectForKey:ck];
if (!metadata && fetchedCollectionsFilter) {
collectionFiltered = ![fetchedCollectionsFilter isAllowed:collection];
}
#pragma clang diagnostic pop
}});
if (metadata)
@ -411,8 +417,6 @@
__block BOOL collectionFiltered = NO;
dispatch_sync(queue, ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
object = [pendingObjectCache objectForKey:ck];
metadata = [pendingMetadataCache objectForKey:ck];
@ -420,8 +424,6 @@
if ((!object || !metadata) && fetchedCollectionsFilter) {
collectionFiltered = ![fetchedCollectionsFilter isAllowed:collection];
}
#pragma clang diagnostic pop
}});
if (object && metadata)
@ -504,24 +506,17 @@
__block BOOL needsWrite = NO;
dispatch_sync(queue, ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
needsWrite = ((currentObjectBatch.count == 0) && (currentMetadataBatch.count == 0));
[pendingObjectCache setObject:object forKey:ck];
[currentObjectBatch addObject:ck];
if (metadata) {
if (metadata)
[pendingMetadataCache setObject:metadata forKey:ck];
}
else {
else
[pendingMetadataCache setObject:[YapNull null] forKey:ck];
}
[currentMetadataBatch addObject:ck];
#pragma clang diagnostic pop
}});
if (needsWrite) {
@ -555,14 +550,10 @@
__block BOOL collectionFiltered = NO;
dispatch_sync(queue, ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
if (fetchedCollectionsFilter) {
collectionFiltered = ![fetchedCollectionsFilter isAllowed:collection];
}
#pragma clang diagnostic pop
}});
__block BOOL existsInDatabase = NO;
@ -578,8 +569,6 @@
__block BOOL needsWrite = NO;
dispatch_sync(queue, ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
id existing_object = [pendingObjectCache objectForKey:ck];
@ -605,8 +594,6 @@
[pendingObjectCache setObject:object forKey:ck];
[currentObjectBatch addObject:ck];
}
#pragma clang diagnostic pop
}});
if (needsWrite) {
@ -634,14 +621,10 @@
__block BOOL collectionFiltered = NO;
dispatch_sync(queue, ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
if (fetchedCollectionsFilter) {
collectionFiltered = ![fetchedCollectionsFilter isAllowed:collection];
}
#pragma clang diagnostic pop
}});
__block BOOL existsInDatabase = NO;
@ -657,8 +640,6 @@
__block BOOL needsWrite = NO;
dispatch_sync(queue, ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
// Check pendingObjectCache (NOT pendingMetadataCache) to determine row status.
@ -683,17 +664,12 @@
{
needsWrite = ((currentObjectBatch.count == 0) && (currentMetadataBatch.count == 0));
if (metadata) {
if (metadata)
[pendingMetadataCache setObject:metadata forKey:ck];
}
else {
else
[pendingMetadataCache setObject:[YapNull null] forKey:ck];
}
[currentMetadataBatch addObject:ck];
}
#pragma clang diagnostic pop
}});
if (needsWrite) {
@ -720,8 +696,6 @@
__block BOOL needsWrite = NO;
dispatch_sync(queue, ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
needsWrite = ((currentObjectBatch.count == 0) && (currentMetadataBatch.count == 0));
@ -730,8 +704,6 @@
[pendingMetadataCache setObject:[YapNull null] forKey:ck];
[currentMetadataBatch addObject:ck];
#pragma clang diagnostic pop
}});
if (needsWrite) {
@ -757,8 +729,6 @@
__block BOOL needsWrite = NO;
dispatch_sync(queue, ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
needsWrite = ((currentObjectBatch.count == 0) && (currentMetadataBatch.count == 0));
@ -772,8 +742,6 @@
[pendingMetadataCache setObject:[YapNull null] forKey:ck];
[currentMetadataBatch addObject:ck];
}
#pragma clang diagnostic pop
}});
if (needsWrite) {
@ -782,48 +750,34 @@
}
/**
* Tells the proxy to discard pending changes (if any) for the given <collection, key> tuple.
* Immediately discards all changes that were queued to written to the database.
* Thus the changes are not written to the database,
* and any currently queued readWriteTransaction is aborted.
*
* That is, IF the proxy has a pending change (for the tuple) that it intends to write to the database
* during the next flush, it will drop the pending change (and not write it to the database).
**/
- (void)resetObjectForKey:(NSString *)key inCollection:(nullable NSString *)collection
{
YapCollectionKey *ck = [[YapCollectionKey alloc] initWithCollection:collection key:key];
dispatch_sync(queue, ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
[pendingObjectCache removeObjectForKey:ck];
[currentObjectBatch removeObject:ck];
[pendingMetadataCache removeObjectForKey:ck];
[currentMetadataBatch removeObject:ck];
#pragma clang diagnostic pop
}});
}
/**
* Tells the proxy to discard ALL pending changes.
* This method is typically used if you intend to clear the database.
* E.g.:
*
* That is, IF the proxy has pending changes that it intends to write to the database
* during the next flush, it will instead drop all those pending changes (and not write any of them).
* [connectionProxy abortAndReset];
* [connectionProxy.readWriteTransaction readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction){
*
* [transaction removeAllObjectsInAllCollections];
* }];
**/
- (void)reset
- (void)abortAndReset:(YapWhitelistBlacklist *)filter
{
dispatch_sync(queue, ^{ @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
if ((currentObjectBatch.count > 0) && (currentMetadataBatch.count > 0))
{
abortAndResetCount++;
}
fetchedCollectionsFilter = filter;
[pendingObjectCache removeAllObjects];
[currentObjectBatch removeAllObjects];
[pendingMetadataCache removeAllObjects];
[currentMetadataBatch removeAllObjects];
#pragma clang diagnostic pop
}});
}
@ -857,7 +811,7 @@
__block YapWhitelistBlacklist *filter = nil;
dispatch_block_t block = ^{
filter = self->fetchedCollectionsFilter;
filter = fetchedCollectionsFilter;
};
if (dispatch_get_specific(IsOnQueueKey))
@ -871,7 +825,7 @@
- (void)setFetchedCollectionsFilter:(YapWhitelistBlacklist *)filter
{
dispatch_block_t block = ^{
self->fetchedCollectionsFilter = filter;
fetchedCollectionsFilter = filter;
};
if (dispatch_get_specific(IsOnQueueKey))
@ -880,14 +834,4 @@
dispatch_sync(queue, block);
}
/**
* DEPRECATED
**/
- (void)abortAndReset:(YapWhitelistBlacklist *)filter
{
self.fetchedCollectionsFilter = filter;
[self reset];
}
@end

View File

@ -68,6 +68,7 @@ static pid_t currentPid() {
}
- (void)dealloc {
NSLog(@"DEALLOC!");
[self stop];
}
@ -75,7 +76,8 @@ static pid_t currentPid() {
[self stop];
const char* name = [[self channel] cStringUsingEncoding:NSUTF8StringEncoding];
NSLog(@"register: %s", name);
__weak YapDatabaseCrossProcessNotification* wSelf = self;
notify_register_dispatch(name, &notifyToken, dispatch_get_main_queue(), ^(int token) {
@ -85,7 +87,7 @@ static pid_t currentPid() {
BOOL isExternal = fromPid != (uint64_t)currentPid();
if (isExternal)
{
YDBLogVerbose(@"received external modification from %llu", fromPid);
NSLog(@"received external modification from %llu", fromPid);
[[NSNotificationCenter defaultCenter] postNotificationName:YapDatabaseModifiedExternallyNotification object:[wSelf registeredDatabase]];
}

View File

@ -73,7 +73,7 @@
__block YapDatabaseViewFiltering *mostRecentFiltering = nil;
dispatch_block_t block = ^{
mostRecentFiltering = self->filtering;
mostRecentFiltering = filtering;
};
__strong YapDatabase *database = self.registeredDatabase;
@ -167,7 +167,7 @@
dispatch_block_t block = ^{
mostRecentFiltering = self->filtering;
mostRecentFiltering = filtering;
};
__strong YapDatabase *database = self.registeredDatabase;

View File

@ -67,7 +67,7 @@
InvokeFilterBlock = ^(NSString *group, int64_t __unused rowid, YapCollectionKey *ck){
return filterBlock(self->databaseTransaction, group, ck.collection, ck.key);
return filterBlock(databaseTransaction, group, ck.collection, ck.key);
};
}
else if (filtering->blockType == YapDatabaseBlockTypeWithObject)
@ -77,9 +77,9 @@
InvokeFilterBlock = ^(NSString *group, int64_t rowid, YapCollectionKey *ck){
id object = [self->databaseTransaction objectForCollectionKey:ck withRowid:rowid];
id object = [databaseTransaction objectForCollectionKey:ck withRowid:rowid];
return filterBlock(self->databaseTransaction, group, ck.collection, ck.key, object);
return filterBlock(databaseTransaction, group, ck.collection, ck.key, object);
};
}
else if (filtering->blockType == YapDatabaseBlockTypeWithMetadata)
@ -89,9 +89,9 @@
InvokeFilterBlock = ^(NSString *group, int64_t rowid, YapCollectionKey *ck){
id metadata = [self->databaseTransaction metadataForCollectionKey:ck withRowid:rowid];
id metadata = [databaseTransaction metadataForCollectionKey:ck withRowid:rowid];
return filterBlock(self->databaseTransaction, group, ck.collection, ck.key, metadata);
return filterBlock(databaseTransaction, group, ck.collection, ck.key, metadata);
};
}
else // if (filtering->blockType == YapDatabaseBlockTypeWithRow)
@ -103,9 +103,9 @@
id object = nil;
id metadata = nil;
[self->databaseTransaction getObject:&object metadata:&metadata forCollectionKey:ck withRowid:rowid];
[databaseTransaction getObject:&object metadata:&metadata forCollectionKey:ck withRowid:rowid];
return filterBlock(self->databaseTransaction, group, ck.collection, ck.key, object, metadata);
return filterBlock(databaseTransaction, group, ck.collection, ck.key, object, metadata);
};
}
@ -118,7 +118,7 @@
[parentViewTransaction enumerateRowidsInGroup:group
usingBlock:^(int64_t rowid, NSUInteger __unused parentIndex, BOOL __unused *stop)
{
YapCollectionKey *ck = [self->databaseTransaction collectionKeyForRowid:rowid];
YapCollectionKey *ck = [databaseTransaction collectionKeyForRowid:rowid];
if (InvokeFilterBlock(group, rowid, ck))
{
@ -168,8 +168,6 @@
// The changeset mechanism will automatically consolidate all changes to the minimum.
[self enumerateGroupsUsingBlock:^(NSString *group, BOOL __unused *outerStop) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
// We must add the changes in reverse order.
// Either that, or the change index of each item would have to be zero,
@ -186,8 +184,6 @@
}];
[parentConnection->changes addObject:[YapDatabaseViewSectionChange deleteGroup:group]];
#pragma clang diagnostic pop
}];
isRepopulate = YES;
@ -240,7 +236,7 @@
InvokeFilterBlock = ^(NSString *group, int64_t __unused rowid, YapCollectionKey *ck){
return filterBlock(self->databaseTransaction, group, ck.collection, ck.key);
return filterBlock(databaseTransaction, group, ck.collection, ck.key);
};
}
else if (filtering->blockType == YapDatabaseBlockTypeWithObject)
@ -250,9 +246,9 @@
InvokeFilterBlock = ^(NSString *group, int64_t rowid, YapCollectionKey *ck){
id object = [self->databaseTransaction objectForCollectionKey:ck withRowid:rowid];
id object = [databaseTransaction objectForCollectionKey:ck withRowid:rowid];
return filterBlock(self->databaseTransaction, group, ck.collection, ck.key, object);
return filterBlock(databaseTransaction, group, ck.collection, ck.key, object);
};
}
else if (filtering->blockType == YapDatabaseBlockTypeWithMetadata)
@ -262,9 +258,9 @@
InvokeFilterBlock = ^(NSString *group, int64_t rowid, YapCollectionKey *ck){
id metadata = [self->databaseTransaction metadataForCollectionKey:ck withRowid:rowid];
id metadata = [databaseTransaction metadataForCollectionKey:ck withRowid:rowid];
return filterBlock(self->databaseTransaction, group, ck.collection, ck.key, metadata);
return filterBlock(databaseTransaction, group, ck.collection, ck.key, metadata);
};
}
else // if (filtering->blockType == YapDatabaseBlockTypeWithRow)
@ -276,9 +272,9 @@
id object = nil;
id metadata = nil;
[self->databaseTransaction getObject:&object metadata:&metadata forCollectionKey:ck withRowid:rowid];
[databaseTransaction getObject:&object metadata:&metadata forCollectionKey:ck withRowid:rowid];
return filterBlock(self->databaseTransaction, group, ck.collection, ck.key, object, metadata);
return filterBlock(databaseTransaction, group, ck.collection, ck.key, object, metadata);
};
}
@ -300,9 +296,6 @@
[parentViewTransaction enumerateRowidsInGroup:group
usingBlock:^(int64_t rowid, NSUInteger __unused parentIndex, BOOL __unused *stop)
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
if (existing && ((existingRowid == rowid)))
{
// Shortcut #1
@ -382,8 +375,6 @@
// and is still not in our view (filtered).
}
}
#pragma clang diagnostic pop
}];
while (existing)
@ -447,7 +438,7 @@
InvokeFilterBlock = ^(NSString *group, int64_t __unused rowid, YapCollectionKey *ck){
return filterBlock(self->databaseTransaction, group, ck.collection, ck.key);
return filterBlock(databaseTransaction, group, ck.collection, ck.key);
};
}
else if (filtering->blockType == YapDatabaseBlockTypeWithObject)
@ -457,9 +448,9 @@
InvokeFilterBlock = ^(NSString *group, int64_t rowid, YapCollectionKey *ck){
id object = [self->databaseTransaction objectForCollectionKey:ck withRowid:rowid];
id object = [databaseTransaction objectForCollectionKey:ck withRowid:rowid];
return filterBlock(self->databaseTransaction, group, ck.collection, ck.key, object);
return filterBlock(databaseTransaction, group, ck.collection, ck.key, object);
};
}
else if (filtering->blockType == YapDatabaseBlockTypeWithMetadata)
@ -469,9 +460,9 @@
InvokeFilterBlock = ^(NSString *group, int64_t rowid, YapCollectionKey *ck){
id metadata = [self->databaseTransaction metadataForCollectionKey:ck withRowid:rowid];
id metadata = [databaseTransaction metadataForCollectionKey:ck withRowid:rowid];
return filterBlock(self->databaseTransaction, group, ck.collection, ck.key, metadata);
return filterBlock(databaseTransaction, group, ck.collection, ck.key, metadata);
};
}
else // if (filteringBlockType == YapDatabaseBlockTypeWithRow)
@ -483,9 +474,9 @@
id object = nil;
id metadata = nil;
[self->databaseTransaction getObject:&object metadata:&metadata forCollectionKey:ck withRowid:rowid];
[databaseTransaction getObject:&object metadata:&metadata forCollectionKey:ck withRowid:rowid];
return filterBlock(self->databaseTransaction, group, ck.collection, ck.key, object, metadata);
return filterBlock(databaseTransaction, group, ck.collection, ck.key, object, metadata);
};
}
@ -503,7 +494,7 @@
[parentViewTransaction enumerateRowidsInGroup:group
usingBlock:^(int64_t rowid, NSUInteger __unused parentIndex, BOOL __unused *stop)
{
YapCollectionKey *ck = [self->databaseTransaction collectionKeyForRowid:rowid];
YapCollectionKey *ck = [databaseTransaction collectionKeyForRowid:rowid];
if (InvokeFilterBlock(group, rowid, ck))
{
@ -1282,7 +1273,7 @@
if ([extDependencies containsObject:registeredName])
{
YapDatabaseExtensionTransaction *extTransaction = [self->databaseTransaction ext:extName];
YapDatabaseExtensionTransaction *extTransaction = [databaseTransaction ext:extName];
if ([extTransaction respondsToSelector:@selector(view:didRepopulateWithFlags:)])
{
@ -1345,7 +1336,7 @@
if ([extDependencies containsObject:registeredName])
{
YapDatabaseExtensionTransaction *extTransaction = [self->databaseTransaction ext:extName];
YapDatabaseExtensionTransaction *extTransaction = [databaseTransaction ext:extName];
if ([extTransaction respondsToSelector:@selector(view:didRepopulateWithFlags:)])
{

View File

@ -1,8 +1,6 @@
#import <Foundation/Foundation.h>
#import "YapDatabaseExtensionTypes.h"
@class YapDatabaseReadTransaction;
NS_ASSUME_NONNULL_BEGIN
/**
@ -24,16 +22,16 @@ NS_ASSUME_NONNULL_BEGIN
typedef id YapDatabaseFullTextSearchBlock; // One of YapDatabaseFullTextSearchXBlock types
typedef void (^YapDatabaseFullTextSearchWithKeyBlock)
(YapDatabaseReadTransaction *transaction, NSMutableDictionary *dict, NSString *collection, NSString *key);
(NSMutableDictionary *dict, NSString *collection, NSString *key);
typedef void (^YapDatabaseFullTextSearchWithObjectBlock)
(YapDatabaseReadTransaction *transaction, NSMutableDictionary *dict, NSString *collection, NSString *key, id object);
(NSMutableDictionary *dict, NSString *collection, NSString *key, id object);
typedef void (^YapDatabaseFullTextSearchWithMetadataBlock)
(YapDatabaseReadTransaction *transaction, NSMutableDictionary *dict, NSString *collection, NSString *key, __nullable id metadata);
(NSMutableDictionary *dict, NSString *collection, NSString *key, __nullable id metadata);
typedef void (^YapDatabaseFullTextSearchWithRowBlock)
(YapDatabaseReadTransaction *transaction, NSMutableDictionary *dict, NSString *collection, NSString *key, id object, __nullable id metadata);
(NSMutableDictionary *dict, NSString *collection, NSString *key, id object, __nullable id metadata);
+ (instancetype)withKeyBlock:(YapDatabaseFullTextSearchWithKeyBlock)block;
+ (instancetype)withObjectBlock:(YapDatabaseFullTextSearchWithObjectBlock)block;

View File

@ -36,13 +36,13 @@ NS_ASSUME_NONNULL_BEGIN
usingBlock:(void (^)(NSString *collection, NSString *key, BOOL *stop))block;
- (void)enumerateKeysAndMetadataMatching:(NSString *)query
usingBlock:(void (^)(NSString *collection, NSString *key, __nullable id metadata, BOOL *stop))block;
usingBlock:(void (^)(NSString *collection, NSString *key, id metadata, BOOL *stop))block;
- (void)enumerateKeysAndObjectsMatching:(NSString *)query
usingBlock:(void (^)(NSString *collection, NSString *key, id object, BOOL *stop))block;
- (void)enumerateRowsMatching:(NSString *)query
usingBlock:(void (^)(NSString *collection, NSString *key, id object, __nullable id metadata, BOOL *stop))block;
usingBlock:(void (^)(NSString *collection, NSString *key, id object, id metadata, BOOL *stop))block;
// FTS5 bm25 ordering
@ -52,7 +52,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)enumerateBm25OrderedKeysAndMetadataMatching:(NSString *)query
withWeights:(nullable NSArray<NSNumber *> *)weights
usingBlock:(void (^)(NSString *collection, NSString *key, __nullable id metadata, BOOL *stop))block;
usingBlock:(void (^)(NSString *collection, NSString *key, id metadata, BOOL *stop))block;
- (void)enumerateBm25OrderedKeysAndObjectsMatching:(NSString *)query
withWeights:(nullable NSArray<NSNumber *> *)weights
@ -60,7 +60,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)enumerateBm25OrderedRowsMatching:(NSString *)query
withWeights:(nullable NSArray<NSNumber *> *)weights
usingBlock:(void (^)(NSString *collection, NSString *key, id object, __nullable id metadata, BOOL *stop))block;
usingBlock:(void (^)(NSString *collection, NSString *key, id object, id metadata, BOOL *stop))block;
// Query matching + Snippets
@ -72,7 +72,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)enumerateKeysAndMetadataMatching:(NSString *)query
withSnippetOptions:(nullable YapDatabaseFullTextSearchSnippetOptions *)options
usingBlock:
(void (^)(NSString *snippet, NSString *collection, NSString *key, __nullable id metadata, BOOL *stop))block;
(void (^)(NSString *snippet, NSString *collection, NSString *key, id metadata, BOOL *stop))block;
- (void)enumerateKeysAndObjectsMatching:(NSString *)query
withSnippetOptions:(nullable YapDatabaseFullTextSearchSnippetOptions *)options
@ -82,7 +82,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)enumerateRowsMatching:(NSString *)query
withSnippetOptions:(nullable YapDatabaseFullTextSearchSnippetOptions *)options
usingBlock:
(void (^)(NSString *snippet, NSString *collection, NSString *key, id object, __nullable id metadata, BOOL *stop))block;
(void (^)(NSString *snippet, NSString *collection, NSString *key, id object, id metadata, BOOL *stop))block;
@end

View File

@ -108,7 +108,6 @@ static NSString *const ext_key__version_deprecated = @"version";
if (![self populate]) return NO;
[self setStringValue:versionTag forExtensionKey:ext_key__versionTag persistent:YES];
[self setStringValue:ftsVersion forExtensionKey:ext_key__ftsVersion persistent:YES];
if (hasOldVersion_deprecated)
[self removeValueForExtensionKey:ext_key__version_deprecated persistent:YES];
@ -244,20 +243,15 @@ static NSString *const ext_key__version_deprecated = @"version";
(YapDatabaseFullTextSearchWithKeyBlock)handler->block;
[databaseTransaction _enumerateKeysInAllCollectionsUsingBlock:
^(int64_t rowid, NSString *collection, NSString *key, BOOL __unused *stop)
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
^(int64_t rowid, NSString *collection, NSString *key, BOOL __unused *stop) {
block(databaseTransaction, parentConnection->blockDict, collection, key);
block(parentConnection->blockDict, collection, key);
if ([parentConnection->blockDict count] > 0)
{
[self addRowid:rowid isNew:YES];
[parentConnection->blockDict removeAllObjects];
}
#pragma clang diagnostic pop
}];
}
else if (handler->blockType == YapDatabaseBlockTypeWithObject)
@ -266,20 +260,15 @@ static NSString *const ext_key__version_deprecated = @"version";
(YapDatabaseFullTextSearchWithObjectBlock)handler->block;
[databaseTransaction _enumerateKeysAndObjectsInAllCollectionsUsingBlock:
^(int64_t rowid, NSString *collection, NSString *key, id object, BOOL __unused *stop)
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
^(int64_t rowid, NSString *collection, NSString *key, id object, BOOL __unused *stop) {
block(databaseTransaction, parentConnection->blockDict, collection, key, object);
block(parentConnection->blockDict, collection, key, object);
if ([parentConnection->blockDict count] > 0)
{
[self addRowid:rowid isNew:YES];
[parentConnection->blockDict removeAllObjects];
}
#pragma clang diagnostic pop
}];
}
else if (handler->blockType == YapDatabaseBlockTypeWithMetadata)
@ -288,20 +277,15 @@ static NSString *const ext_key__version_deprecated = @"version";
(YapDatabaseFullTextSearchWithMetadataBlock)handler->block;
[databaseTransaction _enumerateKeysAndMetadataInAllCollectionsUsingBlock:
^(int64_t rowid, NSString *collection, NSString *key, id metadata, BOOL __unused *stop)
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
^(int64_t rowid, NSString *collection, NSString *key, id metadata, BOOL __unused *stop) {
block(databaseTransaction, parentConnection->blockDict, collection, key, metadata);
block(parentConnection->blockDict, collection, key, metadata);
if ([parentConnection->blockDict count] > 0)
{
[self addRowid:rowid isNew:YES];
[parentConnection->blockDict removeAllObjects];
}
#pragma clang diagnostic pop
}];
}
else // if (handler->blockType == YapDatabaseBlockTypeWithRow)
@ -310,20 +294,15 @@ static NSString *const ext_key__version_deprecated = @"version";
(YapDatabaseFullTextSearchWithRowBlock)handler->block;
[databaseTransaction _enumerateRowsInAllCollectionsUsingBlock:
^(int64_t rowid, NSString *collection, NSString *key, id object, id metadata, BOOL __unused *stop)
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
^(int64_t rowid, NSString *collection, NSString *key, id object, id metadata, BOOL __unused *stop) {
block(databaseTransaction, parentConnection->blockDict, collection, key, object, metadata);
block(parentConnection->blockDict, collection, key, object, metadata);
if ([parentConnection->blockDict count] > 0)
{
[self addRowid:rowid isNew:YES];
[parentConnection->blockDict removeAllObjects];
}
#pragma clang diagnostic pop
}];
}
@ -593,28 +572,28 @@ static NSString *const ext_key__version_deprecated = @"version";
__unsafe_unretained YapDatabaseFullTextSearchWithKeyBlock block =
(YapDatabaseFullTextSearchWithKeyBlock)handler->block;
block(databaseTransaction, parentConnection->blockDict, collection, key);
block(parentConnection->blockDict, collection, key);
}
else if (handler->blockType == YapDatabaseBlockTypeWithObject)
{
__unsafe_unretained YapDatabaseFullTextSearchWithObjectBlock block =
(YapDatabaseFullTextSearchWithObjectBlock)handler->block;
block(databaseTransaction, parentConnection->blockDict, collection, key, object);
block(parentConnection->blockDict, collection, key, object);
}
else if (handler->blockType == YapDatabaseBlockTypeWithMetadata)
{
__unsafe_unretained YapDatabaseFullTextSearchWithMetadataBlock block =
(YapDatabaseFullTextSearchWithMetadataBlock)handler->block;
block(databaseTransaction, parentConnection->blockDict, collection, key, metadata);
block(parentConnection->blockDict, collection, key, metadata);
}
else
{
__unsafe_unretained YapDatabaseFullTextSearchWithRowBlock block =
(YapDatabaseFullTextSearchWithRowBlock)handler->block;
block(databaseTransaction, parentConnection->blockDict, collection, key, object, metadata);
block(parentConnection->blockDict, collection, key, object, metadata);
}
if ([parentConnection->blockDict count] == 0)
@ -934,7 +913,7 @@ static NSString *const ext_key__version_deprecated = @"version";
{
[self enumerateRowidsMatching:query usingBlock:^(int64_t rowid, BOOL *stop) {
YapCollectionKey *ck = [self->databaseTransaction collectionKeyForRowid:rowid];
YapCollectionKey *ck = [databaseTransaction collectionKeyForRowid:rowid];
block(ck.collection, ck.key, stop);
}];
@ -947,7 +926,7 @@ static NSString *const ext_key__version_deprecated = @"version";
YapCollectionKey *ck = nil;
id metadata = nil;
[self->databaseTransaction getCollectionKey:&ck metadata:&metadata forRowid:rowid];
[databaseTransaction getCollectionKey:&ck metadata:&metadata forRowid:rowid];
block(ck.collection, ck.key, metadata, stop);
}];
@ -960,7 +939,7 @@ static NSString *const ext_key__version_deprecated = @"version";
YapCollectionKey *ck = nil;
id object = nil;
[self->databaseTransaction getCollectionKey:&ck object:&object forRowid:rowid];
[databaseTransaction getCollectionKey:&ck object:&object forRowid:rowid];
block(ck.collection, ck.key, object, stop);
}];
@ -974,7 +953,7 @@ static NSString *const ext_key__version_deprecated = @"version";
YapCollectionKey *ck = nil;
id object = nil;
id metadata = nil;
[self->databaseTransaction getCollectionKey:&ck object:&object metadata:&metadata forRowid:rowid];
[databaseTransaction getCollectionKey:&ck object:&object metadata:&metadata forRowid:rowid];
block(ck.collection, ck.key, object, metadata, stop);
}];
@ -1047,7 +1026,7 @@ static NSString *const ext_key__version_deprecated = @"version";
usingBlock:(void (^)(NSString *collection, NSString *key, BOOL *stop))block {
[self enumerateBm25OrderedRowidsMatching:query withWeights:weights usingBlock:^(int64_t rowid, BOOL *stop) {
YapCollectionKey *ck = [self->databaseTransaction collectionKeyForRowid:rowid];
YapCollectionKey *ck = [databaseTransaction collectionKeyForRowid:rowid];
block(ck.collection, ck.key, stop);
}];
@ -1060,7 +1039,7 @@ static NSString *const ext_key__version_deprecated = @"version";
YapCollectionKey *ck = nil;
id metadata = nil;
[self->databaseTransaction getCollectionKey:&ck metadata:&metadata forRowid:rowid];
[databaseTransaction getCollectionKey:&ck metadata:&metadata forRowid:rowid];
block(ck.collection, ck.key, metadata, stop);
}];
@ -1073,7 +1052,7 @@ static NSString *const ext_key__version_deprecated = @"version";
YapCollectionKey *ck = nil;
id object = nil;
[self->databaseTransaction getCollectionKey:&ck object:&object forRowid:rowid];
[databaseTransaction getCollectionKey:&ck object:&object forRowid:rowid];
block(ck.collection, ck.key, object, stop);
}];
@ -1087,7 +1066,7 @@ static NSString *const ext_key__version_deprecated = @"version";
YapCollectionKey *ck = nil;
id object = nil;
id metadata = nil;
[self->databaseTransaction getCollectionKey:&ck object:&object metadata:&metadata forRowid:rowid];
[databaseTransaction getCollectionKey:&ck object:&object metadata:&metadata forRowid:rowid];
block(ck.collection, ck.key, object, metadata, stop);
}];
@ -1201,7 +1180,7 @@ static NSString *const ext_key__version_deprecated = @"version";
withSnippetOptions:options
usingBlock:^(NSString *snippet, int64_t rowid, BOOL *stop)
{
YapCollectionKey *ck = [self->databaseTransaction collectionKeyForRowid:rowid];
YapCollectionKey *ck = [databaseTransaction collectionKeyForRowid:rowid];
block(snippet, ck.collection, ck.key, stop);
}];
@ -1218,7 +1197,7 @@ static NSString *const ext_key__version_deprecated = @"version";
{
YapCollectionKey *ck = nil;
id metadata = nil;
[self->databaseTransaction getCollectionKey:&ck metadata:&metadata forRowid:rowid];
[databaseTransaction getCollectionKey:&ck metadata:&metadata forRowid:rowid];
block(snippet, ck.collection, ck.key, metadata, stop);
}];
@ -1235,7 +1214,7 @@ static NSString *const ext_key__version_deprecated = @"version";
{
YapCollectionKey *ck = nil;
id object = nil;
[self->databaseTransaction getCollectionKey:&ck object:&object forRowid:rowid];
[databaseTransaction getCollectionKey:&ck object:&object forRowid:rowid];
block(snippet, ck.collection, ck.key, object, stop);
}];
@ -1253,7 +1232,7 @@ static NSString *const ext_key__version_deprecated = @"version";
YapCollectionKey *ck = nil;
id object = nil;
id metadata = nil;
[self->databaseTransaction getCollectionKey:&ck object:&object metadata:&metadata forRowid:rowid];
[databaseTransaction getCollectionKey:&ck object:&object metadata:&metadata forRowid:rowid];
block(snippet, ck.collection, ck.key, object, metadata, stop);
}];

View File

@ -99,7 +99,7 @@ static const int ydbLogLevel = YDB_LOG_LEVEL_WARN;
dispatch_block_t block = ^{
result = (self->queryCache == nil) ? NO : YES;
result = (queryCache == nil) ? NO : YES;
};
if (dispatch_get_specific(databaseConnection->IsOnConnectionQueueKey))
@ -116,16 +116,16 @@ static const int ydbLogLevel = YDB_LOG_LEVEL_WARN;
if (queryCacheEnabled)
{
if (self->queryCache == nil)
if (queryCache == nil)
{
self->queryCache = [[YapCache alloc] initWithCountLimit:self->queryCacheLimit];
self->queryCache.allowedKeyClasses = [NSSet setWithObject:[NSString class]];
self->queryCache.allowedObjectClasses = [NSSet setWithObject:[YapDatabaseStatement class]];
queryCache = [[YapCache alloc] initWithCountLimit:queryCacheLimit];
queryCache.allowedKeyClasses = [NSSet setWithObject:[NSString class]];
queryCache.allowedObjectClasses = [NSSet setWithObject:[YapDatabaseStatement class]];
}
}
else
{
self->queryCache = nil;
queryCache = nil;
}
};
@ -141,7 +141,7 @@ static const int ydbLogLevel = YDB_LOG_LEVEL_WARN;
dispatch_block_t block = ^{
result = self->queryCacheLimit;
result = queryCacheLimit;
};
if (dispatch_get_specific(databaseConnection->IsOnConnectionQueueKey))
@ -156,8 +156,8 @@ static const int ydbLogLevel = YDB_LOG_LEVEL_WARN;
{
dispatch_block_t block = ^{
self->queryCacheLimit = newQueryCacheLimit;
self->queryCache.countLimit = self->queryCacheLimit;
queryCacheLimit = newQueryCacheLimit;
queryCache.countLimit = queryCacheLimit;
};
if (dispatch_get_specific(databaseConnection->IsOnConnectionQueueKey))

View File

@ -245,9 +245,6 @@ static NSString *const ext_key_version_deprecated = @"version";
**/
- (BOOL)populate
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
// Remove everything from the database
[self removeAllRowids];
@ -391,8 +388,6 @@ static NSString *const ext_key_version_deprecated = @"version";
}
return YES;
#pragma clang diagnostic pop
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -1118,7 +1113,7 @@ static NSString *const ext_key_version_deprecated = @"version";
BOOL result = [self _enumerateRowidsMatchingQuery:query usingBlock:^(int64_t rowid, BOOL *stop) {
YapCollectionKey *ck = [self->databaseTransaction collectionKeyForRowid:rowid];
YapCollectionKey *ck = [databaseTransaction collectionKeyForRowid:rowid];
block(ck.collection, ck.key, stop);
}];
@ -1137,7 +1132,7 @@ static NSString *const ext_key_version_deprecated = @"version";
YapCollectionKey *ck = nil;
id metadata = nil;
[self->databaseTransaction getCollectionKey:&ck metadata:&metadata forRowid:rowid];
[databaseTransaction getCollectionKey:&ck metadata:&metadata forRowid:rowid];
block(ck.collection, ck.key, metadata, stop);
}];
@ -1156,7 +1151,7 @@ static NSString *const ext_key_version_deprecated = @"version";
YapCollectionKey *ck = nil;
id object = nil;
[self->databaseTransaction getCollectionKey:&ck object:&object forRowid:rowid];
[databaseTransaction getCollectionKey:&ck object:&object forRowid:rowid];
block(ck.collection, ck.key, object, stop);
}];
@ -1176,7 +1171,7 @@ static NSString *const ext_key_version_deprecated = @"version";
YapCollectionKey *ck = nil;
id object = nil;
id metadata = nil;
[self->databaseTransaction getCollectionKey:&ck object:&object metadata:&metadata forRowid:rowid];
[databaseTransaction getCollectionKey:&ck object:&object metadata:&metadata forRowid:rowid];
block(ck.collection, ck.key, object, metadata, stop);
}];

View File

@ -118,7 +118,7 @@ static NSString *const changeset_key_reset = @"reset";
- (sqlite3_stmt *)enumerateDstFileURLWithSrcStatement:(BOOL *)needsFinalizePtr;
- (sqlite3_stmt *)enumerateDstFileURLWithSrcNameStatement:(BOOL *)needsFinalizePtr;
- (sqlite3_stmt *)enumerateDstFileURLWithNameStatement:(BOOL *)needsFinalizePtr;
- (sqlite3_stmt *)enumerateDstFileURLExcludingSrcStatement:(BOOL *)needsFinalizePtr;
- (sqlite3_stmt *)enumerateDstFileURLWithNameExcludingSrcStatement:(BOOL *)needsFinalizePtr;
- (sqlite3_stmt *)enumerateAllDstFileURLStatement:(BOOL *)needsFinalizePtr;
- (sqlite3_stmt *)enumerateForSrcStatement:(BOOL *)needsFinalizePtr;
- (sqlite3_stmt *)enumerateForDstStatement:(BOOL *)needsFinalizePtr;
@ -127,8 +127,8 @@ static NSString *const changeset_key_reset = @"reset";
- (sqlite3_stmt *)enumerateForNameStatement:(BOOL *)needsFinalizePtr;
- (sqlite3_stmt *)enumerateForSrcDstStatement:(BOOL *)needsFinalizePtr;
- (sqlite3_stmt *)enumerateForSrcDstNameStatement:(BOOL *)needsFinalizePtr;
- (sqlite3_stmt *)countForSrcExcludingDstStatement;
- (sqlite3_stmt *)countForDstExcludingSrcStatement;
- (sqlite3_stmt *)countForSrcNameExcludingDstStatement;
- (sqlite3_stmt *)countForDstNameExcludingSrcStatement;
- (sqlite3_stmt *)countForNameStatement;
- (sqlite3_stmt *)countForSrcStatement;
- (sqlite3_stmt *)countForSrcNameStatement;

View File

@ -36,7 +36,7 @@
sqlite3_stmt *enumerateDstFileURLWithSrcStatement;
sqlite3_stmt *enumerateDstFileURLWithSrcNameStatement;
sqlite3_stmt *enumerateDstFileURLWithNameStatement;
sqlite3_stmt *enumerateDstFileURLExcludingSrcStatement;
sqlite3_stmt *enumerateDstFileURLWithNameExcludingSrcStatement;
sqlite3_stmt *enumerateAllDstFileURLStatement;
sqlite3_stmt *enumerateForSrcStatement;
sqlite3_stmt *enumerateForDstStatement;
@ -52,8 +52,8 @@
sqlite3_stmt *countForNameStatement;
sqlite3_stmt *countForSrcDstStatement;
sqlite3_stmt *countForSrcDstNameStatement;
sqlite3_stmt *countForSrcExcludingDstStatement;
sqlite3_stmt *countForDstExcludingSrcStatement;
sqlite3_stmt *countForSrcNameExcludingDstStatement;
sqlite3_stmt *countForDstNameExcludingSrcStatement;
sqlite3_stmt *removeAllStatement;
sqlite3_stmt *removeAllProtocolStatement;
}
@ -93,7 +93,7 @@
sqlite_finalize_null(&enumerateDstFileURLWithSrcStatement);
sqlite_finalize_null(&enumerateDstFileURLWithSrcNameStatement);
sqlite_finalize_null(&enumerateDstFileURLWithNameStatement);
sqlite_finalize_null(&enumerateDstFileURLExcludingSrcStatement);
sqlite_finalize_null(&enumerateDstFileURLWithNameExcludingSrcStatement);
sqlite_finalize_null(&enumerateAllDstFileURLStatement);
sqlite_finalize_null(&enumerateForSrcStatement);
sqlite_finalize_null(&enumerateForDstStatement);
@ -109,8 +109,8 @@
sqlite_finalize_null(&countForNameStatement);
sqlite_finalize_null(&countForSrcDstStatement);
sqlite_finalize_null(&countForSrcDstNameStatement);
sqlite_finalize_null(&countForSrcExcludingDstStatement);
sqlite_finalize_null(&countForDstExcludingSrcStatement);
sqlite_finalize_null(&countForSrcNameExcludingDstStatement);
sqlite_finalize_null(&countForDstNameExcludingSrcStatement);
sqlite_finalize_null(&removeAllStatement);
sqlite_finalize_null(&removeAllProtocolStatement);
}
@ -515,7 +515,7 @@
NSString *string = [NSString stringWithFormat:
@"SELECT \"rowid\", \"name\", \"dst\", \"rules\", \"manual\" FROM \"%@\""
@" WHERE \"dst\" > %lld AND \"src\" = ?;",
[self->parent tableName], INT64_MAX];
[parent tableName], INT64_MAX];
sqlite3_stmt *stmt = NULL;
[self prepareStatement:&stmt withString:string caller:_cmd];
@ -568,7 +568,7 @@
NSString *string = [NSString stringWithFormat:
@"SELECT \"rowid\", \"dst\", \"rules\", \"manual\" FROM \"%@\""
@" WHERE \"dst\" > %lld AND \"src\" = ? AND \"name\" = ?;",
[self->parent tableName], INT64_MAX];
[parent tableName], INT64_MAX];
sqlite3_stmt *stmt = NULL;
[self prepareStatement:&stmt withString:string caller:_cmd];
@ -621,7 +621,7 @@
NSString *string = [NSString stringWithFormat:
@"SELECT \"rowid\", \"src\", \"dst\", \"rules\", \"manual\" FROM \"%@\""
@" WHERE \"dst\" > %lld AND \"name\" = ?;",
[self->parent tableName], INT64_MAX];
[parent tableName], INT64_MAX];
sqlite3_stmt *stmt = NULL;
[self prepareStatement:&stmt withString:string caller:_cmd];
@ -651,9 +651,9 @@
return result;
}
- (sqlite3_stmt *)enumerateDstFileURLExcludingSrcStatement:(BOOL *)needsFinalizePtr
- (sqlite3_stmt *)enumerateDstFileURLWithNameExcludingSrcStatement:(BOOL *)needsFinalizePtr
{
sqlite3_stmt **statement = &enumerateDstFileURLExcludingSrcStatement;
sqlite3_stmt **statement = &enumerateDstFileURLWithNameExcludingSrcStatement;
sqlite3_stmt* (^CreateStatement)(void) = ^{
@ -672,9 +672,9 @@
// For more information, see the documentation: http://www.sqlite.org/datatype3.html
NSString *string = [NSString stringWithFormat:
@"SELECT \"rowid\", \"name\", \"src\", \"dst\", \"rules\", \"manual\" FROM \"%@\""
@" WHERE \"dst\" > %lld AND \"src\" != ?;",
[self->parent tableName], INT64_MAX];
@"SELECT \"rowid\", \"src\", \"dst\", \"rules\", \"manual\" FROM \"%@\""
@" WHERE \"dst\" > %lld AND \"src\" != ? AND \"name\" = ?;",
[parent tableName], INT64_MAX];
sqlite3_stmt *stmt = NULL;
[self prepareStatement:&stmt withString:string caller:_cmd];
@ -726,7 +726,7 @@
NSString *string = [NSString stringWithFormat:
@"SELECT \"rowid\", \"name\", \"src\", \"dst\", \"rules\", \"manual\" FROM \"%@\" WHERE \"dst\" > %lld;",
[self->parent tableName], INT64_MAX];
[parent tableName], INT64_MAX];
sqlite3_stmt *stmt = NULL;
[self prepareStatement:&stmt withString:string caller:_cmd];
@ -764,7 +764,7 @@
NSString *string = [NSString stringWithFormat:
@"SELECT \"rowid\", \"name\", \"dst\", \"rules\", \"manual\" FROM \"%@\" WHERE \"src\" = ?;",
[self->parent tableName]];
[parent tableName]];
sqlite3_stmt *stmt = NULL;
[self prepareStatement:&stmt withString:string caller:_cmd];
@ -802,7 +802,7 @@
NSString *string = [NSString stringWithFormat:
@"SELECT \"rowid\", \"name\", \"src\", \"rules\", \"manual\" FROM \"%@\" WHERE \"dst\" = ?;",
[self->parent tableName]];
[parent tableName]];
sqlite3_stmt *stmt = NULL;
[self prepareStatement:&stmt withString:string caller:_cmd];
@ -840,7 +840,7 @@
NSString *string = [NSString stringWithFormat:
@"SELECT \"rowid\", \"dst\", \"rules\", \"manual\" FROM \"%@\" WHERE \"src\" = ? AND \"name\" = ?;",
[self->parent tableName]];
[parent tableName]];
sqlite3_stmt *stmt = NULL;
[self prepareStatement:&stmt withString:string caller:_cmd];
@ -878,7 +878,7 @@
NSString *string = [NSString stringWithFormat:
@"SELECT \"rowid\", \"src\", \"rules\", \"manual\" FROM \"%@\" WHERE \"dst\" = ? AND \"name\" = ?;",
[self->parent tableName]];
[parent tableName]];
sqlite3_stmt *stmt = NULL;
[self prepareStatement:&stmt withString:string caller:_cmd];
@ -916,7 +916,7 @@
NSString *string = [NSString stringWithFormat:
@"SELECT \"rowid\", \"src\", \"dst\", \"rules\", \"manual\" FROM \"%@\" WHERE \"name\" = ?;",
[self->parent tableName]];
[parent tableName]];
sqlite3_stmt *stmt = NULL;
[self prepareStatement:&stmt withString:string caller:_cmd];
@ -954,7 +954,7 @@
NSString *string = [NSString stringWithFormat:
@"SELECT \"rowid\", \"name\", \"rules\", \"manual\" FROM \"%@\" WHERE \"src\" = ? AND \"dst\" = ?;",
[self->parent tableName]];
[parent tableName]];
sqlite3_stmt *stmt = NULL;
[self prepareStatement:&stmt withString:string caller:_cmd];
@ -992,7 +992,7 @@
NSString *string = [NSString stringWithFormat:
@"SELECT \"rowid\", \"rules\", \"manual\" FROM \"%@\" WHERE \"src\" = ? AND \"dst\" = ? AND \"name\" = ?;",
[self->parent tableName]];
[parent tableName]];
sqlite3_stmt *stmt = NULL;
[self prepareStatement:&stmt withString:string caller:_cmd];
@ -1022,13 +1022,13 @@
return result;
}
- (sqlite3_stmt *)countForSrcExcludingDstStatement
- (sqlite3_stmt *)countForSrcNameExcludingDstStatement
{
sqlite3_stmt **statement = &countForSrcExcludingDstStatement;
sqlite3_stmt **statement = &countForSrcNameExcludingDstStatement;
if (*statement == NULL)
{
NSString *string = [NSString stringWithFormat:
@"SELECT COUNT(*) AS NumberOfRows FROM \"%@\" WHERE \"src\" = ? AND \"dst\" != ?;",
@"SELECT COUNT(*) AS NumberOfRows FROM \"%@\" WHERE \"src\" = ? AND \"dst\" != ? AND \"name\" = ?;",
[parent tableName]];
[self prepareStatement:statement withString:string caller:_cmd];
@ -1037,13 +1037,13 @@
return *statement;
}
- (sqlite3_stmt *)countForDstExcludingSrcStatement
- (sqlite3_stmt *)countForDstNameExcludingSrcStatement
{
sqlite3_stmt **statement = &countForDstExcludingSrcStatement;
sqlite3_stmt **statement = &countForDstNameExcludingSrcStatement;
if (*statement == NULL)
{
NSString *string = [NSString stringWithFormat:
@"SELECT COUNT(*) AS NumberOfRows FROM \"%@\" WHERE \"dst\" = ? AND \"src\" != ?;",
@"SELECT COUNT(*) AS NumberOfRows FROM \"%@\" WHERE \"dst\" = ? AND \"src\" != ? AND \"name\" = ?;",
[parent tableName]];
[self prepareStatement:statement withString:string caller:_cmd];

View File

@ -528,7 +528,7 @@ NS_INLINE BOOL URLMatchesURL(NSURL *url1, NSURL *url2)
[edges addObject:cleanEdge];
}
[self->parentConnection->protocolChanges setObject:edges forKey:@(rowid)];
[parentConnection->protocolChanges setObject:edges forKey:@(rowid)];
}
};
@ -541,7 +541,7 @@ NS_INLINE BOOL URLMatchesURL(NSURL *url1, NSURL *url2)
if ([allowedCollections isAllowed:collection])
{
[self->databaseTransaction _enumerateKeysAndObjectsInCollection:collection usingBlock:
[databaseTransaction _enumerateKeysAndObjectsInCollection:collection usingBlock:
^(int64_t rowid, NSString *key, id object, BOOL __unused *innerStop)
{
ProcessRow(rowid, collection, key, object);
@ -1983,26 +1983,29 @@ NS_INLINE BOOL URLMatchesURL(NSURL *url1, NSURL *url2)
}
/**
* Queries the database for the number of edges matching the given source.
* Queries the database for the number of edges matching the given source and name.
* This method only queries the database, and doesn't inspect anything in memory.
**/
- (int64_t)edgeCountWithSource:(int64_t)srcRowid
excludingDestination:(int64_t)dstRowid
- (int64_t)edgeCountWithSource:(int64_t)srcRowid name:(NSString *)name excludingDestination:(int64_t)dstRowid
{
sqlite3_stmt *statement = [parentConnection countForSrcExcludingDstStatement];
sqlite3_stmt *statement = [parentConnection countForSrcNameExcludingDstStatement];
if (statement == NULL) return 0;
int64_t count = 0;
// SELECT COUNT(*) AS NumberOfRows FROM "tableName" WHERE "src" = ? AND "dst" != ?;
// SELECT COUNT(*) AS NumberOfRows FROM "tableName" WHERE "src" = ? AND "dst" != ? AND "name" = ?;
int const column_idx_count = SQLITE_COLUMN_START;
int const bind_idx_src = SQLITE_BIND_START + 0;
int const bind_idx_dst = SQLITE_BIND_START + 1;
int const bind_idx_name = SQLITE_BIND_START + 2;
sqlite3_bind_int64(statement, bind_idx_src, srcRowid);
sqlite3_bind_int64(statement, bind_idx_dst, dstRowid);
YapDatabaseString _name; MakeYapDatabaseString(&_name, name);
sqlite3_bind_text(statement, bind_idx_name, _name.str, _name.length, SQLITE_STATIC);
int status = sqlite3_step(statement);
if (status == SQLITE_ROW)
{
@ -2016,31 +2019,37 @@ NS_INLINE BOOL URLMatchesURL(NSURL *url1, NSURL *url2)
sqlite3_clear_bindings(statement);
sqlite3_reset(statement);
FreeYapDatabaseString(&_name);
return count;
}
/**
* Queries the database for the number of edges matching the given destination.
* Queries the database for the number of edges matching the given destination and name.
* This method only queries the database, and doesn't inspect anything in memory.
**/
- (int64_t)edgeCountWithDestination:(int64_t)dstRowid
excludingSource:(int64_t)srcRowid
- (int64_t)edgeCountWithDestination:(int64_t)dstRowid name:(NSString *)name excludingSource:(int64_t)srcRowid
{
sqlite3_stmt *statement = [parentConnection countForDstExcludingSrcStatement];
NSAssert(name != nil, @"Internal logic error");
sqlite3_stmt *statement = [parentConnection countForDstNameExcludingSrcStatement];
if (statement == NULL) return 0;
int64_t count = 0;
// SELECT COUNT(*) AS NumberOfRows FROM "tableName" WHERE "dst" = ? AND "src" != ?;
// SELECT COUNT(*) AS NumberOfRows FROM "tableName" WHERE "dst" = ? AND "src" != ? AND "name" = ?;
int const column_idx_count = SQLITE_COLUMN_START;
int const bind_idx_dst = SQLITE_BIND_START + 0;
int const bind_idx_src = SQLITE_BIND_START + 1;
int const bind_idx_name = SQLITE_BIND_START + 2;
sqlite3_bind_int64(statement, bind_idx_dst, dstRowid);
sqlite3_bind_int64(statement, bind_idx_src, srcRowid);
YapDatabaseString _name; MakeYapDatabaseString(&_name, name);
sqlite3_bind_text(statement, bind_idx_name, _name.str, _name.length, SQLITE_STATIC);
int status = sqlite3_step(statement);
if (status == SQLITE_ROW)
{
@ -2054,6 +2063,7 @@ NS_INLINE BOOL URLMatchesURL(NSURL *url1, NSURL *url2)
sqlite3_clear_bindings(statement);
sqlite3_reset(statement);
FreeYapDatabaseString(&_name);
return count;
}
@ -2063,32 +2073,37 @@ NS_INLINE BOOL URLMatchesURL(NSURL *url1, NSURL *url2)
* This method only queries the database, and doesn't inspect anything in memory.
**/
- (int64_t)edgeCountWithDestinationFileURL:(NSURL *)dstFileURL
name:(NSString *)name
excludingSource:(int64_t)exclSrcRowid
{
NSAssert(dstFileURL != nil, @"Internal logic error");
NSAssert(name != nil, @"Internal logic error");
BOOL needsFinalize;
sqlite3_stmt *statement = [parentConnection enumerateDstFileURLExcludingSrcStatement:&needsFinalize];
sqlite3_stmt *statement = [parentConnection enumerateDstFileURLWithNameExcludingSrcStatement:&needsFinalize];
if (statement == NULL) return 0;
int64_t count = 0;
// SELECT "rowid", "name", "src", "dst", "rules", "manual" FROM "tableName"
// WHERE "dst" > INT64_MAX AND "src" != ?;
// SELECT "rowid", "src", "dst", "rules", "manual" FROM "tableName"
// WHERE "dst" > INT64_MAX AND "src" != ? AND "name" = ?;
//
// AKA: typeof(dst) IS BLOB
int const column_idx_rowid = SQLITE_COLUMN_START + 0;
int const column_idx_name = SQLITE_COLUMN_START + 1;
int const column_idx_src = SQLITE_COLUMN_START + 2;
int const column_idx_dst = SQLITE_COLUMN_START + 3;
int const column_idx_rules = SQLITE_COLUMN_START + 4;
int const column_idx_manual = SQLITE_COLUMN_START + 5;
int const column_idx_src = SQLITE_COLUMN_START + 1;
int const column_idx_dst = SQLITE_COLUMN_START + 2;
int const column_idx_rules = SQLITE_COLUMN_START + 3;
int const column_idx_manual = SQLITE_COLUMN_START + 4;
int const bind_idx_src = SQLITE_BIND_START + 0;
int const bind_idx_name = SQLITE_BIND_START + 1;
sqlite3_bind_int64(statement, bind_idx_src, exclSrcRowid);
YapDatabaseString _name; MakeYapDatabaseString(&_name, name);
sqlite3_bind_text(statement, bind_idx_name, _name.str, _name.length, SQLITE_STATIC);
int status;
while ((status = sqlite3_step(statement)) == SQLITE_ROW)
{
@ -2104,11 +2119,6 @@ NS_INLINE BOOL URLMatchesURL(NSURL *url1, NSURL *url2)
{
int64_t srcRowid = sqlite3_column_int64(statement, column_idx_src);
const unsigned char *text = sqlite3_column_text(statement, column_idx_name);
int textSize = sqlite3_column_bytes(statement, column_idx_name);
NSString *name = [[NSString alloc] initWithBytes:text length:textSize encoding:NSUTF8StringEncoding];
int64_t dstRowid = 0;
NSData *dstFileURLData = nil;
@ -2154,6 +2164,7 @@ NS_INLINE BOOL URLMatchesURL(NSURL *url1, NSURL *url2)
}
sqlite3_reset(statement);
FreeYapDatabaseString(&_name);
return count;
}
@ -2420,9 +2431,23 @@ NS_INLINE BOOL URLMatchesURL(NSURL *url1, NSURL *url2)
//
// Pre-process the updated edges.
// This involves looking up the destinationRowid for each edge.
//
// Implementation details:
//
// We use the offset & protocolEdgesCount to mark the range of unprocessed edges in the array:
// - All nodes at index < offset have already been processed.
// - All nodes at index >= protocolEdgesCount were added to the array and should be ignored.
//
// These added nodes represent existing edges in the database that were
// implicitly deleted by removing from edge list.
for (YapDatabaseRelationshipEdge *edge in protocolEdges)
__block NSUInteger offset = 0;
NSUInteger protocolEdgesCount = [protocolEdges count];
for (NSUInteger i = 0; i < protocolEdgesCount; i++)
{
YapDatabaseRelationshipEdge *edge = [protocolEdges objectAtIndex:i];
if (edge->state & YDB_EdgeState_DestinationFileURL)
{
continue;
@ -2444,38 +2469,23 @@ NS_INLINE BOOL URLMatchesURL(NSURL *url1, NSURL *url2)
edge->action = YDB_EdgeAction_Delete;
edge->flags |= YDB_EdgeFlags_DestinationDeleted;
edge->flags |= YDB_EdgeFlags_BadDestination;
[protocolEdges exchangeObjectAtIndex:i withObjectAtIndex:offset];
offset++;
}
else if (dstDeleted)
{
edge->action = YDB_EdgeAction_Delete;
edge->flags |= YDB_EdgeFlags_DestinationDeleted;
}
// Note: We're not done processing this edge yet.
// We still don't know if it actually exists in the databse yet.
// So we may not need to (be able to) delete it.
}
}
// Step 2 :
//
// Enumerate the existing edges in the database, and try to match them up with edges from the new set.
//
// Implementation notes:
//
// We use the offset & protocolEdgesCount to mark the range of unprocessed edges in the array:
// - All nodes at index < offset have already been matched.
// - All nodes at index >= protocolEdgesCount were added to the array and should be ignored (by step 3).
//
// These added nodes represent existing edges in the database that were
// implicitly deleted by removing from edge list.
__block NSUInteger offset = 0;
NSUInteger protocolEdgesCount = protocolEdges.count;
[self enumerateExistingEdgesWithSource:srcRowid usingBlock:^(YapDatabaseRelationshipEdge *existingEdge) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
// Ignore manually created edges
if (existingEdge->isManualEdge) return; // continue (next matching row)
@ -2558,11 +2568,8 @@ NS_INLINE BOOL URLMatchesURL(NSURL *url1, NSURL *url2)
}
[protocolEdges addObject:edge];
// Do NOT increment offset.
// Do NOT increment protocolEdgesCount.
// Note: Do NOT increment protocolEdgesCount.
}
#pragma clang diagnostic pop
}];
// Step 3 :
@ -2573,12 +2580,13 @@ NS_INLINE BOOL URLMatchesURL(NSURL *url1, NSURL *url2)
{
YapDatabaseRelationshipEdge *edge = [protocolEdges objectAtIndex:i];
edge->flags |= YDB_EdgeFlags_EdgeNotInDatabase;
edge->action = YDB_EdgeAction_Insert;
if (srcDeleted)
{
edge->action = YDB_EdgeAction_Delete;
edge->flags |= YDB_EdgeFlags_SourceDeleted;
edge->flags |= YDB_EdgeFlags_EdgeNotInDatabase;
}
if (!(edge->state & YDB_EdgeState_DestinationFileURL) &&
@ -2586,11 +2594,7 @@ NS_INLINE BOOL URLMatchesURL(NSURL *url1, NSURL *url2)
{
edge->action = YDB_EdgeAction_Delete;
edge->flags |= YDB_EdgeFlags_DestinationDeleted;
}
if (edge->action == YDB_EdgeAction_None) // May have been set to Delete in step 1
{
edge->action = YDB_EdgeAction_Insert;
edge->flags |= YDB_EdgeFlags_EdgeNotInDatabase;
}
}
}
@ -3059,8 +3063,6 @@ NS_INLINE BOOL URLMatchesURL(NSURL *url1, NSURL *url2)
// So this block need only look at the edgeAction and flags to decide how to process each edge.
void (^ProcessEdges)(NSArray *edges) = ^(NSArray *edges){ @autoreleasepool{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
for (YapDatabaseRelationshipEdge *edge in edges)
{
@ -3315,7 +3317,6 @@ NS_INLINE BOOL URLMatchesURL(NSURL *url1, NSURL *url2)
} // end for (YapDatabaseRelationshipEdge *edge in edges)
#pragma clang diagnostic pop
}}; // end block ProcessEdges(NSMutableArray *edges)
@ -3329,8 +3330,6 @@ NS_INLINE BOOL URLMatchesURL(NSURL *url1, NSURL *url2)
// - deleting edges that were manually removed from the list
[parentConnection->protocolChanges enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL __unused *stop){
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
__unsafe_unretained NSNumber *srcRowidNumber = (NSNumber *)key;
__unsafe_unretained NSMutableArray *protocolEdges = (NSMutableArray *)obj;
@ -3360,8 +3359,6 @@ NS_INLINE BOOL URLMatchesURL(NSURL *url1, NSURL *url2)
// We're ready for normal edge processing.
ProcessEdges(protocolEdges);
#pragma clang diagnostic pop
}];
[parentConnection->protocolChanges removeAllObjects];
@ -3403,9 +3400,10 @@ NS_INLINE BOOL URLMatchesURL(NSURL *url1, NSURL *url2)
{
if (edge->nodeDeleteRules & YDB_DeleteDestinationIfAllSourcesDeleted)
{
// Delete destination file IF there are no other edges pointing to it
// Delete destination node IF there are no other edges pointing to it with the same name
int64_t count = [self edgeCountWithDestinationFileURL:edge->destinationFileURL
name:edge->name
excludingSource:edge->sourceRowid];
if (count == 0)
{
@ -3427,9 +3425,10 @@ NS_INLINE BOOL URLMatchesURL(NSURL *url1, NSURL *url2)
}
else
{
// Delete destination node IF there are no other edges pointing to it
// Delete destination node IF there are no other edges pointing to it with the same name
int64_t count = [self edgeCountWithDestination:edge->destinationRowid
name:edge->name
excludingSource:edge->sourceRowid];
if (count == 0)
{
@ -3475,9 +3474,10 @@ NS_INLINE BOOL URLMatchesURL(NSURL *url1, NSURL *url2)
}
else
{
// Delete source node IF there are no other edges pointing from it
// Delete source node IF there are no other edges pointing from it with the same name
int64_t count = [self edgeCountWithSource:edge->sourceRowid
name:edge->name
excludingDestination:edge->destinationRowid];
if (count == 0)
{
@ -3545,8 +3545,6 @@ NS_INLINE BOOL URLMatchesURL(NSURL *url1, NSURL *url2)
YapCollectionKey *src = deletedCollectionKey;
[self enumerateExistingEdgesWithSource:srcRowid usingBlock:^(YapDatabaseRelationshipEdge *edge) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
// Reminder:
//
@ -3562,7 +3560,7 @@ NS_INLINE BOOL URLMatchesURL(NSURL *url1, NSURL *url2)
{
if (edge->nodeDeleteRules & YDB_DeleteDestinationIfAllSourcesDeleted)
{
// Delete the destination file IF there are no other edges pointing to it
// Delete the destination node IF there are no other edges pointing to it with the same name
if (!(edge->state & YDB_EdgeState_HasDestinationFileURL))
{
@ -3572,6 +3570,7 @@ NS_INLINE BOOL URLMatchesURL(NSURL *url1, NSURL *url2)
if (edge->destinationFileURL)
{
int64_t count = [self edgeCountWithDestinationFileURL:edge->destinationFileURL
name:edge->name
excludingSource:srcRowid];
if (count == 0)
{
@ -3607,10 +3606,11 @@ NS_INLINE BOOL URLMatchesURL(NSURL *url1, NSURL *url2)
if (edge->nodeDeleteRules & YDB_DeleteDestinationIfAllSourcesDeleted)
{
// Delete the destination node IF there are no other edges pointing to it
// Delete the destination node IF there are no other edges pointing to it with the same name
int64_t count = [self edgeCountWithDestination:edge->destinationRowid
excludingSource:srcRowid];
name:edge->name
excludingSource:srcRowid];
if (count == 0)
{
shouldDeleteDestination = YES;
@ -3708,8 +3708,6 @@ NS_INLINE BOOL URLMatchesURL(NSURL *url1, NSURL *url2)
}
}
} // end else if (!dstFilePath)
#pragma clang diagnostic pop
}]; // end enumerateExistingRowsWithSrc:usingBlock:
} // end "Enumerate all edges where source node is the deleted node"
@ -3721,8 +3719,6 @@ NS_INLINE BOOL URLMatchesURL(NSURL *url1, NSURL *url2)
YapCollectionKey *dst = deletedCollectionKey;
[self enumerateExistingEdgesWithDestination:dstRowid usingBlock:^(YapDatabaseRelationshipEdge *edge) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
// Reminder:
//
@ -3744,10 +3740,11 @@ NS_INLINE BOOL URLMatchesURL(NSURL *url1, NSURL *url2)
if (edge->nodeDeleteRules & YDB_DeleteSourceIfAllDestinationsDeleted)
{
// Delete the source node IF there are no other edges pointing from it
// Delete the source node IF there are no other edges pointing from it with the same name
int64_t count = [self edgeCountWithSource:edge->sourceRowid
excludingDestination:dstRowid];
name:edge->name
excludingDestination:dstRowid];
if (count == 0)
{
shouldDeleteSource = YES;
@ -3843,8 +3840,7 @@ NS_INLINE BOOL URLMatchesURL(NSURL *url1, NSURL *url2)
withRowid:edge->sourceRowid];
}
}
#pragma clang diagnostic pop
}]; // end enumerateExistingRowsWithDst:usingBlock:
} // end "Enumerate all edges where destination node is the deleted node"

View File

@ -141,7 +141,7 @@
dispatch_block_t block = ^{
result = self->query;
result = query;
};
if (dispatch_get_specific(databaseConnection->IsOnConnectionQueueKey))

View File

@ -207,8 +207,6 @@ static NSString *const ext_key_query = @"query";
__block int processed = 0;
[ftsTransaction enumerateRowidsMatching:[self query] usingBlock:^(int64_t rowid, BOOL *stop) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
YapRowidSetAdd(ftsRowids, rowid);
@ -219,8 +217,6 @@ static NSString *const ext_key_query = @"query";
*stop = YES;
}
}
#pragma clang diagnostic pop
}];
}
@ -256,8 +252,6 @@ static NSString *const ext_key_query = @"query";
// The changeset mechanism will automatically consolidate all changes to the minimum.
[self enumerateGroupsUsingBlock:^(NSString *group, BOOL __unused *outerStop) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
// We must add the changes in reverse order.
// Either that, or the change index of each item would have to be zero,
@ -274,8 +268,6 @@ static NSString *const ext_key_query = @"query";
}];
[parentConnection->changes addObject:[YapDatabaseViewSectionChange deleteGroup:group]];
#pragma clang diagnostic pop
}];
isRepopulate = YES;
@ -370,9 +362,6 @@ static NSString *const ext_key_query = @"query";
[parentViewTransaction enumerateRowidsInGroup:group usingBlock:
^(int64_t rowid, NSUInteger __unused parentIndex, BOOL __unused *stop)
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
if (existing && ((existingRowid == rowid)))
{
// Shortcut #1
@ -451,8 +440,6 @@ static NSString *const ext_key_query = @"query";
// and is still not in our view (filtered).
}
}
#pragma clang diagnostic pop
}];
while (existing)
@ -1452,7 +1439,7 @@ static NSString *const ext_key_query = @"query";
if ([extDependencies containsObject:registeredName])
{
YapDatabaseExtensionTransaction *extTransaction = [self->databaseTransaction ext:extName];
YapDatabaseExtensionTransaction *extTransaction = [databaseTransaction ext:extName];
if ([extTransaction respondsToSelector:@selector(view:didRepopulateWithFlags:)])
{
@ -1573,9 +1560,6 @@ static NSString *const ext_key_query = @"query";
[parentViewTransaction enumerateRowidsInGroup:group
usingBlock:^(int64_t rowid, NSUInteger parentIndex, BOOL *stop)
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
if (YapRowidSetContains(ftsRowids, rowid))
{
// The item matches the FTS query (should be in view)
@ -1639,8 +1623,6 @@ static NSString *const ext_key_query = @"query";
*stop = YES;
}
}
#pragma clang diagnostic pop
}];
if ([searchQueue shouldAbortSearchInProgressAndRollback:NULL]) {
@ -1692,9 +1674,6 @@ static NSString *const ext_key_query = @"query";
range:range
usingBlock:^(int64_t rowid, NSUInteger index, BOOL *stop)
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
if (YapRowidSetContains(ftsRowidsLeft, rowid))
{
// The row was previously in the view (in old search results),
@ -1742,8 +1721,6 @@ static NSString *const ext_key_query = @"query";
done = YES;
}
}
#pragma clang diagnostic pop
}];
} while (!done);
@ -1769,8 +1746,6 @@ static NSString *const ext_key_query = @"query";
sorting:&sorting];
YapRowidSetEnumerate(ftsRowidsLeft, ^(int64_t rowid, BOOL *stop) { @autoreleasepool {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-retain-self"
YapCollectionKey *ck = [databaseTransaction collectionKeyForRowid:rowid];
@ -1863,8 +1838,6 @@ static NSString *const ext_key_query = @"query";
*stop = YES;
}
}
#pragma clang diagnostic pop
}});
// Dealloc the temporary c++ set

Some files were not shown because too many files have changed in this diff Show More