From 18671865037e74ae83262d9d177dd77b49449a15 Mon Sep 17 00:00:00 2001 From: ozinthecloud Date: Sun, 24 May 2015 21:21:30 +1000 Subject: [PATCH 01/13] fix bug in date formatting see http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns (this bug is rumored to have brought down Twitter last December) --- .../ACCodeSnippetRepositoryConfigurationWindowController.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ACCodeSnippetRepository/Controllers/ACCodeSnippetRepositoryConfigurationWindowController.m b/ACCodeSnippetRepository/Controllers/ACCodeSnippetRepositoryConfigurationWindowController.m index 104a5d1..3467dd5 100644 --- a/ACCodeSnippetRepository/Controllers/ACCodeSnippetRepositoryConfigurationWindowController.m +++ b/ACCodeSnippetRepository/Controllers/ACCodeSnippetRepositoryConfigurationWindowController.m @@ -270,7 +270,7 @@ - (NSString*)pathForSnippetDirectory { - (NSString*)pathForBackupDirectory { NSDate *currentDate = [NSDate date]; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; - [dateFormatter setDateFormat:@"YYMMdd-HHmm"]; + [dateFormatter setDateFormat:@"yyMMdd-HHmm"]; return [NSString pathWithComponents:@[self.pathForSnippetDirectory, [NSString stringWithFormat:@"backup-%@", [dateFormatter stringFromDate:currentDate]]]]; } From ecbe037a66cf96a706b7186d698dcbcda264af85 Mon Sep 17 00:00:00 2001 From: ozinthecloud Date: Sun, 24 May 2015 21:34:59 +1000 Subject: [PATCH 02/13] fix image clipping warning - move github images to xcassets catalogue --- .../project.pbxproj | 26 ++++-------------- ...epositoryConfigurationWindowController.xib | 4 +-- .../GitHubImage.imageset/Contents.json | 23 ++++++++++++++++ .../GitHub-Mark-120px-plus.png | Bin 0 -> 4268 bytes .../GitHubImage.imageset/GitHub-Mark-32px.png | Bin 0 -> 1714 bytes .../GitHubImage.imageset/GitHub-Mark-64px.png | Bin 0 -> 2625 bytes 6 files changed, 31 insertions(+), 22 deletions(-) create mode 100644 ACCodeSnippetRepository/Resources/Images.xcassets/GitHubImage.imageset/Contents.json create mode 100644 ACCodeSnippetRepository/Resources/Images.xcassets/GitHubImage.imageset/GitHub-Mark-120px-plus.png create mode 100644 ACCodeSnippetRepository/Resources/Images.xcassets/GitHubImage.imageset/GitHub-Mark-32px.png create mode 100644 ACCodeSnippetRepository/Resources/Images.xcassets/GitHubImage.imageset/GitHub-Mark-64px.png diff --git a/ACCodeSnippetRepository.xcodeproj/project.pbxproj b/ACCodeSnippetRepository.xcodeproj/project.pbxproj index b052723..9e21f90 100644 --- a/ACCodeSnippetRepository.xcodeproj/project.pbxproj +++ b/ACCodeSnippetRepository.xcodeproj/project.pbxproj @@ -7,6 +7,8 @@ objects = { /* Begin PBXBuildFile section */ + 012836131B11EC41007236B8 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 012836121B11EC41007236B8 /* Images.xcassets */; }; + 012836141B11EC41007236B8 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 012836121B11EC41007236B8 /* Images.xcassets */; }; 51010E0218AC5CB1000AA1F1 /* ACGitRepository.m in Sources */ = {isa = PBXBuildFile; fileRef = 51010E0118AC5CB1000AA1F1 /* ACGitRepository.m */; }; 51010E0318AC5CB1000AA1F1 /* ACGitRepository.m in Sources */ = {isa = PBXBuildFile; fileRef = 51010E0118AC5CB1000AA1F1 /* ACGitRepository.m */; }; 5105B22718AC59520066728E /* NSTask+Extras.m in Sources */ = {isa = PBXBuildFile; fileRef = 5105B22618AC59520066728E /* NSTask+Extras.m */; }; @@ -18,9 +20,6 @@ 5153BAAC18B3410C00C1E75B /* NSDictionary+MergeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5153BAAB18B3410C00C1E75B /* NSDictionary+MergeTests.m */; }; 5154068518AC4B500065CA33 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5154068418AC4B500065CA33 /* SenTestingKit.framework */; }; 5154068B18AC4B500065CA33 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 5154068918AC4B500065CA33 /* InfoPlist.strings */; }; - 515CE9DA18B1DCAA000962EA /* GitHub-Mark-120px-plus.png in Resources */ = {isa = PBXBuildFile; fileRef = 515CE9D718B1DCAA000962EA /* GitHub-Mark-120px-plus.png */; }; - 515CE9DB18B1DCAA000962EA /* GitHub-Mark-32px.png in Resources */ = {isa = PBXBuildFile; fileRef = 515CE9D818B1DCAA000962EA /* GitHub-Mark-32px.png */; }; - 515CE9DC18B1DCAA000962EA /* GitHub-Mark-64px.png in Resources */ = {isa = PBXBuildFile; fileRef = 515CE9D918B1DCAA000962EA /* GitHub-Mark-64px.png */; }; 5162AC2A18AD9FD0000109C9 /* ACCodeSnippetRepositoryConfigurationWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5162AC2818AD9FD0000109C9 /* ACCodeSnippetRepositoryConfigurationWindowController.m */; }; 5162AC2B18AD9FD0000109C9 /* ACCodeSnippetRepositoryConfigurationWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5162AC2918AD9FD0000109C9 /* ACCodeSnippetRepositoryConfigurationWindowController.xib */; }; 517DF2A618AC4BF1008980B3 /* IDECodeSnippetRepositorySwizzler.m in Sources */ = {isa = PBXBuildFile; fileRef = 517DF2A318AC4BF1008980B3 /* IDECodeSnippetRepositorySwizzler.m */; }; @@ -51,6 +50,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 012836121B11EC41007236B8 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 51010E0018AC5CB1000AA1F1 /* ACGitRepository.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ACGitRepository.h; sourceTree = ""; }; 51010E0118AC5CB1000AA1F1 /* ACGitRepository.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ACGitRepository.m; sourceTree = ""; }; 5105B22518AC59520066728E /* NSTask+Extras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSTask+Extras.h"; sourceTree = ""; }; @@ -65,9 +65,6 @@ 5154068818AC4B500065CA33 /* ACCodeSnippetRepository Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ACCodeSnippetRepository Tests-Info.plist"; sourceTree = ""; }; 5154068A18AC4B500065CA33 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 5154068E18AC4B500065CA33 /* ACCodeSnippetRepository Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ACCodeSnippetRepository Tests-Prefix.pch"; sourceTree = ""; }; - 515CE9D718B1DCAA000962EA /* GitHub-Mark-120px-plus.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "GitHub-Mark-120px-plus.png"; sourceTree = ""; }; - 515CE9D818B1DCAA000962EA /* GitHub-Mark-32px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "GitHub-Mark-32px.png"; sourceTree = ""; }; - 515CE9D918B1DCAA000962EA /* GitHub-Mark-64px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "GitHub-Mark-64px.png"; sourceTree = ""; }; 5162AC2718AD9FD0000109C9 /* ACCodeSnippetRepositoryConfigurationWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ACCodeSnippetRepositoryConfigurationWindowController.h; sourceTree = ""; }; 5162AC2818AD9FD0000109C9 /* ACCodeSnippetRepositoryConfigurationWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ACCodeSnippetRepositoryConfigurationWindowController.m; sourceTree = ""; }; 5162AC2918AD9FD0000109C9 /* ACCodeSnippetRepositoryConfigurationWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ACCodeSnippetRepositoryConfigurationWindowController.xib; sourceTree = ""; }; @@ -145,21 +142,11 @@ 515CE9D518B1DCAA000962EA /* Resources */ = { isa = PBXGroup; children = ( - 515CE9D618B1DCAA000962EA /* Images */, + 012836121B11EC41007236B8 /* Images.xcassets */, ); path = Resources; sourceTree = ""; }; - 515CE9D618B1DCAA000962EA /* Images */ = { - isa = PBXGroup; - children = ( - 515CE9D718B1DCAA000962EA /* GitHub-Mark-120px-plus.png */, - 515CE9D818B1DCAA000962EA /* GitHub-Mark-32px.png */, - 515CE9D918B1DCAA000962EA /* GitHub-Mark-64px.png */, - ); - path = Images; - sourceTree = ""; - }; 5162AC2618AD9FB4000109C9 /* Controllers */ = { isa = PBXGroup; children = ( @@ -376,6 +363,7 @@ buildActionMask = 2147483647; files = ( 5154068B18AC4B500065CA33 /* InfoPlist.strings in Resources */, + 012836141B11EC41007236B8 /* Images.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -383,11 +371,9 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 515CE9DC18B1DCAA000962EA /* GitHub-Mark-64px.png in Resources */, - 515CE9DB18B1DCAA000962EA /* GitHub-Mark-32px.png in Resources */, 5162AC2B18AD9FD0000109C9 /* ACCodeSnippetRepositoryConfigurationWindowController.xib in Resources */, + 012836131B11EC41007236B8 /* Images.xcassets in Resources */, 518E69AB18AC4A8900C57456 /* InfoPlist.strings in Resources */, - 515CE9DA18B1DCAA000962EA /* GitHub-Mark-120px-plus.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/ACCodeSnippetRepository/Controllers/ACCodeSnippetRepositoryConfigurationWindowController.xib b/ACCodeSnippetRepository/Controllers/ACCodeSnippetRepositoryConfigurationWindowController.xib index f87b810..7eb3334 100644 --- a/ACCodeSnippetRepository/Controllers/ACCodeSnippetRepositoryConfigurationWindowController.xib +++ b/ACCodeSnippetRepository/Controllers/ACCodeSnippetRepositoryConfigurationWindowController.xib @@ -129,7 +129,7 @@ https://github.com/acoomans/ACCodeSnippetRepositoryPlugin - + @@ -257,6 +257,6 @@ https://github.com/acoomans/ACCodeSnippetRepositoryPlugin - + diff --git a/ACCodeSnippetRepository/Resources/Images.xcassets/GitHubImage.imageset/Contents.json b/ACCodeSnippetRepository/Resources/Images.xcassets/GitHubImage.imageset/Contents.json new file mode 100644 index 0000000..6d811ad --- /dev/null +++ b/ACCodeSnippetRepository/Resources/Images.xcassets/GitHubImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "GitHub-Mark-32px.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "GitHub-Mark-64px.png" + }, + { + "idiom" : "universal", + "scale" : "3x", + "filename" : "GitHub-Mark-120px-plus.png" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ACCodeSnippetRepository/Resources/Images.xcassets/GitHubImage.imageset/GitHub-Mark-120px-plus.png b/ACCodeSnippetRepository/Resources/Images.xcassets/GitHubImage.imageset/GitHub-Mark-120px-plus.png new file mode 100644 index 0000000000000000000000000000000000000000..ea6ff545a246caa64074ba809bbc86fcb8589071 GIT binary patch literal 4268 zcmaJ_c|25m+@2YcEGe=tO+zT_42H4qTL_VT8D=nHX3PwRki9HfBH7BIQ7JCj_beeI z(PA%IQuZumf5*MI`@VnN`<~A^=eL~adA{p8f1EgTGXqv8J|+MFz-nZuYe^f)M;9Xl z?T$df2WbN@Nzaya1?NEuL=w;dEfmfT4L0&cdZI1SNK}yDE3_&AKqrE+vL)G?nkc*D ze5H{`7-_OEp2h|MR5i$Wq`Nno1a?DvVz6qEm4+4w7=u!S*eICFn&NfPUKqn*0{Tj@ znU#C6w>ts_(NG7gl9g!!zGxB>O!oD`5|znnkUw>mY4f9P83_1K2+3Ow@|RP#rsiNB z903hhkd~8jmxV&XaJV#7UI7k=N`hgsP?(G??SxA~<&_oS$}mOn-v@+djezn{w$#=C z+ZJu52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@n;< zRNIc6&UJhY@?%IVdD-=xjGWJqn^0=jZBU)tv{v1U7ED&2v5=oi(iJ2&r=CAe0V;*$ zW$8S9fv(wveNqLlBQuhxlIr{{L<<*+21HMjNzwF5+p`Q`+5~JF9k>|vUCpaTL{(Py zw>le+8;vV|Ci0p)i8;A|+2>n*&Llb{e1az3q!#5`h2t?5>RN5A0%e*-$ySQrj$M&HIK~a9W)6d?W8J*D|_Nsk$ zGP@D92-<(_m%Dt`w&=aK1L=et-x-8!#A~nMjd>p5y_E~xqvBa(g-xz$rbrZzJy}@V zMDqqtV5Q@0Jnd^ZegdA!J_j+KUwf*Q89r!GpX^tCjM-_vCiKDr%LHG*Tq?b|4*FY1 zr|I5VzQbkN?NfI!QSV9w{6i7N+PZuZNn#B7s)KDhPO1TQJe zZL1UgBIOOdRP;I*>7?O<3ezgLDn5OQ67L#>r1#{bKe8hz0Pg XLyRvu{aX3a{{tgEGu={c*U0|?Dtn-9 literal 0 HcmV?d00001 diff --git a/ACCodeSnippetRepository/Resources/Images.xcassets/GitHubImage.imageset/GitHub-Mark-32px.png b/ACCodeSnippetRepository/Resources/Images.xcassets/GitHubImage.imageset/GitHub-Mark-32px.png new file mode 100644 index 0000000000000000000000000000000000000000..8b25551a97921681334176ee143b41510a117d86 GIT binary patch literal 1714 zcmaJ?X;2eq7*4oFu!ne{XxAht2qc?8LXr|_LPCfTpaBK7K$c{I0Ld=NLIOeuC;@2) zZ$K%a)k+m-s0>xHmKxL%0V&0TRzzznhgyqrIC$F)0{WwLXLrBvd*^wc_uSc%h%m9E z{W5z3f#4_!7RvAyFh6!S_*<8qJ%KOIm?#E|L=rJQq=gB5C6WLG5;c?r%V0>EmEH#X z5eSwPRa6WXBMs#$5H%GtW2go-in9p>zW@UYDNNWc^XOXZQ? z1QjEV00I#$3^1wQUJ8&-2UsjB-G|9y(LDhMNN3PM{APL4eYi{(m*ERcUnJa{R+-3^ z34^A6;U^v`8N*O6ji%S@sd{fJqD`XFIUJ5zgTe5^5nj414F(y!G&=H(f)Lgzv?>%+ zAsWD}2qhpH7>|TU`X&W6IxDNuO_vET7|j5oG&&VDr!)hUO8+0KR?nh!m<)a!?|%yG zqOwq!CWCcIhE{<$E|F|@g>nP6FoYr6C<8>D?ID9%&5J(4oSbR1I^byW*g@__U z4QsF&uJSEcFeleM3~ChjEQGbHOjsGDMbyAl(p=Ttv9RaVo8~I#js@@Y9C^_2U})yn zzSHU%6FxuY?d;&65MyR({^lU*3$z$ZllDb(o&<7d;A_`h2U+3~BJ2Hv`{W}KEU801#cv_B|9Cm!ynR{S`AMsSn z;7E=B;mb!wx$L;S>yGXG^6=&WlQn9$s?&L%Y1D8TI^MlKB1DqsEng$>f4=xYWBoPI z_S1p!sJ#d2?YI4kPA{k}Eby?F=f-J9zIc`YDl^pzjVm~9ebE?Hn?t0Nx+la|D0MB; z9)2xv1G>a1|A9kQ>~DV<=X3-4yC&n!m8-3K#P z{X@0zRuQsy$+N ziSCoLJU{Z$nQy4A4Y5UJ07$5FA~qL2%Q+cLaqDU?Lz3?=BC5;Nk6BbTmmceEaM>-Z zi>O&-dSE=%ex;vcvCOk{*JQ5^_4M z4lW7%l9IqY(z7pV(?I@@8=KPFO82)O{VDI18-*d-k$YmI^XiuPs_LuFw<^ZcD}yP5 c*NrbeloN*74g`U%%F6r~k%+>C^#XapzmV0H-2eap literal 0 HcmV?d00001 diff --git a/ACCodeSnippetRepository/Resources/Images.xcassets/GitHubImage.imageset/GitHub-Mark-64px.png b/ACCodeSnippetRepository/Resources/Images.xcassets/GitHubImage.imageset/GitHub-Mark-64px.png new file mode 100644 index 0000000000000000000000000000000000000000..182a1a3f734fc1b7d712c68b04c29bad9460d6cd GIT binary patch literal 2625 zcmaJ@dpuNWA3rl=+=}acf|9E@P=bZCA&+qg7et*|Lo`cMQ4SL!u zv;hFnqx;f=RIA70r>U;`S924)Rm*a*H%lB0$B2{JLJ07ThNB>m&SUR{f*^KuO5#1p z6#!6H+z^(S#qg(aU>=seh`~yD0u>toT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^@j}^G0H9KoHh*`OVvLl5^wL?J< z7)$I5W&Q|c2#?m>)|0U<*(h6S(odPBl0+QpHsP-r8hDCI;Xy;ZB-GTjC{Lh z)^{?@)XZUvU2)|rYeZga0RK+{;)>14TJ^#VgLD29(mB!`H~7S*Fw{zJ%hPczWn=cg z8jH%4)vX%o*KhVWOn7IlqI@$mJZW&H8;wZubZI_Uwrk`&rADaRwb@W?@%Lq;XVYdZ zzbfh08?cyaez+qbJi_UZNiw(*%k&9+amj>L{ED$OWuQs3t3SxwFrj;;X7JtUOggr3 z9_gyPyNb>f4!Q6KY~O5*EcJ8lx!Eo+mu1XJ+Yaf*g#ElRyLa`VS#Nr;#Tl#HQCW>m z{&_c0soAKyl5Hh_n6KLo+?X66U)GDrzLZ!MuKsS1=~Z-jmeYyn9r@L5{%zdITF>DU zc(z0NN5gMd71f1LPTcD_?PI}M(r1raF|bl_rTXz3>u}j*j^Bmd){0~OhHAcdT%96T zl^I$j>vYCuJ?O7Db;K6G{^kavEh#naE`IOB!FIb6?Rl2b>{14>p?RueVYk~ro9y;T zIrcx#*ZIGkiL#&hR%UZ~U8&hb7!h+vGUz&Kgw@+NpF@^rzAM$3da`Mn#XcKJdEb+n z%Ja~1JE|B-plr+1ckkS)J%8tndxzxYNf*b|;HiBz2ekdat!a4bi8!V6uKj*dC6Dra z#ewE=I4u9YXWc$ zFQ)EwjtXc}@pjCV#OF{`{F&M=E0)#J@Tkkfv83XA7q4{3`Po^?`^#!I#t(`mS z?yFbdpa!*s0@tn$0{aDCQgU)Bq;savHLt4{2qzE7+ W4I>>0bz>}E>ge79v Date: Sun, 24 May 2015 22:00:27 +1000 Subject: [PATCH 03/13] change fork with clone, and import with export, also change some button and message text to improve clarity --- .../ACGitRepositoryTests.m | 2 +- .../Classes/ACGitRepository.h | 2 +- .../Classes/ACGitRepository.m | 2 +- .../DataStores/ACCodeSnippetGitDataStore.m | 6 +- ...tRepositoryConfigurationWindowController.h | 2 +- ...tRepositoryConfigurationWindowController.m | 24 +++---- ...epositoryConfigurationWindowController.xib | 62 +++++++------------ README.md | 8 +-- 8 files changed, 47 insertions(+), 61 deletions(-) diff --git a/ACCodeSnippetRepository Tests/ACGitRepositoryTests.m b/ACCodeSnippetRepository Tests/ACGitRepositoryTests.m index 01c7061..3734921 100644 --- a/ACCodeSnippetRepository Tests/ACGitRepositoryTests.m +++ b/ACCodeSnippetRepository Tests/ACGitRepositoryTests.m @@ -23,7 +23,7 @@ - (void)testExample { ACGitRepository *git = [[ACGitRepository alloc] initWithLocalRepositoryDirectory:gitPath]; - //[git forkRemoteRepositoryWithURL:gitURL inDirectory:gitPath]; + //[git cloneRemoteRepositoryWithURL:gitURL inDirectory:gitPath]; //[git removeLocalRepository]; //NSLog(@"%@", [git identifierForCurrentCommit]); //NSLog(@"%@", [git changedFilesSinceCommitWithIdentifier:@"HEAD~6"]); diff --git a/ACCodeSnippetRepository/Classes/ACGitRepository.h b/ACCodeSnippetRepository/Classes/ACGitRepository.h index c16c951..9c84169 100644 --- a/ACCodeSnippetRepository/Classes/ACGitRepository.h +++ b/ACCodeSnippetRepository/Classes/ACGitRepository.h @@ -29,7 +29,7 @@ extern NSString * const ACGitRepositoryFileChangeUnmergedKey; - (void)initializeLocalRepository; - (void)initializeLocalRepositoryInDirectory:(NSString*)localRepositoryPath; -- (void)forkRemoteRepositoryWithURL:(NSURL*)remoteRepositoryURL inDirectory:(NSString*)localRepositoryPath; +- (void)cloneRemoteRepositoryWithURL:(NSURL*)remoteRepositoryURL inDirectory:(NSString*)localRepositoryPath; - (NSString*)identifierForCurrentCommit; diff --git a/ACCodeSnippetRepository/Classes/ACGitRepository.m b/ACCodeSnippetRepository/Classes/ACGitRepository.m index dd6a579..5329f2d 100644 --- a/ACCodeSnippetRepository/Classes/ACGitRepository.m +++ b/ACCodeSnippetRepository/Classes/ACGitRepository.m @@ -86,7 +86,7 @@ - (void)initializeLocalRepositoryInDirectory:(NSString*)localRepositoryPath { } } -- (void)forkRemoteRepositoryWithURL:(NSURL*)remoteRepositoryURL inDirectory:(NSString*)localRepositoryPath { +- (void)cloneRemoteRepositoryWithURL:(NSURL*)remoteRepositoryURL inDirectory:(NSString*)localRepositoryPath { if ( ![[NSFileManager defaultManager] fileExistsAtPath:localRepositoryPath] && remoteRepositoryURL) { diff --git a/ACCodeSnippetRepository/Classes/DataStores/ACCodeSnippetGitDataStore.m b/ACCodeSnippetRepository/Classes/DataStores/ACCodeSnippetGitDataStore.m index 588b553..adecf17 100644 --- a/ACCodeSnippetRepository/Classes/DataStores/ACCodeSnippetGitDataStore.m +++ b/ACCodeSnippetRepository/Classes/DataStores/ACCodeSnippetGitDataStore.m @@ -21,7 +21,7 @@ - (instancetype)init { - (id)initWithRemoteRepositoryURL:(NSURL*)remoteRepositoryURL { ACGitRepository *gitRepository = [[ACGitRepository alloc] initWithLocalRepositoryDirectory:self.localRepositoryPath]; if (remoteRepositoryURL && !gitRepository.localRepositoryExists) { - [gitRepository forkRemoteRepositoryWithURL:remoteRepositoryURL inDirectory:self.localRepositoryPath]; + [gitRepository cloneRemoteRepositoryWithURL:remoteRepositoryURL inDirectory:self.localRepositoryPath]; } return [self initWithGitRepository:gitRepository]; } @@ -58,7 +58,7 @@ - (void)setRemoteRepositoryURL:(NSURL *)remoteRepositoryURL { - (void)dataStoreWillAdd { NSLog(@"%@ dataStoreWillAdd", self); if (![self.gitRepository localRepositoryExists]) { - [self.gitRepository forkRemoteRepositoryWithURL:self.remoteRepositoryURL inDirectory:self.localRepositoryPath]; + [self.gitRepository cloneRemoteRepositoryWithURL:self.remoteRepositoryURL inDirectory:self.localRepositoryPath]; } } @@ -158,7 +158,7 @@ - (void)exportAllCodeSnippets { for (IDECodeSnippet *snippet in codeSnippetRepository.codeSnippets) { [self addFileInLocalRepositoryForSnippet:snippet overwrite:NO]; } - [self.gitRepository commitWithMessage:@"Imported user code snippets"]; + [self.gitRepository commitWithMessage:@"Pushed user code snippets"]; [self.gitRepository push]; } diff --git a/ACCodeSnippetRepository/Controllers/ACCodeSnippetRepositoryConfigurationWindowController.h b/ACCodeSnippetRepository/Controllers/ACCodeSnippetRepositoryConfigurationWindowController.h index 1c60f22..596a4b9 100644 --- a/ACCodeSnippetRepository/Controllers/ACCodeSnippetRepositoryConfigurationWindowController.h +++ b/ACCodeSnippetRepository/Controllers/ACCodeSnippetRepositoryConfigurationWindowController.h @@ -24,7 +24,7 @@ extern NSString * const ACCodeSnippetRepositoryUpdateRegularlyKey; @property (nonatomic, weak) id delegate; @property (nonatomic, weak) IBOutlet NSTextField *remoteRepositoryTextfield; -@property (nonatomic, weak) IBOutlet NSButton *forkRemoteRepositoryButton; +@property (nonatomic, weak) IBOutlet NSButton *cloneRemoteRepositoryButton; @property (nonatomic, weak) IBOutlet NSButton *importButton; @property (nonatomic, weak) IBOutlet NSPanel *progressPanel; diff --git a/ACCodeSnippetRepository/Controllers/ACCodeSnippetRepositoryConfigurationWindowController.m b/ACCodeSnippetRepository/Controllers/ACCodeSnippetRepositoryConfigurationWindowController.m index 104a5d1..5483705 100644 --- a/ACCodeSnippetRepository/Controllers/ACCodeSnippetRepositoryConfigurationWindowController.m +++ b/ACCodeSnippetRepository/Controllers/ACCodeSnippetRepositoryConfigurationWindowController.m @@ -58,9 +58,9 @@ - (void)controlTextDidChange:(NSNotification *)notification { NSTextField *textField = [notification object]; if (![[NSURL URLWithString:textField.stringValue] isEqualTo:self.gitDataStore.remoteRepositoryURL]) { - self.forkRemoteRepositoryButton.enabled = YES; + self.cloneRemoteRepositoryButton.enabled = YES; } else { - self.forkRemoteRepositoryButton.enabled = NO; + self.cloneRemoteRepositoryButton.enabled = NO; } if ([textField.stringValue length]) { @@ -77,13 +77,13 @@ - (IBAction)updateCheckboxAction:(NSButton*)button { } -- (IBAction)forkRemoteRepositoryAction:(id)sender { - - NSAlert *alert = [NSAlert alertWithMessageText:[NSString stringWithFormat:@"Do you want to fork %@?", self.remoteRepositoryTextfield.stringValue] - defaultButton:@"Fork" +- (IBAction)cloneRemoteRepositoryAction:(id)sender { + + NSAlert *alert = [NSAlert alertWithMessageText:[NSString stringWithFormat:@"Do you want to clone %@?", self.remoteRepositoryTextfield.stringValue] + defaultButton:@"Clone" alternateButton:@"Cancel" otherButton:nil - informativeTextWithFormat:@"This will remove all snippets from the current git repository and replace them with snippets from the new fork."]; + informativeTextWithFormat:@"All snippets from the current git repository will be removed from Xcode and replaced with snippets from the new cloned repository."]; __weak typeof(self)weakSelf = self; [alert beginSheetModalForWindow:self.window completionHandler:^(NSModalResponse returnCode) { @@ -121,7 +121,7 @@ - (IBAction)forkRemoteRepositoryAction:(id)sender { [weakSelf.progressIndicator stopAnimation:weakSelf]; }); - [weakSelf importUserSnippetsAction:weakSelf]; + [weakSelf exportUserSnippetsAction:weakSelf]; }); break; @@ -155,12 +155,12 @@ - (void)backupUserSnippets { } } -- (IBAction)importUserSnippetsAction:(id)sender { - NSAlert *alert = [NSAlert alertWithMessageText:@"Do you want to import your existing user code snippets in the repository?" - defaultButton:@"Import" +- (IBAction)exportUserSnippetsAction:(id)sender { + NSAlert *alert = [NSAlert alertWithMessageText:@"Do you want to export (push) your existing user code snippets to the repository?" + defaultButton:@"Export" alternateButton:@"Cancel" otherButton:nil - informativeTextWithFormat:@"This will import all your user code snippets in the current git repository. System code snippets will not be imported."]; + informativeTextWithFormat:@"This will export all your user code snippets to the current git repository."]; __weak typeof(self)weakSelf = self; diff --git a/ACCodeSnippetRepository/Controllers/ACCodeSnippetRepositoryConfigurationWindowController.xib b/ACCodeSnippetRepository/Controllers/ACCodeSnippetRepositoryConfigurationWindowController.xib index f87b810..e2f0cd0 100644 --- a/ACCodeSnippetRepository/Controllers/ACCodeSnippetRepositoryConfigurationWindowController.xib +++ b/ACCodeSnippetRepository/Controllers/ACCodeSnippetRepositoryConfigurationWindowController.xib @@ -1,12 +1,13 @@ - + - + + - + @@ -16,18 +17,17 @@ - + - - + + - + - @@ -35,8 +35,7 @@ - - + @@ -51,7 +50,6 @@ - - + @@ -70,8 +67,7 @@ - - + Don't hesitate to contribute by submitting pull requests at @@ -81,8 +77,7 @@ https://github.com/acoomans/ACCodeSnippetRepositoryPlugin - - + @@ -90,8 +85,7 @@ https://github.com/acoomans/ACCodeSnippetRepositoryPlugin - @@ -169,8 +157,7 @@ https://github.com/acoomans/ACCodeSnippetRepositoryPlugin @@ -229,19 +215,19 @@ https://github.com/acoomans/ACCodeSnippetRepositoryPlugin + - + - diff --git a/README.md b/README.md index b86219b..f2e01bf 100644 --- a/README.md +++ b/README.md @@ -26,17 +26,17 @@ There should be a `Plug-ins` item in the xcode menu: ![screenshots](Screenshots/screenshot01.png) -First configure the plugin by forking a remote repository: +First configure the plugin by cloning a remote repository: ![screenshots](Screenshots/screenshot02.png) -When you fork, all snippets from the repository (with the right format, see below _Format_) will be imported in Xcode. Your existing snippets, that do not belong to any repository yet, will not be affected. +When you clone, all snippets from the repository (with the right format, see below _Format_) will be imported in Xcode. Your existing snippets, that do not belong to any repository yet, will not be affected. -After forking, you will given the choice to import (user) snippets from Xcode to the repository. +After cloning, you will given the choice to import (user) snippets from Xcode to the repository. Also, you can remove the system snippets if you don't use them. -In case of any problem (see below, _Bugs and limitations_), you can go to the user snippets folder and backup your user snippets. Note that user snippets are automatically backed up before any fork. +In case of any problem (see below, _Bugs and limitations_), you can go to the user snippets folder and backup your user snippets. Note that user snippets are automatically backed up before any clone. ## Usage From 9a45914d535ebe6f4c1770b4287e76804d5bd071 Mon Sep 17 00:00:00 2001 From: ozinthecloud Date: Sun, 24 May 2015 22:45:36 +1000 Subject: [PATCH 04/13] add scheme that allows debuging with breakpoints --- ...ACCodeSnippetRepositoryBreakpoint.xcscheme | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 ACCodeSnippetRepository.xcodeproj/xcshareddata/xcschemes/ACCodeSnippetRepositoryBreakpoint.xcscheme diff --git a/ACCodeSnippetRepository.xcodeproj/xcshareddata/xcschemes/ACCodeSnippetRepositoryBreakpoint.xcscheme b/ACCodeSnippetRepository.xcodeproj/xcshareddata/xcschemes/ACCodeSnippetRepositoryBreakpoint.xcscheme new file mode 100644 index 0000000..720a968 --- /dev/null +++ b/ACCodeSnippetRepository.xcodeproj/xcshareddata/xcschemes/ACCodeSnippetRepositoryBreakpoint.xcscheme @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 1ab6ba5bdc438c3efe2ca31eae10ba81c1dd9ee3 Mon Sep 17 00:00:00 2001 From: Clement Padovani Date: Sun, 26 Jul 2015 16:17:44 +0200 Subject: [PATCH 05/13] Updated ACCodeSnippetRepository Tests to XCTest. --- .../ACCodeSnippetGitDataStoreTests.m | 4 +- .../ACCodeSnippetSerializationTests.m | 40 +++++++++---------- .../ACGitRepositoryTests.m | 4 +- .../NSDictionary+MergeTests.m | 10 ++--- .../project.pbxproj | 15 +++---- 5 files changed, 34 insertions(+), 39 deletions(-) diff --git a/ACCodeSnippetRepository Tests/ACCodeSnippetGitDataStoreTests.m b/ACCodeSnippetRepository Tests/ACCodeSnippetGitDataStoreTests.m index a5adfdc..4a2a2b7 100644 --- a/ACCodeSnippetRepository Tests/ACCodeSnippetGitDataStoreTests.m +++ b/ACCodeSnippetRepository Tests/ACCodeSnippetGitDataStoreTests.m @@ -6,11 +6,11 @@ // Copyright (c) 2014 Arnaud Coomans. All rights reserved. // -#import +#import #import "ACCodeSnippetGitDataStore.h" -@interface ACCodeSnippetGitDataStoreTests : SenTestCase +@interface ACCodeSnippetGitDataStoreTests : XCTestCase @end @implementation ACCodeSnippetGitDataStoreTests diff --git a/ACCodeSnippetRepository Tests/ACCodeSnippetSerializationTests.m b/ACCodeSnippetRepository Tests/ACCodeSnippetSerializationTests.m index 1036ef4..fac0972 100644 --- a/ACCodeSnippetRepository Tests/ACCodeSnippetSerializationTests.m +++ b/ACCodeSnippetRepository Tests/ACCodeSnippetSerializationTests.m @@ -6,10 +6,10 @@ // Copyright (c) 2014 Arnaud Coomans. All rights reserved. // -#import +#import #import "ACCodeSnippetSerialization.h" -@interface ACCodeSnippetSerializationTests : SenTestCase +@interface ACCodeSnippetSerializationTests : XCTestCase @end @implementation ACCodeSnippetSerializationTests @@ -31,14 +31,14 @@ - (void)testSerialize { NSString *string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; NSLog(@"\n%@", string); - STAssertTrue([string rangeOfString:@"title"].location != NSNotFound, nil); - STAssertTrue([string rangeOfString:@"summary"].location != NSNotFound, nil); - STAssertTrue([string rangeOfString:@"line1\nline2\nline3"].location != NSNotFound, nil); - STAssertTrue([string rangeOfString:@"WhateverKey"].location != NSNotFound, nil); - STAssertTrue([string rangeOfString:@"WhateverValue"].location != NSNotFound, nil); + XCTAssertTrue([string rangeOfString:@"title"].location != NSNotFound); + XCTAssertTrue([string rangeOfString:@"summary"].location != NSNotFound); + XCTAssertTrue([string rangeOfString:@"line1\nline2\nline3"].location != NSNotFound); + XCTAssertTrue([string rangeOfString:@"WhateverKey"].location != NSNotFound); + XCTAssertTrue([string rangeOfString:@"WhateverValue"].location != NSNotFound); - STAssertTrue([string rangeOfString:@"one"].location != NSNotFound, nil); - STAssertTrue([string rangeOfString:@"two"].location != NSNotFound, nil); + XCTAssertTrue([string rangeOfString:@"one"].location != NSNotFound); + XCTAssertTrue([string rangeOfString:@"two"].location != NSNotFound); } - (void)testDeserialize { @@ -50,13 +50,13 @@ - (void)testDeserialize { error:nil]; NSLog(@"\n%@", dict); - STAssertTrue([dict[ACCodeSnippetTitleKey] isEqualToString:@"title"], nil); - STAssertTrue([dict[ACCodeSnippetSummaryKey] isEqualToString:@"summary"], nil); - STAssertTrue([dict[ACCodeSnippetContentsKey] isEqualToString:@"line1\nline2\nline3\n"], nil); - STAssertTrue([dict[@"WhateverKey"] isEqualToString:@"WhateverValue"], nil); + XCTAssertTrue([dict[ACCodeSnippetTitleKey] isEqualToString:@"title"]); + XCTAssertTrue([dict[ACCodeSnippetSummaryKey] isEqualToString:@"summary"]); + XCTAssertTrue([dict[ACCodeSnippetContentsKey] isEqualToString:@"line1\nline2\nline3\n"]); + XCTAssertTrue([dict[@"WhateverKey"] isEqualToString:@"WhateverValue"]); NSArray *a = @[@"one", @"two"]; - STAssertTrue([dict[@"Array"] isEqualToArray:a], nil); + XCTAssertTrue([dict[@"Array"] isEqualToArray:a]); } - (void)testDeserialize2 { @@ -68,13 +68,13 @@ - (void)testDeserialize2 { error:nil]; NSLog(@"\n%@", dict); - STAssertTrue([dict[ACCodeSnippetTitleKey] isEqualToString:@"title"], nil); - STAssertTrue([dict[ACCodeSnippetSummaryKey] isEqualToString:@"summary"], nil); - STAssertTrue([dict[ACCodeSnippetContentsKey] isEqualToString:@"line1\nline2\nline3\n"], nil); - STAssertTrue([dict[@"WhateverKey"] isEqualToString:@"WhateverValue"], nil); + XCTAssertTrue([dict[ACCodeSnippetTitleKey] isEqualToString:@"title"]); + XCTAssertTrue([dict[ACCodeSnippetSummaryKey] isEqualToString:@"summary"]); + XCTAssertTrue([dict[ACCodeSnippetContentsKey] isEqualToString:@"line1\nline2\nline3\n"]); + XCTAssertTrue([dict[@"WhateverKey"] isEqualToString:@"WhateverValue"]); NSArray *a = @[@"one", @"two"]; - STAssertTrue([dict[@"Array"] isEqualToArray:a], nil); + XCTAssertTrue([dict[@"Array"] isEqualToArray:a]); } - (void)testSerializeDeserialize { @@ -96,7 +96,7 @@ - (void)testSerializeDeserialize { options:0 format:ACCodeSnippetSerializationFormatC error:nil]; - STAssertTrue([dict1 isEqualToDictionary:dict2], nil); + XCTAssertTrue([dict1 isEqualToDictionary:dict2]); } diff --git a/ACCodeSnippetRepository Tests/ACGitRepositoryTests.m b/ACCodeSnippetRepository Tests/ACGitRepositoryTests.m index 01c7061..fb813a3 100644 --- a/ACCodeSnippetRepository Tests/ACGitRepositoryTests.m +++ b/ACCodeSnippetRepository Tests/ACGitRepositoryTests.m @@ -6,10 +6,10 @@ // Copyright (c) 2014 Arnaud Coomans. All rights reserved. // -#import +#import #import "ACGitRepository.h" -@interface ACGitRepositoryTests : SenTestCase +@interface ACGitRepositoryTests : XCTestCase @end @implementation ACGitRepositoryTests diff --git a/ACCodeSnippetRepository Tests/NSDictionary+MergeTests.m b/ACCodeSnippetRepository Tests/NSDictionary+MergeTests.m index f8137c0..161d0ab 100644 --- a/ACCodeSnippetRepository Tests/NSDictionary+MergeTests.m +++ b/ACCodeSnippetRepository Tests/NSDictionary+MergeTests.m @@ -6,10 +6,10 @@ // Copyright (c) 2014 Arnaud Coomans. All rights reserved. // -#import +#import #import "NSDictionary+Merge.h" -@interface NSDictionary_MergeTests : SenTestCase +@interface NSDictionary_MergeTests : XCTestCase @end @implementation NSDictionary_MergeTests @@ -25,9 +25,9 @@ - (void)testExample { @"c": @"c" }]; - STAssertTrue([r[@"a"] isEqualToString:@"a"], nil); - STAssertTrue([r[@"b"] isEqualToString:@"b"], nil); - STAssertTrue([r[@"c"] isEqualToString:@"c"], nil); + XCTAssertTrue([r[@"a"] isEqualToString:@"a"]); + XCTAssertTrue([r[@"b"] isEqualToString:@"b"]); + XCTAssertTrue([r[@"c"] isEqualToString:@"c"]); } @end diff --git a/ACCodeSnippetRepository.xcodeproj/project.pbxproj b/ACCodeSnippetRepository.xcodeproj/project.pbxproj index b052723..7410ac5 100644 --- a/ACCodeSnippetRepository.xcodeproj/project.pbxproj +++ b/ACCodeSnippetRepository.xcodeproj/project.pbxproj @@ -16,7 +16,6 @@ 5153BAA918B3406D00C1E75B /* NSDictionary+Merge.m in Sources */ = {isa = PBXBuildFile; fileRef = 5153BAA818B3406D00C1E75B /* NSDictionary+Merge.m */; }; 5153BAAA18B3406D00C1E75B /* NSDictionary+Merge.m in Sources */ = {isa = PBXBuildFile; fileRef = 5153BAA818B3406D00C1E75B /* NSDictionary+Merge.m */; }; 5153BAAC18B3410C00C1E75B /* NSDictionary+MergeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5153BAAB18B3410C00C1E75B /* NSDictionary+MergeTests.m */; }; - 5154068518AC4B500065CA33 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5154068418AC4B500065CA33 /* SenTestingKit.framework */; }; 5154068B18AC4B500065CA33 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 5154068918AC4B500065CA33 /* InfoPlist.strings */; }; 515CE9DA18B1DCAA000962EA /* GitHub-Mark-120px-plus.png in Resources */ = {isa = PBXBuildFile; fileRef = 515CE9D718B1DCAA000962EA /* GitHub-Mark-120px-plus.png */; }; 515CE9DB18B1DCAA000962EA /* GitHub-Mark-32px.png in Resources */ = {isa = PBXBuildFile; fileRef = 515CE9D818B1DCAA000962EA /* GitHub-Mark-32px.png */; }; @@ -60,8 +59,7 @@ 5153BAA718B3406D00C1E75B /* NSDictionary+Merge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+Merge.h"; sourceTree = ""; }; 5153BAA818B3406D00C1E75B /* NSDictionary+Merge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+Merge.m"; sourceTree = ""; }; 5153BAAB18B3410C00C1E75B /* NSDictionary+MergeTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+MergeTests.m"; sourceTree = ""; }; - 5154068318AC4B500065CA33 /* ACCodeSnippetRepository Tests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "ACCodeSnippetRepository Tests.octest"; sourceTree = BUILT_PRODUCTS_DIR; }; - 5154068418AC4B500065CA33 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; }; + 5154068318AC4B500065CA33 /* ACCodeSnippetRepository Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "ACCodeSnippetRepository Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 5154068818AC4B500065CA33 /* ACCodeSnippetRepository Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ACCodeSnippetRepository Tests-Info.plist"; sourceTree = ""; }; 5154068A18AC4B500065CA33 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 5154068E18AC4B500065CA33 /* ACCodeSnippetRepository Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ACCodeSnippetRepository Tests-Prefix.pch"; sourceTree = ""; }; @@ -104,7 +102,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 5154068518AC4B500065CA33 /* SenTestingKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -247,7 +244,7 @@ isa = PBXGroup; children = ( 518E699F18AC4A8900C57456 /* ACCodeSnippetRepository.xcplugin */, - 5154068318AC4B500065CA33 /* ACCodeSnippetRepository Tests.octest */, + 5154068318AC4B500065CA33 /* ACCodeSnippetRepository Tests.xctest */, ); name = Products; sourceTree = ""; @@ -257,7 +254,6 @@ children = ( 518E69A218AC4A8900C57456 /* AppKit.framework */, 518E69A418AC4A8900C57456 /* Foundation.framework */, - 5154068418AC4B500065CA33 /* SenTestingKit.framework */, ); name = Frameworks; sourceTree = ""; @@ -318,8 +314,8 @@ ); name = "ACCodeSnippetRepository Tests"; productName = "ACCodeSnippetRepository Tests"; - productReference = 5154068318AC4B500065CA33 /* ACCodeSnippetRepository Tests.octest */; - productType = "com.apple.product-type.bundle"; + productReference = 5154068318AC4B500065CA33 /* ACCodeSnippetRepository Tests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; }; 518E699E18AC4A8900C57456 /* ACCodeSnippetRepository */ = { isa = PBXNativeTarget; @@ -344,6 +340,7 @@ 518E699718AC4A8900C57456 /* Project object */ = { isa = PBXProject; attributes = { + LastTestingUpgradeCheck = 0700; LastUpgradeCheck = 0500; ORGANIZATIONNAME = "Arnaud Coomans"; TargetAttributes = { @@ -475,7 +472,6 @@ ); INFOPLIST_FILE = "ACCodeSnippetRepository Tests/ACCodeSnippetRepository Tests-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; - WRAPPER_EXTENSION = octest; }; name = Debug; }; @@ -490,7 +486,6 @@ GCC_PREFIX_HEADER = "ACCodeSnippetRepository Tests/ACCodeSnippetRepository Tests-Prefix.pch"; INFOPLIST_FILE = "ACCodeSnippetRepository Tests/ACCodeSnippetRepository Tests-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; - WRAPPER_EXTENSION = octest; }; name = Release; }; From 27e53dc20e194c57d32e03277638447e54c05f45 Mon Sep 17 00:00:00 2001 From: Clement Padovani Date: Sun, 26 Jul 2015 16:17:57 +0200 Subject: [PATCH 06/13] Updated to Xcode 7 recommended settings. --- .../ACCodeSnippetRepository Tests-Info.plist | 2 +- ACCodeSnippetRepository.xcodeproj/project.pbxproj | 9 ++++++++- .../ACCodeSnippetRepository-Info.plist | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ACCodeSnippetRepository Tests/ACCodeSnippetRepository Tests-Info.plist b/ACCodeSnippetRepository Tests/ACCodeSnippetRepository Tests-Info.plist index 17c7d4b..169b6f7 100644 --- a/ACCodeSnippetRepository Tests/ACCodeSnippetRepository Tests-Info.plist +++ b/ACCodeSnippetRepository Tests/ACCodeSnippetRepository Tests-Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier - com.acoomans.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType diff --git a/ACCodeSnippetRepository.xcodeproj/project.pbxproj b/ACCodeSnippetRepository.xcodeproj/project.pbxproj index 7410ac5..57a7aa9 100644 --- a/ACCodeSnippetRepository.xcodeproj/project.pbxproj +++ b/ACCodeSnippetRepository.xcodeproj/project.pbxproj @@ -341,7 +341,7 @@ isa = PBXProject; attributes = { LastTestingUpgradeCheck = 0700; - LastUpgradeCheck = 0500; + LastUpgradeCheck = 0700; ORGANIZATIONNAME = "Arnaud Coomans"; TargetAttributes = { 5154068218AC4B500065CA33 = { @@ -460,6 +460,7 @@ 5154069118AC4B500065CA33 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( "$(DEVELOPER_FRAMEWORKS_DIR)", "$(inherited)", @@ -471,6 +472,7 @@ "$(inherited)", ); INFOPLIST_FILE = "ACCodeSnippetRepository Tests/ACCodeSnippetRepository Tests-Info.plist"; + PRODUCT_BUNDLE_IDENTIFIER = "com.acoomans.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -478,6 +480,7 @@ 5154069218AC4B500065CA33 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( "$(DEVELOPER_FRAMEWORKS_DIR)", "$(inherited)", @@ -485,6 +488,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "ACCodeSnippetRepository Tests/ACCodeSnippetRepository Tests-Prefix.pch"; INFOPLIST_FILE = "ACCodeSnippetRepository Tests/ACCodeSnippetRepository Tests-Info.plist"; + PRODUCT_BUNDLE_IDENTIFIER = "com.acoomans.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; @@ -505,6 +509,7 @@ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; @@ -568,6 +573,7 @@ INFOPLIST_FILE = "ACCodeSnippetRepository/ACCodeSnippetRepository-Info.plist"; INSTALL_PATH = "/Library/Application Support/Developer/Shared/Xcode/Plug-ins"; OTHER_LDFLAGS = ""; + PRODUCT_BUNDLE_IDENTIFIER = "com.acoomans.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = xcplugin; }; @@ -584,6 +590,7 @@ INFOPLIST_FILE = "ACCodeSnippetRepository/ACCodeSnippetRepository-Info.plist"; INSTALL_PATH = "/Library/Application Support/Developer/Shared/Xcode/Plug-ins"; OTHER_LDFLAGS = ""; + PRODUCT_BUNDLE_IDENTIFIER = "com.acoomans.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = xcplugin; }; diff --git a/ACCodeSnippetRepository/ACCodeSnippetRepository-Info.plist b/ACCodeSnippetRepository/ACCodeSnippetRepository-Info.plist index ee568a4..50d472d 100644 --- a/ACCodeSnippetRepository/ACCodeSnippetRepository-Info.plist +++ b/ACCodeSnippetRepository/ACCodeSnippetRepository-Info.plist @@ -9,7 +9,7 @@ CFBundleIconFile CFBundleIdentifier - com.acoomans.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName From 9bf5922f2928a14e0e73ed4f1cc3ffcb5a09a183 Mon Sep 17 00:00:00 2001 From: Clement Padovani Date: Sun, 26 Jul 2015 16:19:51 +0200 Subject: [PATCH 07/13] API usage fix. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Warning: “Null passed to a callee that requires a non-null argument”. Replaced nil by an empty string per API docs. --- .../ACCodeSnippetRepositoryConfigurationWindowController.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ACCodeSnippetRepository/Controllers/ACCodeSnippetRepositoryConfigurationWindowController.m b/ACCodeSnippetRepository/Controllers/ACCodeSnippetRepositoryConfigurationWindowController.m index 104a5d1..d771d98 100644 --- a/ACCodeSnippetRepository/Controllers/ACCodeSnippetRepositoryConfigurationWindowController.m +++ b/ACCodeSnippetRepository/Controllers/ACCodeSnippetRepositoryConfigurationWindowController.m @@ -242,7 +242,7 @@ - (IBAction)restoreSystemSnippets:(id)sender { } - (IBAction)openSystemSnippetsDirectoryAction:(id)sender { - [[NSWorkspace sharedWorkspace] selectFile:[self systemSnippetsPath] inFileViewerRootedAtPath:nil]; + [[NSWorkspace sharedWorkspace] selectFile:[self systemSnippetsPath] inFileViewerRootedAtPath: @""]; } - (NSString*)systemSnippetsPath { From 1fdea08590924f5b4f12ae7bdeddb5d798c99ec0 Mon Sep 17 00:00:00 2001 From: Clement Padovani Date: Sun, 26 Jul 2015 16:28:52 +0200 Subject: [PATCH 08/13] Various refactoring. --- ACCodeSnippetRepository/ACCodeSnippetRepositoryPlugin.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ACCodeSnippetRepository/ACCodeSnippetRepositoryPlugin.m b/ACCodeSnippetRepository/ACCodeSnippetRepositoryPlugin.m index 80b1b44..2739fd6 100644 --- a/ACCodeSnippetRepository/ACCodeSnippetRepositoryPlugin.m +++ b/ACCodeSnippetRepository/ACCodeSnippetRepositoryPlugin.m @@ -97,7 +97,7 @@ - (NSMenu*)pluginMenu { if (!pluginMenu) { pluginMenu = [[NSMenu alloc] initWithTitle:pluginMenuTitle]; - NSMenuItem *pluginMenuItem = [[NSMenuItem alloc] initWithTitle:pluginMenuTitle action:nil keyEquivalent:@""]; + NSMenuItem *pluginMenuItem = [[NSMenuItem alloc] initWithTitle:pluginMenuTitle action: NULL keyEquivalent:@""]; pluginMenuItem.submenu = pluginMenu; [[NSApp mainMenu] addItem:pluginMenuItem]; From 8e93599f8f82c40182b9decda873c0813bb68509 Mon Sep 17 00:00:00 2001 From: Clement Padovani Date: Sun, 26 Jul 2015 16:29:28 +0200 Subject: [PATCH 09/13] Added Xcode 7 key. --- ACCodeSnippetRepository/ACCodeSnippetRepository-Info.plist | 1 + 1 file changed, 1 insertion(+) diff --git a/ACCodeSnippetRepository/ACCodeSnippetRepository-Info.plist b/ACCodeSnippetRepository/ACCodeSnippetRepository-Info.plist index 50d472d..60629a9 100644 --- a/ACCodeSnippetRepository/ACCodeSnippetRepository-Info.plist +++ b/ACCodeSnippetRepository/ACCodeSnippetRepository-Info.plist @@ -31,6 +31,7 @@ FEC992CC-CA4A-4CFD-8881-77300FCB848A A16FF353-8441-459E-A50C-B071F53F51B7 9F75337B-21B4-4ADC-B558-F9CADF7073A7 + AABB7188-E14E-4433-AD3B-5CD791EAD9A3 NSPrincipalClass ACCodeSnippetRepositoryPlugin From b05810440b436c41bfe326d68708bf30accbfaaf Mon Sep 17 00:00:00 2001 From: Clement Padovani Date: Sun, 26 Jul 2015 16:47:12 +0200 Subject: [PATCH 10/13] Fixed "Plug-ins" menu not appearing. --- .../ACCodeSnippetRepositoryPlugin.m | 54 +++++++++++-------- 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/ACCodeSnippetRepository/ACCodeSnippetRepositoryPlugin.m b/ACCodeSnippetRepository/ACCodeSnippetRepositoryPlugin.m index 2739fd6..c6ce400 100644 --- a/ACCodeSnippetRepository/ACCodeSnippetRepositoryPlugin.m +++ b/ACCodeSnippetRepository/ACCodeSnippetRepositoryPlugin.m @@ -39,7 +39,12 @@ - (id)initWithBundle:(NSBundle *)plugin { // reference to plugin's bundle, for resource acccess self.bundle = plugin; - + + [[NSNotificationCenter defaultCenter] addObserver: self + selector: @selector(applicationDidFinishLaunching:) + name: NSApplicationDidFinishLaunchingNotification + object: nil]; + // add data stores to Xcode's snippet repository ACCodeSnippetGitDataStore *gitDataStore = [[ACCodeSnippetGitDataStore alloc] init]; [gitDataStore addObserver:self forKeyPath:@"mainQueue.operationCount" options:0 context:NULL]; @@ -58,29 +63,30 @@ - (id)initWithBundle:(NSBundle *)plugin { [self startTimer]; } - // Create menu items, initialize UI, etc. - NSMenu *pluginMenu = [self pluginMenu]; - pluginMenu.autoenablesItems = NO; - - if (pluginMenu) { - - NSMenuItem *actionMenuItem = nil; - - self.updateMenuItem = actionMenuItem = [[NSMenuItem alloc] initWithTitle:@"Update snippets" action:@selector(updateAction:) keyEquivalent:@""]; - actionMenuItem.target = self; - [pluginMenu addItem:actionMenuItem]; - - actionMenuItem = [[NSMenuItem alloc] initWithTitle:@"Configure snippets repository" action:@selector(configureAction:) keyEquivalent:@""]; - actionMenuItem.target = self; - [pluginMenu addItem:actionMenuItem]; - - //[pluginMenu addItem:[NSMenuItem separatorItem]]; - } - } return self; } +- (void) applicationDidFinishLaunching: (NSNotification *) notification +{ + // Create menu items, initialize UI, etc. + NSMenu *pluginMenu = [self pluginMenu]; + pluginMenu.autoenablesItems = NO; + + if (pluginMenu) { + + NSMenuItem *actionMenuItem = nil; + + self.updateMenuItem = actionMenuItem = [[NSMenuItem alloc] initWithTitle:@"Update snippets" action:@selector(updateAction:) keyEquivalent:@""]; + actionMenuItem.target = self; + [pluginMenu addItem:actionMenuItem]; + + actionMenuItem = [[NSMenuItem alloc] initWithTitle:@"Configure snippets repository" action:@selector(configureAction:) keyEquivalent:@""]; + actionMenuItem.target = self; + [pluginMenu addItem:actionMenuItem]; + } +} + - (id)init { return [self initWithBundle:nil]; } @@ -99,8 +105,12 @@ - (NSMenu*)pluginMenu { NSMenuItem *pluginMenuItem = [[NSMenuItem alloc] initWithTitle:pluginMenuTitle action: NULL keyEquivalent:@""]; pluginMenuItem.submenu = pluginMenu; - - [[NSApp mainMenu] addItem:pluginMenuItem]; + + NSMenu *appMenu = [NSApp menu]; + + NSMenuItem *helpMenuItem = [appMenu itemWithTitle: @"Help"]; + + [appMenu insertItem: pluginMenuItem atIndex: [appMenu indexOfItem: helpMenuItem]]; } return pluginMenu; } From a1589037e61b72aaed48e811f02c4fe68edfa248 Mon Sep 17 00:00:00 2001 From: Clement Padovani Date: Sun, 26 Jul 2015 17:29:39 +0200 Subject: [PATCH 11/13] Fixed accessing AppKit element from background thread. When forking a new code snippet repo (Plug-ins -> Configure snippets repo) when checking the console logs AppKit outputs the following entry: NSAlert is being used from a background thread, which is not safe. This is probably going to crash sometimes. Break on void _NSAlertWarnUnsafeBackgroundThreadUsage() to debug. This will be logged only once. This may break in the future. --- .../ACCodeSnippetRepositoryConfigurationWindowController.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ACCodeSnippetRepository/Controllers/ACCodeSnippetRepositoryConfigurationWindowController.m b/ACCodeSnippetRepository/Controllers/ACCodeSnippetRepositoryConfigurationWindowController.m index d771d98..6309e22 100644 --- a/ACCodeSnippetRepository/Controllers/ACCodeSnippetRepositoryConfigurationWindowController.m +++ b/ACCodeSnippetRepository/Controllers/ACCodeSnippetRepositoryConfigurationWindowController.m @@ -120,8 +120,10 @@ - (IBAction)forkRemoteRepositoryAction:(id)sender { [weakSelf.window endSheet:weakSelf.progressPanel]; [weakSelf.progressIndicator stopAnimation:weakSelf]; }); - - [weakSelf importUserSnippetsAction:weakSelf]; + + dispatch_async(dispatch_get_main_queue(), ^{ + [weakSelf importUserSnippetsAction:weakSelf]; + }); }); break; From 25831862773b4adb8e69f4a21642212bca66c57d Mon Sep 17 00:00:00 2001 From: Yeah Date: Tue, 28 Jul 2015 07:02:20 +0800 Subject: [PATCH 12/13] Add Xcode 6.4 DVTPlugInCompatibilityUUID --- ACCodeSnippetRepository/ACCodeSnippetRepository-Info.plist | 1 + 1 file changed, 1 insertion(+) diff --git a/ACCodeSnippetRepository/ACCodeSnippetRepository-Info.plist b/ACCodeSnippetRepository/ACCodeSnippetRepository-Info.plist index 60629a9..87682c9 100644 --- a/ACCodeSnippetRepository/ACCodeSnippetRepository-Info.plist +++ b/ACCodeSnippetRepository/ACCodeSnippetRepository-Info.plist @@ -32,6 +32,7 @@ A16FF353-8441-459E-A50C-B071F53F51B7 9F75337B-21B4-4ADC-B558-F9CADF7073A7 AABB7188-E14E-4433-AD3B-5CD791EAD9A3 + 7FDF5C7A-131F-4ABB-9EDC-8C5F8F0B8A90 NSPrincipalClass ACCodeSnippetRepositoryPlugin From 9f2fc7290f4c51239f45e5901b939c77f0bcbda4 Mon Sep 17 00:00:00 2001 From: Clement Date: Tue, 28 Jul 2015 13:39:23 +0200 Subject: [PATCH 13/13] Fix empty repo URL crash. --- .../ACCodeSnippetRepositoryConfigurationWindowController.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ACCodeSnippetRepository/Controllers/ACCodeSnippetRepositoryConfigurationWindowController.m b/ACCodeSnippetRepository/Controllers/ACCodeSnippetRepositoryConfigurationWindowController.m index 6309e22..e21cd7e 100644 --- a/ACCodeSnippetRepository/Controllers/ACCodeSnippetRepositoryConfigurationWindowController.m +++ b/ACCodeSnippetRepository/Controllers/ACCodeSnippetRepositoryConfigurationWindowController.m @@ -57,7 +57,9 @@ - (ACCodeSnippetGitDataStore*)gitDataStore { - (void)controlTextDidChange:(NSNotification *)notification { NSTextField *textField = [notification object]; - if (![[NSURL URLWithString:textField.stringValue] isEqualTo:self.gitDataStore.remoteRepositoryURL]) { + if (([textField stringValue] && + [[textField stringValue] length]) && + ![[NSURL URLWithString:textField.stringValue] isEqualTo:self.gitDataStore.remoteRepositoryURL]) { self.forkRemoteRepositoryButton.enabled = YES; } else { self.forkRemoteRepositoryButton.enabled = NO;