From 567d13d34cc4d485a72198df6a1c27812fee0bca Mon Sep 17 00:00:00 2001 From: Amro Mousa Date: Fri, 30 Aug 2013 11:39:28 -0400 Subject: [PATCH 01/23] sort the array in place so single class cascades from ancestors work --- Core/Source/DTCSSStylesheet.m | 50 +++++++++++++++++------------------ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/Core/Source/DTCSSStylesheet.m b/Core/Source/DTCSSStylesheet.m index b1b130d4b..82ab6c647 100644 --- a/Core/Source/DTCSSStylesheet.m +++ b/Core/Source/DTCSSStylesheet.m @@ -677,34 +677,34 @@ - (NSDictionary *)mergedStyleDictionaryForElement:(DTHTMLElement *)element match // Cascaded selectors with more than one part are sorted by specificity NSMutableArray *matchingCascadingSelectors = [self matchingComplexCascadingSelectorsForElement:element]; - NSArray *sortedCascadingSelectors = [matchingCascadingSelectors sortedArrayUsingComparator:^NSComparisonResult(NSString *selector1, NSString *selector2) - { - NSInteger weightForSelector1 = [_orderedSelectorWeights[selector1] integerValue]; - NSInteger weightForSelector2 = [_orderedSelectorWeights[selector2] integerValue]; - - if (weightForSelector1 == weightForSelector2) - { - weightForSelector1 += [_orderedSelectors indexOfObject:selector1]; - weightForSelector2 += [_orderedSelectors indexOfObject:selector2]; - } - - if (weightForSelector1 > weightForSelector2) - { - return (NSComparisonResult)NSOrderedDescending; - } - - if (weightForSelector1 < weightForSelector2) - { - return (NSComparisonResult)NSOrderedAscending; - } - - return (NSComparisonResult)NSOrderedSame; - }]; + [matchingCascadingSelectors sortUsingComparator:^NSComparisonResult(NSString *selector1, NSString *selector2) + { + NSInteger weightForSelector1 = [_orderedSelectorWeights[selector1] integerValue]; + NSInteger weightForSelector2 = [_orderedSelectorWeights[selector2] integerValue]; + + if (weightForSelector1 == weightForSelector2) + { + weightForSelector1 += [_orderedSelectors indexOfObject:selector1]; + weightForSelector2 += [_orderedSelectors indexOfObject:selector2]; + } + + if (weightForSelector1 > weightForSelector2) + { + return (NSComparisonResult)NSOrderedDescending; + } + + if (weightForSelector1 < weightForSelector2) + { + return (NSComparisonResult)NSOrderedAscending; + } + + return (NSComparisonResult)NSOrderedSame; + }]; // Single part selectors are also weighted by specificity, but since they all have the same weight, //we apply them in order of least specific to most specific. [matchingCascadingSelectors addObjectsFromArray:[self matchingSimpleCascadedSelectors:element]]; - + NSMutableSet *tmpMatchedSelectors; if (matchedSelectors) @@ -713,7 +713,7 @@ - (NSDictionary *)mergedStyleDictionaryForElement:(DTHTMLElement *)element match } // Apply complex cascading selectors first, then apply most specific selectors - for (NSString *cascadingSelector in sortedCascadingSelectors) + for (NSString *cascadingSelector in matchingCascadingSelectors) { NSDictionary *byCascadingSelector = [_styles objectForKey:cascadingSelector]; [tmpDict addEntriesFromDictionary:byCascadingSelector]; From a6bbc4fbe4fe7c53cb1872ae4aefbf002170c443 Mon Sep 17 00:00:00 2001 From: Amro Mousa Date: Fri, 30 Aug 2013 13:39:43 -0400 Subject: [PATCH 02/23] handle cases where the current and terminal selector part are the same. remove list workaround that's no longer necessary. --- Core/Source/DTCSSStylesheet.m | 14 ++++++---- Core/Source/DTHTMLAttributedStringBuilder.m | 29 --------------------- 2 files changed, 9 insertions(+), 34 deletions(-) diff --git a/Core/Source/DTCSSStylesheet.m b/Core/Source/DTCSSStylesheet.m index 82ab6c647..67e5381cb 100644 --- a/Core/Source/DTCSSStylesheet.m +++ b/Core/Source/DTCSSStylesheet.m @@ -805,7 +805,7 @@ - (NSMutableArray *)matchingComplexCascadingSelectorsForElement:(DTHTMLElement * continue; } - DTHTMLElement *currentElement = element; + DTHTMLElement *nextElement = element; // Walking up the hierarchy so start at the right side of the selector and work to the left // Aside: Manual for loop here is faster than for in with reverseObjectEnumerator @@ -816,8 +816,13 @@ - (NSMutableArray *)matchingComplexCascadingSelectorsForElement:(DTHTMLElement * if (selectorPart.length) { - while (currentElement != nil) + while (nextElement != nil) { + DTHTMLElement *currentElement = nextElement; + + //This must be set to advance here, above all of the breaks, so the loop properly advances. + nextElement = currentElement.parentElement; + if ([selectorPart characterAtIndex:0] == '#') { // If we're at an id and it doesn't match the current element then the style doesn't apply @@ -851,8 +856,6 @@ - (NSMutableArray *)matchingComplexCascadingSelectorsForElement:(DTHTMLElement * matched = YES; break; } - - currentElement = currentElement.parentElement; } } @@ -861,7 +864,8 @@ - (NSMutableArray *)matchingComplexCascadingSelectorsForElement:(DTHTMLElement * break; } - if ([selectorPart isEqualToString:[selectorParts objectAtIndex:0]]) + //Only match if we really are on the last part of the selector + if ([selectorPart isEqualToString:[selectorParts objectAtIndex:0]] && (j == 0)) { if (matched && ![matchedSelectors containsObject:selector]) { diff --git a/Core/Source/DTHTMLAttributedStringBuilder.m b/Core/Source/DTHTMLAttributedStringBuilder.m index 014e7de6a..8b8dfb398 100644 --- a/Core/Source/DTHTMLAttributedStringBuilder.m +++ b/Core/Source/DTHTMLAttributedStringBuilder.m @@ -427,35 +427,6 @@ - (void)_registerTagStartHandlers [textLists addObject:newListStyle]; - // workaround for different styles on stacked lists - if ([textLists count]>1) // not necessary for first - { - // find out if each list is ordered or unordered - NSMutableArray *tmpArray = [NSMutableArray array]; - for (DTCSSListStyle *oneList in textLists) - { - if ([oneList isOrdered]) - { - [tmpArray addObject:@"ol"]; - } - else - { - [tmpArray addObject:@"ul"]; - } - } - - // build a CSS selector - NSString *selector = [tmpArray componentsJoinedByString:@" "]; - - // find style - NSDictionary *style = [[_globalStyleSheet styles] objectForKey:selector]; - - if (style) - { - [newListStyle updateFromStyleDictionary:style]; - } - } - _currentTag.paragraphStyle.textLists = textLists; }; From ddb1b92935494375f8f0cc350a479f259c56f682 Mon Sep 17 00:00:00 2001 From: Oliver Drobnik Date: Fri, 30 Aug 2013 19:45:17 +0200 Subject: [PATCH 03/23] removed workaround for adjusting list bullet pre-CSS-cascading #574 --- Core/Source/DTHTMLAttributedStringBuilder.m | 29 --------------------- 1 file changed, 29 deletions(-) diff --git a/Core/Source/DTHTMLAttributedStringBuilder.m b/Core/Source/DTHTMLAttributedStringBuilder.m index 014e7de6a..8b8dfb398 100644 --- a/Core/Source/DTHTMLAttributedStringBuilder.m +++ b/Core/Source/DTHTMLAttributedStringBuilder.m @@ -427,35 +427,6 @@ - (void)_registerTagStartHandlers [textLists addObject:newListStyle]; - // workaround for different styles on stacked lists - if ([textLists count]>1) // not necessary for first - { - // find out if each list is ordered or unordered - NSMutableArray *tmpArray = [NSMutableArray array]; - for (DTCSSListStyle *oneList in textLists) - { - if ([oneList isOrdered]) - { - [tmpArray addObject:@"ol"]; - } - else - { - [tmpArray addObject:@"ul"]; - } - } - - // build a CSS selector - NSString *selector = [tmpArray componentsJoinedByString:@" "]; - - // find style - NSDictionary *style = [[_globalStyleSheet styles] objectForKey:selector]; - - if (style) - { - [newListStyle updateFromStyleDictionary:style]; - } - } - _currentTag.paragraphStyle.textLists = textLists; }; From f66b367385314abe846c7bf9571bbe98e5899eb0 Mon Sep 17 00:00:00 2001 From: Oliver Drobnik Date: Fri, 30 Aug 2013 19:45:34 +0200 Subject: [PATCH 04/23] Added list bullet unit test #574 --- .../DTHTMLAttributedStringBuilderTest.m | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/Core/Test/Source/DTHTMLAttributedStringBuilderTest.m b/Core/Test/Source/DTHTMLAttributedStringBuilderTest.m index 6e47b4e39..34b4a5bd2 100644 --- a/Core/Test/Source/DTHTMLAttributedStringBuilderTest.m +++ b/Core/Test/Source/DTHTMLAttributedStringBuilderTest.m @@ -583,6 +583,58 @@ - (void)testPrefixWithNewlines }]; } +// issue 574 +- (void)testCorrectListBullets +{ + NSAttributedString *attributedString = [self _attributedStringFromHTMLString:@"
  • 1
    • 2
      • 3
