diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d852863 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.DS_Store* +build/ diff --git a/PlistCompareKeys.xcodeproj/project.pbxproj b/PlistCompareKeys.xcodeproj/project.pbxproj new file mode 100644 index 0000000..af52da0 --- /dev/null +++ b/PlistCompareKeys.xcodeproj/project.pbxproj @@ -0,0 +1,260 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 0733EB77191023EE00F223EE /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0733EB76191023EE00F223EE /* Foundation.framework */; }; + 0733EB7A191023EE00F223EE /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 0733EB79191023EE00F223EE /* main.m */; }; + 0733EB7E191023EE00F223EE /* PlistCompareKeys.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = 0733EB7D191023EE00F223EE /* PlistCompareKeys.1 */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 0733EB71191023EE00F223EE /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = /usr/share/man/man1/; + dstSubfolderSpec = 0; + files = ( + 0733EB7E191023EE00F223EE /* PlistCompareKeys.1 in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 1; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 0733EB73191023EE00F223EE /* PlistCompareKeys */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = PlistCompareKeys; sourceTree = BUILT_PRODUCTS_DIR; }; + 0733EB76191023EE00F223EE /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 0733EB79191023EE00F223EE /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 0733EB7C191023EE00F223EE /* PlistCompareKeys-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "PlistCompareKeys-Prefix.pch"; sourceTree = ""; }; + 0733EB7D191023EE00F223EE /* PlistCompareKeys.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = PlistCompareKeys.1; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 0733EB70191023EE00F223EE /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 0733EB77191023EE00F223EE /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 0733EB6A191023EE00F223EE = { + isa = PBXGroup; + children = ( + 0733EB78191023EE00F223EE /* PlistCompareKeys */, + 0733EB75191023EE00F223EE /* Frameworks */, + 0733EB74191023EE00F223EE /* Products */, + ); + sourceTree = ""; + }; + 0733EB74191023EE00F223EE /* Products */ = { + isa = PBXGroup; + children = ( + 0733EB73191023EE00F223EE /* PlistCompareKeys */, + ); + name = Products; + sourceTree = ""; + }; + 0733EB75191023EE00F223EE /* Frameworks */ = { + isa = PBXGroup; + children = ( + 0733EB76191023EE00F223EE /* Foundation.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 0733EB78191023EE00F223EE /* PlistCompareKeys */ = { + isa = PBXGroup; + children = ( + 0733EB79191023EE00F223EE /* main.m */, + 0733EB7D191023EE00F223EE /* PlistCompareKeys.1 */, + 0733EB7B191023EE00F223EE /* Supporting Files */, + ); + path = PlistCompareKeys; + sourceTree = ""; + }; + 0733EB7B191023EE00F223EE /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 0733EB7C191023EE00F223EE /* PlistCompareKeys-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 0733EB72191023EE00F223EE /* PlistCompareKeys */ = { + isa = PBXNativeTarget; + buildConfigurationList = 0733EB81191023EE00F223EE /* Build configuration list for PBXNativeTarget "PlistCompareKeys" */; + buildPhases = ( + 0733EB6F191023EE00F223EE /* Sources */, + 0733EB70191023EE00F223EE /* Frameworks */, + 0733EB71191023EE00F223EE /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PlistCompareKeys; + productName = PlistCompareKeys; + productReference = 0733EB73191023EE00F223EE /* PlistCompareKeys */; + productType = "com.apple.product-type.tool"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 0733EB6B191023EE00F223EE /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0510; + ORGANIZATIONNAME = "Aaron Smith"; + }; + buildConfigurationList = 0733EB6E191023EE00F223EE /* Build configuration list for PBXProject "PlistCompareKeys" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 0733EB6A191023EE00F223EE; + productRefGroup = 0733EB74191023EE00F223EE /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 0733EB72191023EE00F223EE /* PlistCompareKeys */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 0733EB6F191023EE00F223EE /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 0733EB7A191023EE00F223EE /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 0733EB7F191023EE00F223EE /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.9; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + 0733EB80191023EE00F223EE /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.9; + SDKROOT = macosx; + }; + name = Release; + }; + 0733EB82191023EE00F223EE /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "PlistCompareKeys/PlistCompareKeys-Prefix.pch"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 0733EB83191023EE00F223EE /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "PlistCompareKeys/PlistCompareKeys-Prefix.pch"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 0733EB6E191023EE00F223EE /* Build configuration list for PBXProject "PlistCompareKeys" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0733EB7F191023EE00F223EE /* Debug */, + 0733EB80191023EE00F223EE /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 0733EB81191023EE00F223EE /* Build configuration list for PBXNativeTarget "PlistCompareKeys" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0733EB82191023EE00F223EE /* Debug */, + 0733EB83191023EE00F223EE /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 0733EB6B191023EE00F223EE /* Project object */; +} diff --git a/PlistCompareKeys.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/PlistCompareKeys.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..4d35d80 --- /dev/null +++ b/PlistCompareKeys.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/PlistCompareKeys.xcodeproj/project.xcworkspace/xcuserdata/aaronsmith.xcuserdatad/UserInterfaceState.xcuserstate b/PlistCompareKeys.xcodeproj/project.xcworkspace/xcuserdata/aaronsmith.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..d26275c Binary files /dev/null and b/PlistCompareKeys.xcodeproj/project.xcworkspace/xcuserdata/aaronsmith.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/PlistCompareKeys.xcodeproj/xcuserdata/aaronsmith.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/PlistCompareKeys.xcodeproj/xcuserdata/aaronsmith.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..fe2b454 --- /dev/null +++ b/PlistCompareKeys.xcodeproj/xcuserdata/aaronsmith.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/PlistCompareKeys.xcodeproj/xcuserdata/aaronsmith.xcuserdatad/xcschemes/PlistCompareKeys.xcscheme b/PlistCompareKeys.xcodeproj/xcuserdata/aaronsmith.xcuserdatad/xcschemes/PlistCompareKeys.xcscheme new file mode 100644 index 0000000..a310850 --- /dev/null +++ b/PlistCompareKeys.xcodeproj/xcuserdata/aaronsmith.xcuserdatad/xcschemes/PlistCompareKeys.xcscheme @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PlistCompareKeys.xcodeproj/xcuserdata/aaronsmith.xcuserdatad/xcschemes/xcschememanagement.plist b/PlistCompareKeys.xcodeproj/xcuserdata/aaronsmith.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..213b039 --- /dev/null +++ b/PlistCompareKeys.xcodeproj/xcuserdata/aaronsmith.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + PlistCompareKeys.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 0733EB72191023EE00F223EE + + primary + + + + + diff --git a/PlistCompareKeys/PlistCompareKeys-Prefix.pch b/PlistCompareKeys/PlistCompareKeys-Prefix.pch new file mode 100644 index 0000000..37fdbe6 --- /dev/null +++ b/PlistCompareKeys/PlistCompareKeys-Prefix.pch @@ -0,0 +1,9 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#ifdef __OBJC__ + #import +#endif diff --git a/PlistCompareKeys/PlistCompareKeys.1 b/PlistCompareKeys/PlistCompareKeys.1 new file mode 100644 index 0000000..2068d6e --- /dev/null +++ b/PlistCompareKeys/PlistCompareKeys.1 @@ -0,0 +1,79 @@ +.\"Modified from man(1) of FreeBSD, the NetBSD mdoc.template, and mdoc.samples. +.\"See Also: +.\"man mdoc.samples for a complete listing of options +.\"man mdoc for the short list of editing options +.\"/usr/share/misc/mdoc.template +.Dd 4/29/14 \" DATE +.Dt PlistCompareKeys 1 \" Program name and manual section number +.Os Darwin +.Sh NAME \" Section Header - required - don't modify +.Nm PlistCompareKeys, +.\" The following lines are read in generating the apropos(man -k) database. Use only key +.\" words here as the database is built based on the words here and in the .ND line. +.Nm Other_name_for_same_program(), +.Nm Yet another name for the same program. +.\" Use .Nm macro to designate other names for the documented program. +.Nd This line parsed for whatis database. +.Sh SYNOPSIS \" Section Header - required - don't modify +.Nm +.Op Fl abcd \" [-abcd] +.Op Fl a Ar path \" [-a path] +.Op Ar file \" [file] +.Op Ar \" [file ...] +.Ar arg0 \" Underlined argument - use .Ar anywhere to underline +arg2 ... \" Arguments +.Sh DESCRIPTION \" Section Header - required - don't modify +Use the .Nm macro to refer to your program throughout the man page like such: +.Nm +Underlining is accomplished with the .Ar macro like this: +.Ar underlined text . +.Pp \" Inserts a space +A list of items with descriptions: +.Bl -tag -width -indent \" Begins a tagged list +.It item a \" Each item preceded by .It macro +Description of item a +.It item b +Description of item b +.El \" Ends the list +.Pp +A list of flags and their descriptions: +.Bl -tag -width -indent \" Differs from above in tag removed +.It Fl a \"-a flag as a list item +Description of -a flag +.It Fl b +Description of -b flag +.El \" Ends the list +.Pp +.\" .Sh ENVIRONMENT \" May not be needed +.\" .Bl -tag -width "ENV_VAR_1" -indent \" ENV_VAR_1 is width of the string ENV_VAR_1 +.\" .It Ev ENV_VAR_1 +.\" Description of ENV_VAR_1 +.\" .It Ev ENV_VAR_2 +.\" Description of ENV_VAR_2 +.\" .El +.Sh FILES \" File used or created by the topic of the man page +.Bl -tag -width "/Users/joeuser/Library/really_long_file_name" -compact +.It Pa /usr/share/file_name +FILE_1 description +.It Pa /Users/joeuser/Library/really_long_file_name +FILE_2 description +.El \" Ends the list +.\" .Sh DIAGNOSTICS \" May not be needed +.\" .Bl -diag +.\" .It Diagnostic Tag +.\" Diagnostic informtion here. +.\" .It Diagnostic Tag +.\" Diagnostic informtion here. +.\" .El +.Sh SEE ALSO +.\" List links in ascending order by section, alphabetically within a section. +.\" Please do not reference files that do not exist without filing a bug report +.Xr a 1 , +.Xr b 1 , +.Xr c 1 , +.Xr a 2 , +.Xr b 2 , +.Xr a 3 , +.Xr b 3 +.\" .Sh BUGS \" Document known, unremedied bugs +.\" .Sh HISTORY \" Document history if command behaves in a unique manner \ No newline at end of file diff --git a/PlistCompareKeys/main.m b/PlistCompareKeys/main.m new file mode 100644 index 0000000..20e2405 --- /dev/null +++ b/PlistCompareKeys/main.m @@ -0,0 +1,62 @@ + +#import + +int main(int argc, const char * argv[]) +{ + + @autoreleasepool { + char buf[2048]; + char * buf2 = getcwd(buf,sizeof(buf)); + if(!buf2) { + NSLog(@"error getting cwd"); + exit(1); + } + + #if !DEBUG + NSURL * cwd = [NSURL fileURLWithPath:[NSString stringWithCString:buf encoding:NSUTF8StringEncoding]]; + NSArray * arguments = [[NSProcessInfo processInfo] arguments]; + if(arguments.count < 2) { + NSLog(@"usage: PlistCompareKeys plist1.plist plist2.plist"); + exit(1); + } + #endif + + #if !DEBUG + NSString * plist1Name = [arguments objectAtIndex:1]; + NSURL * plist1File = [NSURL URLWithString:plist1Name relativeToURL:cwd]; + #else + NSString * plist1Name = @"CUR8/Documentr-Info.plist"; + NSURL * plist1File = [NSURL URLWithString:plist1Name relativeToURL:[NSURL fileURLWithPath:@"/Users/aaronsmith/Development/Apptitude/documentr/Documentr/Resources"]]; + #endif + NSDictionary * plist1 = [NSDictionary dictionaryWithContentsOfFile:plist1File.path]; + + #if !DEBUG + NSString * plist2Name = [arguments objectAtIndex:2]; + NSURL * plist2File = [NSURL URLWithString:plist2Name relativeToURL:cwd]; + #else + NSString * plist2Name = @"DocumntrGeneric/Documentr-Info.plist"; + NSURL * plist2File = [NSURL URLWithString:plist2Name relativeToURL:[NSURL fileURLWithPath:@"/Users/aaronsmith/Development/Apptitude/documentr/Documentr/Resources"]]; + #endif + NSDictionary * plist2 = [NSDictionary dictionaryWithContentsOfFile:plist2File.path]; + + for(NSString * key in plist1) { + if(![plist2 objectForKey:key]) { + NSLog(@"%@: in (plist1: %@), NOT in (plist2: %@)",key,plist1Name,plist2Name); + } + } + + BOOL logsplit = FALSE; + for(NSString * key in plist2) { + if(![plist1 objectForKey:key]) { + if(!logsplit) { + NSLog(@"====="); + logsplit = TRUE; + } + NSLog(@"%@: in %@, NOT in %@",key,plist2Name,plist1Name); + } + } + } + + return 0; +} +