Skip to content

Commit

Permalink
Update project settings to match Xcode 10.1
Browse files Browse the repository at this point in the history
  • Loading branch information
hydrixos committed Nov 5, 2018
1 parent 5f85108 commit b01cc7e
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 199 deletions.
22 changes: 11 additions & 11 deletions Source/ULDocument.m
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ - (void)updateChangeCount:(ULDocumentChangeKind)change
if (self.fileURL) {
dispatch_async(_autosaveQueue, ^{
// Autosave is already scheduled or pending: do nothing.
if (_autosaveToken)
if (self->_autosaveToken)
return;

// Activate autosave token to ensure document is kept alive and saved on exit
Expand All @@ -376,7 +376,7 @@ - (void)updateChangeCount:(ULDocumentChangeKind)change

// Run autosave after predefined delay.
__weak ULDocument *weakSelf = self;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, autosaveDelay * NSEC_PER_SEC), _autosaveQueue, ^(void) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, autosaveDelay * NSEC_PER_SEC), self->_autosaveQueue, ^(void) {
ULDocument *strongSelf = weakSelf;
if (!strongSelf || !strongSelf->_autosaveToken)
return;
Expand Down Expand Up @@ -582,7 +582,7 @@ - (void)openWithCompletionHandler:(void (^)(BOOL success))completionHandler

ULNoticeBeginURL(self.fileURL);

[[[NSFileCoordinator alloc] initWithFilePresenter: _presenter] coordinateReadingItemAtURL:self.fileURL options:NSFileCoordinatorReadingWithoutChanges error:&error byAccessor:^(NSURL *newURL) {
[[[NSFileCoordinator alloc] initWithFilePresenter: self->_presenter] coordinateReadingItemAtURL:self.fileURL options:NSFileCoordinatorReadingWithoutChanges error:&error byAccessor:^(NSURL *newURL) {
// Document has been opened in the meantime
if (self.documentIsOpen) {
success = YES;
Expand Down Expand Up @@ -671,9 +671,9 @@ - (void)deleteWithCompletionHandler:(void (^)(BOOL success))completionHandler

ULNoticeBeginURL(self.fileURL);

[[[NSFileCoordinator alloc] initWithFilePresenter: _presenter] coordinateWritingItemAtURL:self.fileURL options:NSFileCoordinatorWritingForDeleting error:&error byAccessor:^(NSURL *newURL) {
[[[NSFileCoordinator alloc] initWithFilePresenter: self->_presenter] coordinateWritingItemAtURL:self.fileURL options:NSFileCoordinatorWritingForDeleting error:&error byAccessor:^(NSURL *newURL) {
// File has been deleted externally
if (_deletionPending) {
if (self->_deletionPending) {
deleteError = [NSError errorWithDomain:NSCocoaErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey: @"Deletion pending."}];
return;
}
Expand Down Expand Up @@ -738,7 +738,7 @@ - (void)revertToContentsOfURL:(NSURL *)url completionHandler:(void (^)(BOOL succ

ULNoticeBeginURL(self.fileURL);

[[[NSFileCoordinator alloc] initWithFilePresenter: _presenter] coordinateReadingItemAtURL:url options:NSFileCoordinatorReadingWithoutChanges error:&error byAccessor:^(NSURL *newURL) {
[[[NSFileCoordinator alloc] initWithFilePresenter: self->_presenter] coordinateReadingItemAtURL:url options:NSFileCoordinatorReadingWithoutChanges error:&error byAccessor:^(NSURL *newURL) {
// Attempt read
self.fileURL = newURL;
success = [self coordinatedOpenFromURL:newURL error:&readError];
Expand Down Expand Up @@ -778,7 +778,7 @@ - (void)replaceWithFileVersion:(NSFileVersion *)version completionHandler:(void
NSError *error;
__block NSError *operationError;

[[[NSFileCoordinator alloc] initWithFilePresenter: _presenter] coordinateReadingItemAtURL:version.URL options:NSFileCoordinatorReadingWithoutChanges writingItemAtURL:self.fileURL options:NSFileCoordinatorWritingForReplacing error:&error byAccessor:^(NSURL *srcURL, NSURL *destURL) {
[[[NSFileCoordinator alloc] initWithFilePresenter: self->_presenter] coordinateReadingItemAtURL:version.URL options:NSFileCoordinatorReadingWithoutChanges writingItemAtURL:self.fileURL options:NSFileCoordinatorWritingForReplacing error:&error byAccessor:^(NSURL *srcURL, NSURL *destURL) {
NSError *localError;

// Replace file
Expand Down Expand Up @@ -875,7 +875,7 @@ - (void)saveToURL:(NSURL *)url forSaveOperation:(ULDocumentSaveOperation)saveOpe
NSParameterAssert(url);

[ULDeadlockDetector performOperationWithContext:@(saveOperation) maximumDuration:ULDocumentMaximumSaveDuration delegate:self usingBlock:^(void (^terminationHandler)(void)) {
[_interactionQueue addOperationWithBlock:^{
[self->_interactionQueue addOperationWithBlock:^{
__autoreleasing NSError *error;

// Perform write
Expand Down Expand Up @@ -919,7 +919,7 @@ - (BOOL)saveToURL:(NSURL *)url forSaveOperation:(ULDocumentSaveOperation)saveOpe

[coordinator ul_coordinateMovingItemAtURL:self.fileURL toURL:url error:&localError byAccessor:^(NSURL *currentURL, NSURL *newURL) {
// File has been deleted externally
if (_deletionPending) {
if (self->_deletionPending) {
operationError = [NSError errorWithDomain:NSCocoaErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey: @"Deletion pending."}];
return;
}
Expand All @@ -938,7 +938,7 @@ - (BOOL)saveToURL:(NSURL *)url forSaveOperation:(ULDocumentSaveOperation)saveOpe
self.fileURL = movedURL;

// File has been deleted externally
if (_deletionPending) {
if (self->_deletionPending) {
operationError = [NSError errorWithDomain:NSCocoaErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey: @"Deletion pending."}];
success = NO;
return;
Expand All @@ -963,7 +963,7 @@ - (BOOL)saveToURL:(NSURL *)url forSaveOperation:(ULDocumentSaveOperation)saveOpe

[[[NSFileCoordinator alloc] initWithFilePresenter: _presenter] coordinateWritingItemAtURL:url options:0 error:&localError byAccessor:^(NSURL *newURL) {
// File has been deleted externally
if (_deletionPending) {
if (self->_deletionPending) {
operationError = [NSError errorWithDomain:NSCocoaErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey: @"Deletion pending."}];
return;
}
Expand Down
4 changes: 2 additions & 2 deletions Source/Utilities/ULFilePresentationProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,12 @@ - (void)presentedItemDidMoveToURL:(NSURL *)newURL
[self willChangeValueForKey: @"presentedItemURL"];

[[[NSFileCoordinator alloc] initWithFilePresenter: self] coordinateReadingItemAtURL:newURL options:0 error:NULL byAccessor:^(NSURL *newURL) {
id owner = _owner;
id owner = self->_owner;
if (!owner)
return;

[NSFileCoordinator removeFilePresenter: self];
_url = newURL;
self->_url = newURL;
[NSFileCoordinator addFilePresenter: self];
}];

Expand Down
2 changes: 1 addition & 1 deletion Tests/Other/ULDocumentTests-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>com.soulmen.${PRODUCT_NAME:rfc1034identifier}</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
Expand Down
6 changes: 3 additions & 3 deletions Tests/Utilities/XCTestCase+TestExtensions.m
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ - (BOOL)ul_waitForConditionOnMainLoop:(BOOL)waitOnMainLoop otherQueues:(NSArray
failed = NO;

for (NSDictionary *descriptor in descriptors) {
BOOL (^condition)() = descriptor[ULTestCaseAsynchronousConditionKey];
BOOL (^condition)(void) = descriptor[ULTestCaseAsynchronousConditionKey];
if (!condition()) {
failed = YES;
break;
Expand All @@ -246,9 +246,9 @@ - (BOOL)ul_waitForConditionOnMainLoop:(BOOL)waitOnMainLoop otherQueues:(NSArray
NSLog(@"Assertions not satisfied within %fs.", timeout);

for (NSDictionary *descriptor in descriptors) {
BOOL (^condition)() = descriptor[ULTestCaseAsynchronousConditionKey];
BOOL (^condition)(void) = descriptor[ULTestCaseAsynchronousConditionKey];
if (!condition()) {
void (^assertion)() = descriptor[ULTestCaseAsynchronousAssertionKey];
void (^assertion)(void) = descriptor[ULTestCaseAsynchronousAssertionKey];
assertion();
break;
}
Expand Down
2 changes: 1 addition & 1 deletion ULDocument.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "ULDocument"
s.version = "1.1.0"
s.version = "1.1.1"
s.license = "MIT"
s.homepage = "https://github.com/soulmen/ULDocument.git"
s.summary = "A lightweight and iCloud-ready document class."
Expand Down
33 changes: 32 additions & 1 deletion ULDocument.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@
79AC7CDE1920CE3300103E36 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0510;
LastUpgradeCheck = 1010;
ORGANIZATIONNAME = "The Soulmen";
TargetAttributes = {
7917C4D11920F6D300E57657 = {
Expand Down Expand Up @@ -558,6 +558,7 @@
"$(inherited)",
);
INFOPLIST_FILE = "Tests/Other/ULDocumentTests-Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = "com.soulmen.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
TEST_HOST = "";
Expand All @@ -578,6 +579,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Source/Other/ULDocument-iOS-Prefix.pch";
INFOPLIST_FILE = "Tests/Other/ULDocumentTests-Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = "com.soulmen.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
TEST_HOST = "";
Expand All @@ -594,18 +596,32 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
Expand All @@ -632,19 +648,32 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
Expand Down Expand Up @@ -693,6 +722,7 @@
"$(inherited)",
);
INFOPLIST_FILE = "Tests/Other/ULDocumentTests-Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = "com.soulmen.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = xctest;
};
Expand All @@ -709,6 +739,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Source/Other/ULDocument-Mac-Prefix.pch";
INFOPLIST_FILE = "Tests/Other/ULDocumentTests-Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = "com.soulmen.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = xctest;
};
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit b01cc7e

Please sign in to comment.