" options:nil]; + + + NSString *string = [attributedString string]; + NSRange entireStringRange = NSMakeRange(0, [string length]); + + __block NSUInteger lineNumber = 0; + + [string enumerateSubstringsInRange:entireStringRange options:NSStringEnumerationByParagraphs usingBlock:^(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop) { + + NSAttributedString *attributedSubstring = [attributedString attributedSubstringFromRange:enclosingRange]; + + NSRange prefixRange = [attributedSubstring rangeOfFieldAtIndex:0]; + prefixRange.location++; + prefixRange.length = 1; + NSString *bulletChar = [[attributedSubstring string] substringWithRange:prefixRange]; + + NSString *expectedChar = nil; + + switch (lineNumber) + { + case 0: + { + expectedChar = @"\u2022"; // disc + break; + } + + case 1: + { + expectedChar = @"\u25e6"; // circle + break; + } + + case 2: + { + expectedChar = @"\u25aa"; // square + break; + } + } + + BOOL characterIsCorrect = [bulletChar isEqualToString:expectedChar]; + STAssertTrue(characterIsCorrect, @"Bullet Character on UL level %d should be '%@' but is '%@'", lineNumber+1, expectedChar, bulletChar); + + lineNumber++; + }]; + + +} + #pragma mark - CSS Tests // issue 544 From 16b05a68af08f1d70d59618cb844f26b39b3fa9d Mon Sep 17 00:00:00 2001 From: Amro Mousa Date: Fri, 30 Aug 2013 13:48:32 -0400 Subject: [PATCH 05/23] simplify conditional and add comment --- Core/Source/DTCSSStylesheet.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/Source/DTCSSStylesheet.m b/Core/Source/DTCSSStylesheet.m index 67e5381cb..e81dcccf3 100644 --- a/Core/Source/DTCSSStylesheet.m +++ b/Core/Source/DTCSSStylesheet.m @@ -864,8 +864,8 @@ - (NSMutableArray *)matchingComplexCascadingSelectorsForElement:(DTHTMLElement * break; } - //Only match if we really are on the last part of the selector - if ([selectorPart isEqualToString:[selectorParts objectAtIndex:0]] && (j == 0)) + //Only match if we really are on the last part of the selector and all other parts have matched so far + if (j == 0) { if (matched && ![matchedSelectors containsObject:selector]) { From 00ae6d0bcc5e4566052bf7bc8adc36f9746c00ba Mon Sep 17 00:00:00 2001 From: Oliver Drobnik Date: Fri, 30 Aug 2013 20:56:27 +0200 Subject: [PATCH 06/23] removed crash test from MacUnitTest --- Core/Test/Resources/CSSOOMCrash.plist | 8 ++++++++ DTCoreText.xcodeproj/project.pbxproj | 4 ++++ 2 files changed, 12 insertions(+) create mode 100644 Core/Test/Resources/CSSOOMCrash.plist diff --git a/Core/Test/Resources/CSSOOMCrash.plist b/Core/Test/Resources/CSSOOMCrash.plist new file mode 100644 index 000000000..c1eaa6a1e --- /dev/null +++ b/Core/Test/Resources/CSSOOMCrash.plist @@ -0,0 +1,8 @@ + + + + + SkipUnitTest + + + diff --git a/DTCoreText.xcodeproj/project.pbxproj b/DTCoreText.xcodeproj/project.pbxproj index e3c421e5b..fd8291e33 100644 --- a/DTCoreText.xcodeproj/project.pbxproj +++ b/DTCoreText.xcodeproj/project.pbxproj @@ -158,6 +158,7 @@ A776DBE91716A8EE00E71F36 /* NSStringParagraphTest.m in Sources */ = {isa = PBXBuildFile; fileRef = A776DBE71716A8EE00E71F36 /* NSStringParagraphTest.m */; }; A77A3E421779BF04000B290B /* NSMutableAttributedStringHTMLTest.m in Sources */ = {isa = PBXBuildFile; fileRef = A77A3E411779BF03000B290B /* NSMutableAttributedStringHTMLTest.m */; }; A77A3E431779BF04000B290B /* NSMutableAttributedStringHTMLTest.m in Sources */ = {isa = PBXBuildFile; fileRef = A77A3E411779BF03000B290B /* NSMutableAttributedStringHTMLTest.m */; }; + A783CE7917D11D0700C84C28 /* CSSOOMCrash.plist in Resources */ = {isa = PBXBuildFile; fileRef = A783CE6717D11D0100C84C28 /* CSSOOMCrash.plist */; }; A785FA1217BA113900BB758E /* DTCSSStylesheetTest.m in Sources */ = {isa = PBXBuildFile; fileRef = A7E3346D16837482002EFCBE /* DTCSSStylesheetTest.m */; }; A788C95D14863E8700E1AFD9 /* DTAttributedTextCell.h in Headers */ = {isa = PBXBuildFile; fileRef = A788C91014863E8700E1AFD9 /* DTAttributedTextCell.h */; settings = {ATTRIBUTES = (Public, ); }; }; A788C95E14863E8700E1AFD9 /* DTAttributedTextCell.h in Headers */ = {isa = PBXBuildFile; fileRef = A788C91014863E8700E1AFD9 /* DTAttributedTextCell.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -939,6 +940,7 @@ A776DBE71716A8EE00E71F36 /* NSStringParagraphTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSStringParagraphTest.m; sourceTree = ""; }; A77A3E401779BF03000B290B /* NSMutableAttributedStringHTMLTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSMutableAttributedStringHTMLTest.h; sourceTree = ""; }; A77A3E411779BF03000B290B /* NSMutableAttributedStringHTMLTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSMutableAttributedStringHTMLTest.m; sourceTree = ""; }; + A783CE6717D11D0100C84C28 /* CSSOOMCrash.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = CSSOOMCrash.plist; sourceTree = ""; }; A788C91014863E8700E1AFD9 /* DTAttributedTextCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DTAttributedTextCell.h; sourceTree = ""; }; A788C91114863E8700E1AFD9 /* DTAttributedTextCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = DTAttributedTextCell.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; A788C91214863E8700E1AFD9 /* DTAttributedTextContentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DTAttributedTextContentView.h; sourceTree = ""; }; @@ -1635,6 +1637,7 @@ A7E8E1D316D22B7E001EDE51 /* EmptyLinesAndFontAttribute.html */, A7343F3217BDF64A00EF9B83 /* CSSCascading.html */, C2CDBADA17CCD245000E4AD7 /* CSSOOMCrash.html */, + A783CE6717D11D0100C84C28 /* CSSOOMCrash.plist */, ); path = Resources; sourceTree = ""; @@ -2383,6 +2386,7 @@ A730BCD916D29588003B849F /* Languages.html in Resources */, A7343F3417BDF64A00EF9B83 /* CSSCascading.html in Resources */, C2CDBAED17CCD5EA000E4AD7 /* CSSOOMCrash.html in Resources */, + A783CE7917D11D0700C84C28 /* CSSOOMCrash.plist in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; From e8d4d651534f91737355ab3737d8fd1fdb6df5e1 Mon Sep 17 00:00:00 2001 From: Oliver Drobnik Date: Fri, 30 Aug 2013 20:57:03 +0200 Subject: [PATCH 07/23] Added unit test for mixed list prefix issue #574 --- .../DTHTMLAttributedStringBuilderTest.m | 45 +++++++++++++++++++ Demo/Resources/CurrentTest.html | 17 +------ 2 files changed, 46 insertions(+), 16 deletions(-) diff --git a/Core/Test/Source/DTHTMLAttributedStringBuilderTest.m b/Core/Test/Source/DTHTMLAttributedStringBuilderTest.m index 34b4a5bd2..58daccf27 100644 --- a/Core/Test/Source/DTHTMLAttributedStringBuilderTest.m +++ b/Core/Test/Source/DTHTMLAttributedStringBuilderTest.m @@ -631,8 +631,53 @@ - (void)testCorrectListBullets lineNumber++; }]; +} + +// issue 574 +- (void)testMixedListPrefix +{ + NSAttributedString *attributedString = [self _attributedStringFromHTMLString:@"
  1. 1a
    • 2a
      1. 3a
" options:nil]; + + NSString *string = [attributedString string]; + NSRange entireStringRange = NSMakeRange(0, [string length]); + __block NSUInteger lineNumber = 0; + [string enumerateSubstringsInRange:entireStringRange options:NSStringEnumerationByParagraphs usingBlock:^(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop) { + + NSAttributedString *attributedSubstring = [attributedString attributedSubstringFromRange:enclosingRange]; + + NSRange prefixRange = [attributedSubstring rangeOfFieldAtIndex:0]; + NSString *prefix = [[attributedSubstring string] substringWithRange:prefixRange]; + + NSString *expectedPrefix = nil; + + switch (lineNumber) + { + case 0: + { + expectedPrefix = @"\t1.\t"; // one + break; + } + + case 1: + { + expectedPrefix = @"\t\u25e6\t"; // circle + break; + } + + case 2: + { + expectedPrefix = @"\t1.\t"; // one + break; + } + } + + BOOL prefixIsCorrect = [prefix isEqualToString:expectedPrefix]; + STAssertTrue(prefixIsCorrect, @"Prefix level %d should be '%@' but is '%@'", lineNumber+1, expectedPrefix, prefix); + + lineNumber++; + }]; } #pragma mark - CSS Tests diff --git a/Demo/Resources/CurrentTest.html b/Demo/Resources/CurrentTest.html index 100676264..de18c8613 100644 --- a/Demo/Resources/CurrentTest.html +++ b/Demo/Resources/CurrentTest.html @@ -1,16 +1 @@ - - - - - - - - -
- - - - +
  1. 1a
    • 2a
      1. 3a
\ No newline at end of file From 4d5d0907bc3d5f6cfb29590d02b04abc1ebab029 Mon Sep 17 00:00:00 2001 From: Oliver Drobnik Date: Fri, 30 Aug 2013 21:12:19 +0200 Subject: [PATCH 08/23] Added unit test for div-div-span --- Core/Test/Source/DTHTMLAttributedStringBuilderTest.m | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Core/Test/Source/DTHTMLAttributedStringBuilderTest.m b/Core/Test/Source/DTHTMLAttributedStringBuilderTest.m index 58daccf27..c7b56a2a6 100644 --- a/Core/Test/Source/DTHTMLAttributedStringBuilderTest.m +++ b/Core/Test/Source/DTHTMLAttributedStringBuilderTest.m @@ -868,4 +868,16 @@ - (void)testCascadedSelectorsWithEqualSpecificityLastDeclarationWins { STAssertEqualObjects(foregroundHTML2, @"ff0000", @"Color should be red and not green."); } +// text should be green even though there is a span following the div-div. +- (void)testDivDivSpan +{ + NSAttributedString *attributedString = [self _attributedStringFromHTMLString:@"
FOO
" options:nil]; + + NSDictionary *attributes1 = [attributedString attributesAtIndex:0 effectiveRange:NULL]; + DTColor *foreground1 = [attributes1 foregroundColor]; + NSString *foreground1HTML = [foreground1 htmlHexString]; + BOOL colorOk1 = ([foreground1HTML isEqualToString:@"008000"]); + STAssertTrue(colorOk1, @"First item should be green"); +} + @end From 2ebb93171eb270a1e5d025636442a92cc5eff511 Mon Sep 17 00:00:00 2001 From: Amro Mousa Date: Fri, 30 Aug 2013 15:16:39 -0400 Subject: [PATCH 09/23] Enforce right most selector match on target element --- Core/Source/DTCSSStylesheet.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Core/Source/DTCSSStylesheet.m b/Core/Source/DTCSSStylesheet.m index e81dcccf3..63bcf41c0 100644 --- a/Core/Source/DTCSSStylesheet.m +++ b/Core/Source/DTCSSStylesheet.m @@ -856,6 +856,11 @@ - (NSMutableArray *)matchingComplexCascadingSelectorsForElement:(DTHTMLElement * matched = YES; break; } + + // break if the right most portion of the selector doesn't match the target element + if (!matched && ([currentElement isEqual:element])) { + break; + } } } From f4637cafc5b2199ae0e83a9e62e61c8fe9efe3dc Mon Sep 17 00:00:00 2001 From: Oliver Drobnik Date: Fri, 30 Aug 2013 21:32:09 +0200 Subject: [PATCH 10/23] Added Travis yml file --- .travis.yml | 1 + Demo/Resources/CurrentTest.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..c3f4dc3be --- /dev/null +++ b/.travis.yml @@ -0,0 +1 @@ +language: objective-c diff --git a/Demo/Resources/CurrentTest.html b/Demo/Resources/CurrentTest.html index de18c8613..7ad600010 100644 --- a/Demo/Resources/CurrentTest.html +++ b/Demo/Resources/CurrentTest.html @@ -1 +1 @@ -
  1. 1a
    • 2a
      1. 3a
\ No newline at end of file +
FOO
\ No newline at end of file From 72317ce79606f1fbea31e79db1bcc9e565ffff77 Mon Sep 17 00:00:00 2001 From: Oliver Drobnik Date: Fri, 30 Aug 2013 21:43:10 +0200 Subject: [PATCH 11/23] Added shared schemes for demo app and unit tests --- .../xcshareddata/xcschemes/DemoApp.xcscheme | 86 +++++++++++++++++++ .../xcschemes/MacUnitTest.xcscheme | 53 ++++++++++++ .../xcshareddata/xcschemes/UnitTest.xcscheme | 53 ++++++++++++ 3 files changed, 192 insertions(+) create mode 100644 DTCoreText.xcodeproj/xcshareddata/xcschemes/DemoApp.xcscheme create mode 100644 DTCoreText.xcodeproj/xcshareddata/xcschemes/MacUnitTest.xcscheme create mode 100644 DTCoreText.xcodeproj/xcshareddata/xcschemes/UnitTest.xcscheme diff --git a/DTCoreText.xcodeproj/xcshareddata/xcschemes/DemoApp.xcscheme b/DTCoreText.xcodeproj/xcshareddata/xcschemes/DemoApp.xcscheme new file mode 100644 index 000000000..5b097a03e --- /dev/null +++ b/DTCoreText.xcodeproj/xcshareddata/xcschemes/DemoApp.xcscheme @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DTCoreText.xcodeproj/xcshareddata/xcschemes/MacUnitTest.xcscheme b/DTCoreText.xcodeproj/xcshareddata/xcschemes/MacUnitTest.xcscheme new file mode 100644 index 000000000..b9cefa2c0 --- /dev/null +++ b/DTCoreText.xcodeproj/xcshareddata/xcschemes/MacUnitTest.xcscheme @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DTCoreText.xcodeproj/xcshareddata/xcschemes/UnitTest.xcscheme b/DTCoreText.xcodeproj/xcshareddata/xcschemes/UnitTest.xcscheme new file mode 100644 index 000000000..e94fc7a5a --- /dev/null +++ b/DTCoreText.xcodeproj/xcshareddata/xcschemes/UnitTest.xcscheme @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + From ba35ecbc8775bc0aaccf56b2084326b9f9b65d0d Mon Sep 17 00:00:00 2001 From: Oliver Drobnik Date: Fri, 30 Aug 2013 21:48:52 +0200 Subject: [PATCH 12/23] Corrected DemoApp deployment target to 4.3 --- DTCoreText.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DTCoreText.xcodeproj/project.pbxproj b/DTCoreText.xcodeproj/project.pbxproj index fd8291e33..502f2c98a 100644 --- a/DTCoreText.xcodeproj/project.pbxproj +++ b/DTCoreText.xcodeproj/project.pbxproj @@ -3170,7 +3170,7 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = /usr/include/libxml2; - IPHONEOS_DEPLOYMENT_TARGET = 4.2; + IPHONEOS_DEPLOYMENT_TARGET = 4.3; MACOSX_DEPLOYMENT_TARGET = 10.7; SDKROOT = iphoneos; USER_HEADER_SEARCH_PATHS = "\"$(SRCROOT)/Core/Source\""; @@ -3188,7 +3188,7 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = /usr/include/libxml2; - IPHONEOS_DEPLOYMENT_TARGET = 4.2; + IPHONEOS_DEPLOYMENT_TARGET = 4.3; MACOSX_DEPLOYMENT_TARGET = 10.7; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; SDKROOT = iphoneos; From 16f01a8dfce07f6dffe18544cc512bf772c86a91 Mon Sep 17 00:00:00 2001 From: Oliver Drobnik Date: Fri, 30 Aug 2013 21:56:42 +0200 Subject: [PATCH 13/23] Removed release code signing for Travis-CI --- DTCoreText.xcodeproj/project.pbxproj | 2 ++ .../xcshareddata/xcschemes/DemoApp.xcscheme | 30 +++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/DTCoreText.xcodeproj/project.pbxproj b/DTCoreText.xcodeproj/project.pbxproj index 502f2c98a..82534df39 100644 --- a/DTCoreText.xcodeproj/project.pbxproj +++ b/DTCoreText.xcodeproj/project.pbxproj @@ -2838,6 +2838,8 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; COPY_PHASE_STRIP = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Demo/DemoApp-Prefix.pch"; diff --git a/DTCoreText.xcodeproj/xcshareddata/xcschemes/DemoApp.xcscheme b/DTCoreText.xcodeproj/xcshareddata/xcschemes/DemoApp.xcscheme index 5b097a03e..4142117aa 100644 --- a/DTCoreText.xcodeproj/xcshareddata/xcschemes/DemoApp.xcscheme +++ b/DTCoreText.xcodeproj/xcshareddata/xcschemes/DemoApp.xcscheme @@ -28,6 +28,36 @@ shouldUseLaunchSchemeArgsEnv = "YES" buildConfiguration = "Debug"> + + + + + + + + + + + + Date: Fri, 30 Aug 2013 21:57:47 +0200 Subject: [PATCH 14/23] Try xcode_sdk: iphonesimulator for Travis-CI --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index c3f4dc3be..ccfbf51ca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1 +1,2 @@ language: objective-c +xcode_sdk: iphonesimulator From 1bfd6e76c1a7332651e2d36d281aacd2957d0b4d Mon Sep 17 00:00:00 2001 From: Oliver Drobnik Date: Fri, 30 Aug 2013 21:58:59 +0200 Subject: [PATCH 15/23] Try a schema for Travis-CI --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index ccfbf51ca..16ab73cdc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,2 +1,3 @@ language: objective-c xcode_sdk: iphonesimulator +scheme: DemoApp From ff0f14de334a093ea1b1c92a9eb0c7c9507fef36 Mon Sep 17 00:00:00 2001 From: Oliver Drobnik Date: Fri, 30 Aug 2013 22:03:05 +0200 Subject: [PATCH 16/23] restored code signing --- DTCoreText.xcodeproj/project.pbxproj | 2 -- 1 file changed, 2 deletions(-) diff --git a/DTCoreText.xcodeproj/project.pbxproj b/DTCoreText.xcodeproj/project.pbxproj index 82534df39..502f2c98a 100644 --- a/DTCoreText.xcodeproj/project.pbxproj +++ b/DTCoreText.xcodeproj/project.pbxproj @@ -2838,8 +2838,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; COPY_PHASE_STRIP = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Demo/DemoApp-Prefix.pch"; From 82fdcd62ef21ad47ab0262d938c3c7757b7c9f3a Mon Sep 17 00:00:00 2001 From: Oliver Drobnik Date: Fri, 30 Aug 2013 22:10:54 +0200 Subject: [PATCH 17/23] Try xctool for building --- .travis.yml | 8 +++++--- Travis-CI/before_script.sh | 5 +++++ Travis-CI/script.sh | 4 ++++ 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 Travis-CI/before_script.sh create mode 100644 Travis-CI/script.sh diff --git a/.travis.yml b/.travis.yml index 16ab73cdc..1cf903b49 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,5 @@ -language: objective-c -xcode_sdk: iphonesimulator -scheme: DemoApp +--- + language: objective-c + + before_script: Travis-CI/before_script.sh + script: Travis-CI/script.sh diff --git a/Travis-CI/before_script.sh b/Travis-CI/before_script.sh new file mode 100644 index 000000000..45b429fa9 --- /dev/null +++ b/Travis-CI/before_script.sh @@ -0,0 +1,5 @@ +#!/bin/sh +set -e + +brew update +brew install xctool diff --git a/Travis-CI/script.sh b/Travis-CI/script.sh new file mode 100644 index 000000000..08121d0dd --- /dev/null +++ b/Travis-CI/script.sh @@ -0,0 +1,4 @@ +#!/bin/sh +set -e + +xctool -scheme DemoApp build test From cc7edba21904b3b2d72e9f8ce195dbc7ae291576 Mon Sep 17 00:00:00 2001 From: Oliver Drobnik Date: Fri, 30 Aug 2013 22:14:23 +0200 Subject: [PATCH 18/23] chmod +x --- Travis-CI/before_script.sh | 0 Travis-CI/script.sh | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 Travis-CI/before_script.sh mode change 100644 => 100755 Travis-CI/script.sh diff --git a/Travis-CI/before_script.sh b/Travis-CI/before_script.sh old mode 100644 new mode 100755 diff --git a/Travis-CI/script.sh b/Travis-CI/script.sh old mode 100644 new mode 100755 From 37343b27858ce8f22ca97140f71adf58f0568277 Mon Sep 17 00:00:00 2001 From: Oliver Drobnik Date: Fri, 30 Aug 2013 22:17:51 +0200 Subject: [PATCH 19/23] apparently I don't need to install xctool --- .travis.yml | 1 - Travis-CI/before_script.sh | 5 ----- 2 files changed, 6 deletions(-) delete mode 100755 Travis-CI/before_script.sh diff --git a/.travis.yml b/.travis.yml index 1cf903b49..d593d2f96 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,4 @@ --- language: objective-c - before_script: Travis-CI/before_script.sh script: Travis-CI/script.sh diff --git a/Travis-CI/before_script.sh b/Travis-CI/before_script.sh deleted file mode 100755 index 45b429fa9..000000000 --- a/Travis-CI/before_script.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -set -e - -brew update -brew install xctool From 3329f0c50e665c39147e82935d09d3fde1f6b529 Mon Sep 17 00:00:00 2001 From: Oliver Drobnik Date: Fri, 30 Aug 2013 22:20:52 +0200 Subject: [PATCH 20/23] add project to xctool parameters --- Travis-CI/script.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Travis-CI/script.sh b/Travis-CI/script.sh index 08121d0dd..fc48abc85 100755 --- a/Travis-CI/script.sh +++ b/Travis-CI/script.sh @@ -1,4 +1,4 @@ #!/bin/sh set -e -xctool -scheme DemoApp build test +xctool project DTCoreText.xcodeproj -scheme DemoApp build test From 6c016ae2b10e76806285644d9212cc86127f8ed0 Mon Sep 17 00:00:00 2001 From: Oliver Drobnik Date: Fri, 30 Aug 2013 22:25:55 +0200 Subject: [PATCH 21/23] Added sdk and arch --- Travis-CI/script.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Travis-CI/script.sh b/Travis-CI/script.sh index fc48abc85..26869771b 100755 --- a/Travis-CI/script.sh +++ b/Travis-CI/script.sh @@ -1,4 +1,4 @@ #!/bin/sh set -e -xctool project DTCoreText.xcodeproj -scheme DemoApp build test +xctool project DTCoreText.xcodeproj -scheme DemoApp build test -sdk iphonesimulator -arch i386 From 3a1e07a521e2a5d1a8178cc178ca6abd80d431f6 Mon Sep 17 00:00:00 2001 From: Oliver Drobnik Date: Fri, 30 Aug 2013 22:30:17 +0200 Subject: [PATCH 22/23] removed Mac Test from unit test --- .../xcshareddata/xcschemes/DemoApp.xcscheme | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/DTCoreText.xcodeproj/xcshareddata/xcschemes/DemoApp.xcscheme b/DTCoreText.xcodeproj/xcshareddata/xcschemes/DemoApp.xcscheme index 4142117aa..1e508d0d2 100644 --- a/DTCoreText.xcodeproj/xcshareddata/xcschemes/DemoApp.xcscheme +++ b/DTCoreText.xcodeproj/xcshareddata/xcschemes/DemoApp.xcscheme @@ -28,16 +28,6 @@ shouldUseLaunchSchemeArgsEnv = "YES" buildConfiguration = "Debug"> - - - - - - - - Date: Fri, 30 Aug 2013 22:35:00 +0200 Subject: [PATCH 23/23] Try also to execute MacUnitTest --- Travis-CI/script.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/Travis-CI/script.sh b/Travis-CI/script.sh index 26869771b..ab679e10f 100755 --- a/Travis-CI/script.sh +++ b/Travis-CI/script.sh @@ -2,3 +2,4 @@ set -e xctool project DTCoreText.xcodeproj -scheme DemoApp build test -sdk iphonesimulator -arch i386 +xctool project DTCoreText.xcodeproj -scheme MacUnitTest test