├── .DS_Store ├── .gitignore ├── README.md ├── ZLCheckFilePlugin.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── ZLCheckFilePlugin.xccheckout │ └── xcuserdata │ │ └── zhanglei.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── zhanglei.xcuserdatad │ └── xcschemes │ ├── ZLCheckFilePlugin.xcscheme │ └── xcschememanagement.plist ├── ZLCheckFilePlugin ├── .DS_Store ├── Info.plist ├── NSArray+Ext.h ├── NSArray+Ext.m ├── README.md ├── ZLCheckFile.h ├── ZLCheckFile.m ├── ZLCheckFileDataViewController.h ├── ZLCheckFileDataViewController.m ├── ZLCheckFileDataViewController.xib ├── ZLCheckInfo.h ├── ZLCheckInfo.m ├── ZLFile.h ├── ZLFile.m └── files.plist ├── screenhost1.png └── screenhost2.png /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MakeZL/ZLCheckFilePlugin-Xcode/46446306050a583387d56d5872272da4bacd6507/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.cuserstate 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ZLCheckFilePlugin-Xcode 2 | 3 | ## Introduction 4 | This is redundant files a lookup project (not the referenced file). Xcode - plugin. 5 | 6 | ## How to use? 7 | #### Start Project in Xcode 8 | ![image](https://github.com/MakeZL/ZLCheckFilePlugin-Xcode/blob/master/screenhost1.png) 9 | #### restart Xcode. OK! Look File last menuItem -> Look check File! 10 | ![image](https://github.com/MakeZL/ZLCheckFilePlugin-Xcode/blob/master/screenhost2.png) 11 | 12 | 13 | -------------------------------------------------------------------------------- /ZLCheckFilePlugin.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 481D4A3A1A67D5E70003ECFC /* ZLCheckFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 481D4A391A67D5E70003ECFC /* ZLCheckFile.m */; }; 11 | 484A62F81A69227200FAC342 /* ZLCheckInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 484A62F71A69227200FAC342 /* ZLCheckInfo.m */; }; 12 | 48806FC71A6B50F900DBFB53 /* NSArray+Ext.m in Sources */ = {isa = PBXBuildFile; fileRef = 48806FC61A6B50F900DBFB53 /* NSArray+Ext.m */; }; 13 | 48C904961A67D8FB00455FEE /* ZLFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 48C904951A67D8FB00455FEE /* ZLFile.m */; }; 14 | 48FE67CF1A69154300308C79 /* ZLCheckFileDataViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 48FE67CD1A69154300308C79 /* ZLCheckFileDataViewController.m */; }; 15 | 48FE67D01A69154300308C79 /* ZLCheckFileDataViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 48FE67CE1A69154300308C79 /* ZLCheckFileDataViewController.xib */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXFileReference section */ 19 | 481D4A2E1A67D51B0003ECFC /* ZLCheckFilePlugin.xcplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ZLCheckFilePlugin.xcplugin; sourceTree = BUILT_PRODUCTS_DIR; }; 20 | 481D4A321A67D51B0003ECFC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 21 | 481D4A381A67D5E70003ECFC /* ZLCheckFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZLCheckFile.h; sourceTree = ""; }; 22 | 481D4A391A67D5E70003ECFC /* ZLCheckFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZLCheckFile.m; sourceTree = ""; }; 23 | 484A62F61A69227200FAC342 /* ZLCheckInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZLCheckInfo.h; sourceTree = ""; }; 24 | 484A62F71A69227200FAC342 /* ZLCheckInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZLCheckInfo.m; sourceTree = ""; }; 25 | 48806FC51A6B50F900DBFB53 /* NSArray+Ext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+Ext.h"; sourceTree = ""; }; 26 | 48806FC61A6B50F900DBFB53 /* NSArray+Ext.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSArray+Ext.m"; sourceTree = ""; }; 27 | 48C904941A67D8FB00455FEE /* ZLFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZLFile.h; sourceTree = ""; }; 28 | 48C904951A67D8FB00455FEE /* ZLFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZLFile.m; sourceTree = ""; }; 29 | 48FE67CC1A69154300308C79 /* ZLCheckFileDataViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZLCheckFileDataViewController.h; sourceTree = ""; }; 30 | 48FE67CD1A69154300308C79 /* ZLCheckFileDataViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZLCheckFileDataViewController.m; sourceTree = ""; }; 31 | 48FE67CE1A69154300308C79 /* ZLCheckFileDataViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ZLCheckFileDataViewController.xib; sourceTree = ""; }; 32 | /* End PBXFileReference section */ 33 | 34 | /* Begin PBXFrameworksBuildPhase section */ 35 | 481D4A2B1A67D51B0003ECFC /* Frameworks */ = { 36 | isa = PBXFrameworksBuildPhase; 37 | buildActionMask = 2147483647; 38 | files = ( 39 | ); 40 | runOnlyForDeploymentPostprocessing = 0; 41 | }; 42 | /* End PBXFrameworksBuildPhase section */ 43 | 44 | /* Begin PBXGroup section */ 45 | 481D4A251A67D51B0003ECFC = { 46 | isa = PBXGroup; 47 | children = ( 48 | 481D4A301A67D51B0003ECFC /* ZLCheckFilePlugin */, 49 | 481D4A2F1A67D51B0003ECFC /* Products */, 50 | ); 51 | sourceTree = ""; 52 | }; 53 | 481D4A2F1A67D51B0003ECFC /* Products */ = { 54 | isa = PBXGroup; 55 | children = ( 56 | 481D4A2E1A67D51B0003ECFC /* ZLCheckFilePlugin.xcplugin */, 57 | ); 58 | name = Products; 59 | sourceTree = ""; 60 | }; 61 | 481D4A301A67D51B0003ECFC /* ZLCheckFilePlugin */ = { 62 | isa = PBXGroup; 63 | children = ( 64 | 481D4A311A67D51B0003ECFC /* Supporting Files */, 65 | ); 66 | path = ZLCheckFilePlugin; 67 | sourceTree = ""; 68 | }; 69 | 481D4A311A67D51B0003ECFC /* Supporting Files */ = { 70 | isa = PBXGroup; 71 | children = ( 72 | 48806FC41A6B50E200DBFB53 /* Category */, 73 | 489767C01A6A06510090C48A /* Model */, 74 | 489767BF1A6A06440090C48A /* ViewController */, 75 | 481D4A321A67D51B0003ECFC /* Info.plist */, 76 | 481D4A381A67D5E70003ECFC /* ZLCheckFile.h */, 77 | 481D4A391A67D5E70003ECFC /* ZLCheckFile.m */, 78 | ); 79 | name = "Supporting Files"; 80 | sourceTree = ""; 81 | }; 82 | 48806FC41A6B50E200DBFB53 /* Category */ = { 83 | isa = PBXGroup; 84 | children = ( 85 | 48806FC51A6B50F900DBFB53 /* NSArray+Ext.h */, 86 | 48806FC61A6B50F900DBFB53 /* NSArray+Ext.m */, 87 | ); 88 | name = Category; 89 | sourceTree = ""; 90 | }; 91 | 489767BF1A6A06440090C48A /* ViewController */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | 48FE67CC1A69154300308C79 /* ZLCheckFileDataViewController.h */, 95 | 48FE67CD1A69154300308C79 /* ZLCheckFileDataViewController.m */, 96 | 48FE67CE1A69154300308C79 /* ZLCheckFileDataViewController.xib */, 97 | ); 98 | name = ViewController; 99 | sourceTree = ""; 100 | }; 101 | 489767C01A6A06510090C48A /* Model */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | 48C904941A67D8FB00455FEE /* ZLFile.h */, 105 | 48C904951A67D8FB00455FEE /* ZLFile.m */, 106 | 484A62F61A69227200FAC342 /* ZLCheckInfo.h */, 107 | 484A62F71A69227200FAC342 /* ZLCheckInfo.m */, 108 | ); 109 | name = Model; 110 | sourceTree = ""; 111 | }; 112 | /* End PBXGroup section */ 113 | 114 | /* Begin PBXNativeTarget section */ 115 | 481D4A2D1A67D51B0003ECFC /* ZLCheckFilePlugin */ = { 116 | isa = PBXNativeTarget; 117 | buildConfigurationList = 481D4A351A67D51B0003ECFC /* Build configuration list for PBXNativeTarget "ZLCheckFilePlugin" */; 118 | buildPhases = ( 119 | 481D4A2A1A67D51B0003ECFC /* Sources */, 120 | 481D4A2B1A67D51B0003ECFC /* Frameworks */, 121 | 481D4A2C1A67D51B0003ECFC /* Resources */, 122 | ); 123 | buildRules = ( 124 | ); 125 | dependencies = ( 126 | ); 127 | name = ZLCheckFilePlugin; 128 | productName = ZLCheckFilePlugin; 129 | productReference = 481D4A2E1A67D51B0003ECFC /* ZLCheckFilePlugin.xcplugin */; 130 | productType = "com.apple.product-type.bundle"; 131 | }; 132 | /* End PBXNativeTarget section */ 133 | 134 | /* Begin PBXProject section */ 135 | 481D4A261A67D51B0003ECFC /* Project object */ = { 136 | isa = PBXProject; 137 | attributes = { 138 | LastUpgradeCheck = 0610; 139 | ORGANIZATIONNAME = com.zixue101.www; 140 | TargetAttributes = { 141 | 481D4A2D1A67D51B0003ECFC = { 142 | CreatedOnToolsVersion = 6.1; 143 | }; 144 | }; 145 | }; 146 | buildConfigurationList = 481D4A291A67D51B0003ECFC /* Build configuration list for PBXProject "ZLCheckFilePlugin" */; 147 | compatibilityVersion = "Xcode 3.2"; 148 | developmentRegion = English; 149 | hasScannedForEncodings = 0; 150 | knownRegions = ( 151 | en, 152 | ); 153 | mainGroup = 481D4A251A67D51B0003ECFC; 154 | productRefGroup = 481D4A2F1A67D51B0003ECFC /* Products */; 155 | projectDirPath = ""; 156 | projectRoot = ""; 157 | targets = ( 158 | 481D4A2D1A67D51B0003ECFC /* ZLCheckFilePlugin */, 159 | ); 160 | }; 161 | /* End PBXProject section */ 162 | 163 | /* Begin PBXResourcesBuildPhase section */ 164 | 481D4A2C1A67D51B0003ECFC /* Resources */ = { 165 | isa = PBXResourcesBuildPhase; 166 | buildActionMask = 2147483647; 167 | files = ( 168 | 48FE67D01A69154300308C79 /* ZLCheckFileDataViewController.xib in Resources */, 169 | ); 170 | runOnlyForDeploymentPostprocessing = 0; 171 | }; 172 | /* End PBXResourcesBuildPhase section */ 173 | 174 | /* Begin PBXSourcesBuildPhase section */ 175 | 481D4A2A1A67D51B0003ECFC /* Sources */ = { 176 | isa = PBXSourcesBuildPhase; 177 | buildActionMask = 2147483647; 178 | files = ( 179 | 484A62F81A69227200FAC342 /* ZLCheckInfo.m in Sources */, 180 | 48806FC71A6B50F900DBFB53 /* NSArray+Ext.m in Sources */, 181 | 48FE67CF1A69154300308C79 /* ZLCheckFileDataViewController.m in Sources */, 182 | 481D4A3A1A67D5E70003ECFC /* ZLCheckFile.m in Sources */, 183 | 48C904961A67D8FB00455FEE /* ZLFile.m in Sources */, 184 | ); 185 | runOnlyForDeploymentPostprocessing = 0; 186 | }; 187 | /* End PBXSourcesBuildPhase section */ 188 | 189 | /* Begin XCBuildConfiguration section */ 190 | 481D4A331A67D51B0003ECFC /* Debug */ = { 191 | isa = XCBuildConfiguration; 192 | buildSettings = { 193 | ALWAYS_SEARCH_USER_PATHS = NO; 194 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 195 | CLANG_CXX_LIBRARY = "libc++"; 196 | CLANG_ENABLE_MODULES = YES; 197 | CLANG_ENABLE_OBJC_ARC = YES; 198 | CLANG_WARN_BOOL_CONVERSION = YES; 199 | CLANG_WARN_CONSTANT_CONVERSION = YES; 200 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 201 | CLANG_WARN_EMPTY_BODY = YES; 202 | CLANG_WARN_ENUM_CONVERSION = YES; 203 | CLANG_WARN_INT_CONVERSION = YES; 204 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 205 | CLANG_WARN_UNREACHABLE_CODE = YES; 206 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 207 | COPY_PHASE_STRIP = NO; 208 | ENABLE_STRICT_OBJC_MSGSEND = YES; 209 | GCC_C_LANGUAGE_STANDARD = gnu99; 210 | GCC_DYNAMIC_NO_PIC = NO; 211 | GCC_OPTIMIZATION_LEVEL = 0; 212 | GCC_PREPROCESSOR_DEFINITIONS = ( 213 | "DEBUG=1", 214 | "$(inherited)", 215 | ); 216 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 217 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 218 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 219 | GCC_WARN_UNDECLARED_SELECTOR = YES; 220 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 221 | GCC_WARN_UNUSED_FUNCTION = YES; 222 | GCC_WARN_UNUSED_VARIABLE = YES; 223 | MACOSX_DEPLOYMENT_TARGET = 10.9; 224 | MTL_ENABLE_DEBUG_INFO = YES; 225 | ONLY_ACTIVE_ARCH = YES; 226 | SDKROOT = macosx; 227 | }; 228 | name = Debug; 229 | }; 230 | 481D4A341A67D51B0003ECFC /* Release */ = { 231 | isa = XCBuildConfiguration; 232 | buildSettings = { 233 | ALWAYS_SEARCH_USER_PATHS = NO; 234 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 235 | CLANG_CXX_LIBRARY = "libc++"; 236 | CLANG_ENABLE_MODULES = YES; 237 | CLANG_ENABLE_OBJC_ARC = YES; 238 | CLANG_WARN_BOOL_CONVERSION = YES; 239 | CLANG_WARN_CONSTANT_CONVERSION = YES; 240 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 241 | CLANG_WARN_EMPTY_BODY = YES; 242 | CLANG_WARN_ENUM_CONVERSION = YES; 243 | CLANG_WARN_INT_CONVERSION = YES; 244 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 245 | CLANG_WARN_UNREACHABLE_CODE = YES; 246 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 247 | COPY_PHASE_STRIP = YES; 248 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 249 | ENABLE_NS_ASSERTIONS = NO; 250 | ENABLE_STRICT_OBJC_MSGSEND = YES; 251 | GCC_C_LANGUAGE_STANDARD = gnu99; 252 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 253 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 254 | GCC_WARN_UNDECLARED_SELECTOR = YES; 255 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 256 | GCC_WARN_UNUSED_FUNCTION = YES; 257 | GCC_WARN_UNUSED_VARIABLE = YES; 258 | MACOSX_DEPLOYMENT_TARGET = 10.9; 259 | MTL_ENABLE_DEBUG_INFO = NO; 260 | SDKROOT = macosx; 261 | }; 262 | name = Release; 263 | }; 264 | 481D4A361A67D51B0003ECFC /* Debug */ = { 265 | isa = XCBuildConfiguration; 266 | buildSettings = { 267 | COMBINE_HIDPI_IMAGES = YES; 268 | DEPLOYMENT_LOCATION = YES; 269 | DSTROOT = "${HOME}"; 270 | INFOPLIST_FILE = ZLCheckFilePlugin/Info.plist; 271 | INSTALL_PATH = "/Library/Application Support/Developer/Shared/Xcode/Plug-ins"; 272 | PRODUCT_NAME = "$(TARGET_NAME)"; 273 | SKIP_INSTALL = NO; 274 | WRAPPER_EXTENSION = xcplugin; 275 | }; 276 | name = Debug; 277 | }; 278 | 481D4A371A67D51B0003ECFC /* Release */ = { 279 | isa = XCBuildConfiguration; 280 | buildSettings = { 281 | COMBINE_HIDPI_IMAGES = YES; 282 | DEPLOYMENT_LOCATION = YES; 283 | DSTROOT = "${HOME}"; 284 | INFOPLIST_FILE = ZLCheckFilePlugin/Info.plist; 285 | INSTALL_PATH = "/Library/Application Support/Developer/Shared/Xcode/Plug-ins"; 286 | PRODUCT_NAME = "$(TARGET_NAME)"; 287 | SKIP_INSTALL = NO; 288 | WRAPPER_EXTENSION = xcplugin; 289 | }; 290 | name = Release; 291 | }; 292 | /* End XCBuildConfiguration section */ 293 | 294 | /* Begin XCConfigurationList section */ 295 | 481D4A291A67D51B0003ECFC /* Build configuration list for PBXProject "ZLCheckFilePlugin" */ = { 296 | isa = XCConfigurationList; 297 | buildConfigurations = ( 298 | 481D4A331A67D51B0003ECFC /* Debug */, 299 | 481D4A341A67D51B0003ECFC /* Release */, 300 | ); 301 | defaultConfigurationIsVisible = 0; 302 | defaultConfigurationName = Release; 303 | }; 304 | 481D4A351A67D51B0003ECFC /* Build configuration list for PBXNativeTarget "ZLCheckFilePlugin" */ = { 305 | isa = XCConfigurationList; 306 | buildConfigurations = ( 307 | 481D4A361A67D51B0003ECFC /* Debug */, 308 | 481D4A371A67D51B0003ECFC /* Release */, 309 | ); 310 | defaultConfigurationIsVisible = 0; 311 | defaultConfigurationName = Release; 312 | }; 313 | /* End XCConfigurationList section */ 314 | }; 315 | rootObject = 481D4A261A67D51B0003ECFC /* Project object */; 316 | } 317 | -------------------------------------------------------------------------------- /ZLCheckFilePlugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ZLCheckFilePlugin.xcodeproj/project.xcworkspace/xcshareddata/ZLCheckFilePlugin.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 761A8758-DB21-46FC-AB51-191721058CDC 9 | IDESourceControlProjectName 10 | ZLCheckFilePlugin 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 1AE3FDE734877694C31D0D5F1771311445118008 14 | https://github.com/MakeZL/ZLCheckFilePlugin-Xcode.git 15 | 16 | IDESourceControlProjectPath 17 | ZLCheckFilePlugin.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 1AE3FDE734877694C31D0D5F1771311445118008 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/MakeZL/ZLCheckFilePlugin-Xcode.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 1AE3FDE734877694C31D0D5F1771311445118008 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 1AE3FDE734877694C31D0D5F1771311445118008 36 | IDESourceControlWCCName 37 | ZLCheckFilePlugin 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /ZLCheckFilePlugin.xcodeproj/project.xcworkspace/xcuserdata/zhanglei.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MakeZL/ZLCheckFilePlugin-Xcode/46446306050a583387d56d5872272da4bacd6507/ZLCheckFilePlugin.xcodeproj/project.xcworkspace/xcuserdata/zhanglei.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ZLCheckFilePlugin.xcodeproj/xcuserdata/zhanglei.xcuserdatad/xcschemes/ZLCheckFilePlugin.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 60 | 61 | 67 | 68 | 69 | 70 | 72 | 73 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /ZLCheckFilePlugin.xcodeproj/xcuserdata/zhanglei.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ZLCheckFilePlugin.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 481D4A2D1A67D51B0003ECFC 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /ZLCheckFilePlugin/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MakeZL/ZLCheckFilePlugin-Xcode/46446306050a583387d56d5872272da4bacd6507/ZLCheckFilePlugin/.DS_Store -------------------------------------------------------------------------------- /ZLCheckFilePlugin/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | zixue101.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | NSHumanReadableCopyright 24 | Copyright © 2015年 com.zixue101.www. All rights reserved. 25 | NSPrincipalClass 26 | ZLCheckFile 27 | LSApplicationCategoryType 28 | 29 | XC4Compatible 30 | 31 | XC5Compatible 32 | 33 | XCPluginHasUI 34 | 35 | XCGCReady 36 | 37 | DVTPlugInCompatibilityUUIDs 38 | 39 | 9AFF134A-08DC-4096-8CEE-62A4BB123046 40 | 63FC1C47-140D-42B0-BB4D-A10B2D225574 41 | 37B30044-3B14-46BA-ABAA-F01000C27B63 42 | 640F884E-CE55-4B40-87C0-8869546CAB7A 43 | A2E4D43F-41F4-4FB9-BB94-7177011C9AED 44 | AD68E85B-441B-4301-B564-A45E4919A6AD 45 | C4A681B0-4A26-480E-93EC-1218098B9AA0 46 | FEC992CC-CA4A-4CFD-8881-77300FCB848A 47 | 992275C1-432A-4CF7-B659-D84ED6D42D3F 48 | A16FF353-8441-459E-A50C-B071F53F51B7 49 | 9F75337B-21B4-4ADC-B558-F9CADF7073A7 50 | 992275C1-432A-4CF7-B659-D84ED6D42D3F 51 | 8DC44374-2B35-4C57-A6FE-2AD66A36AAD9 52 | E969541F-E6F9-4D25-8158-72DC3545A6C6 53 | AABB7188-E14E-4433-AD3B-5CD791EAD9A3 54 | 7FDF5C7A-131F-4ABB-9EDC-8C5F8F0B8A90 55 | 0420B86A-AA43-4792-9ED0-6FE0F2B16A13 56 | CC0D0F4F-05B3-431A-8F33-F84AFCB2C651 57 | 7265231C-39B4-402C-89E1-16167C4CC990 58 | F41BD31E-2683-44B8-AE7F-5F09E919790E 59 | E71C2CFE-BFD8-4044-8F06-00AE685A406C 60 | ACA8656B-FEA8-4B6D-8E4A-93F4C95C362C 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /ZLCheckFilePlugin/NSArray+Ext.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+Ext.h 3 | // ZLCheckFilePlugin 4 | // 5 | // Created by 张磊 on 15-1-18. 6 | // Copyright (c) 2015年 com.zixue101.www. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSArray (Ext) 12 | // match array in pathExtension 13 | - (BOOL)inArray:(NSString *)pathExtension; 14 | // export path 15 | - (BOOL)exportPlistWithPath:(NSString *)path; 16 | // return search files in searchText 17 | - (instancetype)searchArrayWithSearchText:(NSString *)searchText; 18 | @end 19 | -------------------------------------------------------------------------------- /ZLCheckFilePlugin/NSArray+Ext.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+Ext.m 3 | // ZLCheckFilePlugin 4 | // 5 | // Created by 张磊 on 15-1-18. 6 | // Copyright (c) 2015年 com.zixue101.www. All rights reserved. 7 | // 8 | 9 | #import "NSArray+Ext.h" 10 | #import "ZLFile.h" 11 | #import "ZLCheckInfo.h" 12 | 13 | @implementation NSArray (Ext) 14 | - (BOOL)inArray:(NSString *)pathExtension{ 15 | return [self containsObject:pathExtension]; 16 | } 17 | 18 | - (BOOL)exportPlistWithPath:(NSString *)path{ 19 | NSMutableArray *array = [NSMutableArray array]; 20 | for (ZLFile *file in self) { 21 | [array addObject:@{@"name":file.fileName,@"path":[[[ZLCheckInfo sharedInstance] workSpacePath] stringByAppendingPathComponent:file.filePath]}]; 22 | } 23 | return [array writeToFile:path atomically:YES]; 24 | } 25 | 26 | - (instancetype)searchArrayWithSearchText:(NSString *)searchText{ 27 | NSMutableArray *array = [NSMutableArray array]; 28 | for (ZLFile *file in self) { 29 | if([[file.fileName lowercaseString] rangeOfString:[searchText lowercaseString]].location != NSNotFound){ 30 | [array addObject:file]; 31 | } 32 | } 33 | return array; 34 | } 35 | @end 36 | -------------------------------------------------------------------------------- /ZLCheckFilePlugin/README.md: -------------------------------------------------------------------------------- 1 | # ZLCheckFilePlugin-Xcode 2 | -------------------------------------------------------------------------------- /ZLCheckFilePlugin/ZLCheckFile.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZLCheckFile.h 3 | // ZLCheckFilePlugin 4 | // 5 | // Created by 张磊 on 15-1-15. 6 | // Copyright (c) 2015年 com.zixue101.www. All rights reserved. 7 | // 8 | 9 | 10 | /** 11 | * 出发点: 12 | 很多较老的项目,或者文件结构比较多的项目,总可能会因需求的变更让有些文件没被引用,此插件就希 13 | 望能帮助 Dev.解决此问题。前期先在项目的文件夹目录下 生成 info.plist, 我也在学习Cocoa, 14 | 会不断更新成表格等形式. 15 | Thx. 16 | by zl 17 | * 18 | */ 19 | 20 | #import 21 | #import 22 | 23 | @interface ZLCheckFile : NSObject 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /ZLCheckFilePlugin/ZLCheckFile.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZLCheckFile.m 3 | // ZLCheckFilePlugin 4 | // 5 | // Created by 张磊 on 15-1-15. 6 | // Copyright (c) 2015年 com.zixue101.www. All rights reserved. 7 | // 8 | 9 | #import "ZLCheckFile.h" 10 | #import "ZLFile.h" 11 | #import "ZLCheckInfo.h" 12 | #import "ZLCheckFileDataViewController.h" 13 | 14 | @interface ZLCheckFile () 15 | 16 | @property (copy,nonatomic) NSString *workspacePath; 17 | @property (strong,nonatomic) ZLCheckFileDataViewController *detaVc; 18 | @end 19 | 20 | @implementation ZLCheckFile 21 | 22 | + (void)pluginDidLoad:(NSBundle *)plugin{ 23 | [self shared]; 24 | } 25 | 26 | + (instancetype)shared{ 27 | static dispatch_once_t onceToken; 28 | static id instance = nil; 29 | dispatch_once(&onceToken, ^{ 30 | instance = [[self alloc] init]; 31 | }); 32 | return instance; 33 | } 34 | 35 | - (instancetype)init{ 36 | if(self = [super init]){ 37 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidFinishLaunching:) name:NSApplicationDidFinishLaunchingNotification object:nil]; 38 | 39 | } 40 | return self; 41 | } 42 | 43 | #pragma mark - setup Menu 44 | - (void)applicationDidFinishLaunching:(NSNotification *)notification{ 45 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(getCurrentAppPath:) name:@"IDEWorkspaceBuildProductsLocationDidChangeNotification" object:nil]; 46 | 47 | NSMenuItem *appItem = [[NSApp menu] itemWithTitle:@"File"]; 48 | [[appItem submenu] addItem:[NSMenuItem separatorItem]]; 49 | NSMenuItem *item = [[NSMenuItem alloc] init]; 50 | item.title = @"Look Check File!"; 51 | item.action = @selector(goCheckFile); 52 | item.target = self; 53 | [[appItem submenu] addItem:item]; 54 | 55 | } 56 | 57 | #pragma mark - go CheckFile vc 58 | - (void)goCheckFile{ 59 | self.detaVc = [[ZLCheckFileDataViewController alloc] initWithWindowNibName:@"ZLCheckFileDataViewController"]; 60 | [self.detaVc showWindow:self.detaVc]; 61 | } 62 | 63 | #pragma mark - set workSpacePath 64 | - (void)getCurrentAppPath:(NSNotification *)noti{ 65 | NSString *notiStr = [noti.object description]; 66 | notiStr = [notiStr stringByDeletingLastPathComponent]; 67 | NSRange preRange = [notiStr rangeOfString:@"'"]; 68 | notiStr = [notiStr substringFromIndex:preRange.location+preRange.length]; 69 | notiStr = [notiStr stringByReplacingOccurrencesOfString:@".xcodeproj" withString:@""]; 70 | self.workspacePath = notiStr; 71 | } 72 | 73 | #pragma mark - set files 74 | - (void)setWorkspacePath:(NSString *)workspacePath{ 75 | _workspacePath = workspacePath; 76 | [[ZLCheckInfo sharedInstance] setWorkSpacePath:_workspacePath]; 77 | } 78 | 79 | - (void)dealloc{ 80 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 81 | } 82 | 83 | @end 84 | -------------------------------------------------------------------------------- /ZLCheckFilePlugin/ZLCheckFileDataViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZLCheckFileDataViewController.h 3 | // ZLCheckFilePlugin 4 | // 5 | // Created by 张磊 on 15-1-16. 6 | // Copyright (c) 2015年 com.zixue101.www. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | // _oo0oo_ 12 | // o8888888o 13 | // 88" . "88 14 | // (| -_- |) 15 | // 0\ = /0 16 | // ___/`___'\___ 17 | // .' \\| |// '. 18 | // / \\||| : |||// \ 19 | // / _||||| -:- |||||_ \ 20 | // | | \\\ _ /// | | 21 | // | \_| ''\___/'' |_/ | 22 | // \ .-\__ '_' __/-. / 23 | // ___'. .' /--.--\ '. .'___ 24 | // ."" '< .___\_<|>_/___. '>' "". 25 | // | | : `_ \`.;` \ _ / `;.`/ - ` : | | 26 | // \ \ `_. \_ ___\ /___ _/ ._` / / 27 | // ====`-.____` .__ \_______/ __. -` ___.`==== 28 | // `=-----=' 29 | // 30 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 31 | // 南无阿弥陀佛 永无BUG 32 | 33 | @interface ZLCheckFileDataViewController : NSWindowController 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /ZLCheckFilePlugin/ZLCheckFileDataViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZLCheckFileDataViewController.m 3 | // ZLCheckFilePlugin 4 | // 5 | // Created by 张磊 on 15-1-16. 6 | // Copyright (c) 2015年 com.zixue101.www. All rights reserved. 7 | // 8 | 9 | #import "ZLCheckFileDataViewController.h" 10 | #import "ZLCheckInfo.h" 11 | #import "ZLFile.h" 12 | 13 | @interface ZLCheckFileDataViewController () 14 | @property (weak) IBOutlet NSTableView *tableView; 15 | @property (strong,nonatomic) NSArray *datas; 16 | - (IBAction)exportPlist:(id)sender; 17 | @property (weak) IBOutlet NSSearchField *searchField; 18 | @property (weak) IBOutlet NSView *makeView; 19 | @property (weak) IBOutlet NSTextField *makeTextField; 20 | 21 | @end 22 | 23 | @implementation ZLCheckFileDataViewController 24 | 25 | - (void)windowDidLoad { 26 | [super windowDidLoad]; 27 | 28 | [self.makeView setHidden:NO]; 29 | __weak typeof(self)weakSelf = self; 30 | [[ZLCheckInfo sharedInstance] getFilesWithCallBack:^(NSArray *arr) { 31 | if (!arr.count) { 32 | [weakSelf.makeTextField setStringValue:@"您可能没有多余文件"]; 33 | }else{ 34 | weakSelf.datas = arr; 35 | [weakSelf.tableView reloadData]; 36 | [weakSelf.makeView setHidden:YES]; 37 | } 38 | }]; 39 | } 40 | 41 | - (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView{ 42 | return self.datas.count; 43 | } 44 | 45 | - (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row{ 46 | NSButton *btn = [[NSButton alloc] init]; 47 | if (self.datas.count > row) { 48 | ZLFile *file = self.datas[row]; 49 | btn.title = [[[ZLCheckInfo sharedInstance] workSpacePath] stringByAppendingPathComponent:file.filePath]; 50 | btn.target = self; 51 | btn.action = @selector(clickButton:); 52 | } 53 | return btn; 54 | } 55 | 56 | - (void)clickButton:(NSButton *)btn{ 57 | [self openFinderWithFilePath:btn.title]; 58 | } 59 | 60 | #pragma mark - Open Finder 61 | - (void)openFinderWithFilePath:(NSString *)path{ 62 | if (!path.length) { 63 | return ; 64 | } 65 | 66 | NSString *open = [NSString stringWithFormat:@"open %@",path]; 67 | const char *str = [open UTF8String]; 68 | system([[open stringByDeletingLastPathComponent] UTF8String]); 69 | system(str); 70 | } 71 | 72 | - (void)controlTextDidChange:(NSNotification *)obj{ 73 | self.datas = [[ZLCheckInfo sharedInstance] searchFilesWithText:[obj.object stringValue]]; 74 | [self.tableView reloadData]; 75 | } 76 | 77 | - (IBAction)exportPlist:(id)sender { 78 | [self openFinderWithFilePath:[[ZLCheckInfo sharedInstance] exportFilesInBundlePlist]]; 79 | } 80 | @end 81 | -------------------------------------------------------------------------------- /ZLCheckFilePlugin/ZLCheckFileDataViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 86 | 90 | 91 | 92 | 93 | 94 | 95 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | -------------------------------------------------------------------------------- /ZLCheckFilePlugin/ZLCheckInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZLCheckInfo.h 3 | // ZLCheckFilePlugin 4 | // 5 | // Created by 张磊 on 15-1-16. 6 | // Copyright (c) 2015年 com.zixue101.www. All rights reserved. 7 | // Save Data Class. 8 | 9 | #import 10 | 11 | typedef void(^callBack)(NSArray *arr); 12 | 13 | @interface ZLCheckInfo : NSObject 14 | 15 | // instance a object 16 | + (instancetype)sharedInstance; 17 | // work path 18 | @property (copy,nonatomic) NSString *workSpacePath; 19 | - (void)getFilesWithCallBack:(callBack)callBack; 20 | // return .plist file Path. 21 | - (NSString *)exportFilesInBundlePlist; 22 | // search files 23 | - (NSArray *)searchFilesWithText:(NSString *)searchText; 24 | @end 25 | -------------------------------------------------------------------------------- /ZLCheckFilePlugin/ZLCheckInfo.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZLCheckInfo.m 3 | // ZLCheckFilePlugin 4 | // 5 | // Created by 张磊 on 15-1-16. 6 | // Copyright (c) 2015年 com.zixue101.www. All rights reserved. 7 | // 8 | 9 | #import "ZLCheckInfo.h" 10 | #import "NSArray+Ext.h" 11 | #import "ZLFile.h" 12 | 13 | @interface ZLCheckInfo () 14 | 15 | @property (strong,nonatomic) NSFileManager *fileManager; 16 | // array is files > @[ZLFile,ZLFile] ... 17 | @property (strong,nonatomic) NSArray *files; 18 | // project InfoPlist Dict. 19 | @property (strong,nonatomic) NSDictionary *infoDict; 20 | 21 | @property (strong,nonatomic) NSArray *matchsFileArray; 22 | @property (strong,nonatomic) NSArray *headerFileArray; 23 | @end 24 | 25 | // other static 26 | static NSString *staticPlist = @"plist"; 27 | static NSString *staticStoryboard = @"storyboard"; 28 | static NSString *staticImplementation = @"@implementation"; 29 | static NSString *UIMainStoryboardFile = @"UIMainStoryboardFile"; 30 | static NSString *staticAppDelegate = @"AppDelegate"; 31 | 32 | // import static 33 | static NSString *staticImport = @"#import"; 34 | static NSString *staticInclude = @"#include"; 35 | 36 | // storyboard static 37 | static NSString *staticStoryboardCustomClass = @"customClass"; 38 | 39 | 40 | // NSPrincipalClass staic 41 | static NSString *NSPrincipalClass = @"NSPrincipalClass"; 42 | static NSString *staticStoryboardName = @"storyboardWithName:@"; 43 | 44 | @implementation ZLCheckInfo 45 | 46 | #pragma mark - lazy datas. 47 | - (NSFileManager *)fileManager{ 48 | if (!_fileManager) { 49 | _fileManager = [NSFileManager defaultManager]; 50 | } 51 | return _fileManager; 52 | } 53 | 54 | - (NSArray *)matchsFileArray{ 55 | if (!_matchsFileArray) { 56 | _matchsFileArray = @[ 57 | @"main.m", 58 | @"main.h", 59 | @"main.c", 60 | @"main.cpp", 61 | @"AppDelegate", 62 | @"pch", 63 | ]; 64 | } 65 | return _matchsFileArray; 66 | } 67 | 68 | - (NSArray *)headerFileArray{ 69 | if (!_headerFileArray) { 70 | _headerFileArray = @[ 71 | @"h", 72 | @"m", 73 | @"c", 74 | @"cpp", 75 | @"storyboard", 76 | @"pch", 77 | ]; 78 | } 79 | return _headerFileArray; 80 | } 81 | 82 | static id _instance = nil; 83 | + (instancetype)sharedInstance{ 84 | static dispatch_once_t onceToken; 85 | dispatch_once(&onceToken, ^{ 86 | _instance = [[self alloc] init]; 87 | }); 88 | return _instance; 89 | } 90 | 91 | #pragma mark - get Files in callBack 92 | - (void)getFilesWithCallBack:(callBack)callBack{ 93 | self.files = nil; 94 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ 95 | NSString *filePath = [_instance workSpacePath]; 96 | NSArray *paths = [self.fileManager subpathsAtPath:filePath]; 97 | NSMutableArray *allPathsM = [NSMutableArray array]; 98 | 99 | for (NSString *pathName in paths) { 100 | 101 | if (!self.infoDict) { 102 | if([[[pathName lastPathComponent] pathExtension] isEqualToString:staticPlist]){ 103 | NSString *mPath = [filePath stringByAppendingPathComponent:pathName]; 104 | NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:mPath]; 105 | 106 | if ([dict valueForKeyPath:UIMainStoryboardFile] || [dict valueForKeyPath:NSPrincipalClass]) { 107 | self.infoDict = dict; 108 | } 109 | } 110 | } 111 | 112 | if (![self.headerFileArray inArray:[[pathName lastPathComponent] pathExtension]]){ 113 | continue; 114 | } 115 | 116 | ZLFile *file = [[ZLFile alloc] init]; 117 | file.fileName = [pathName lastPathComponent]; 118 | file.filePath = pathName; 119 | [allPathsM addObject:file]; 120 | } 121 | 122 | NSMutableArray *endPathsM = [NSMutableArray arrayWithArray:allPathsM]; 123 | NSMutableArray *deletePaths = [NSMutableArray array]; 124 | NSMutableArray *storyboardArrayM = [NSMutableArray array]; 125 | 126 | for (ZLFile *file in allPathsM) { 127 | // recoder look storyboard 128 | BOOL isImplementation = NO; 129 | NSString *pathName = file.fileName; 130 | if (![pathName length]) { 131 | continue; 132 | } 133 | NSString *mPath = [filePath stringByAppendingPathComponent:file.filePath]; 134 | if (![mPath length]) { 135 | continue; 136 | } 137 | NSString *content = [[NSString alloc] initWithContentsOfFile:mPath encoding:NSUTF8StringEncoding error:nil]; 138 | if (![content length]) { 139 | continue; 140 | } 141 | NSArray *mPathLineContents = [content componentsSeparatedByString:@"\n"]; 142 | 143 | if (![pathName hasSuffix:staticStoryboard] 144 | ) { 145 | 146 | for (NSString *lineStr in mPathLineContents) { 147 | if (![lineStr length]) { 148 | continue; 149 | } 150 | NSRange implementationRange = [lineStr rangeOfString:staticImplementation]; 151 | if (implementationRange.location != NSNotFound || isImplementation) { 152 | NSRange storyboardRange = [lineStr rangeOfString:staticStoryboardName]; 153 | if (storyboardRange.location != NSNotFound) { 154 | NSString *storyboardName = [lineStr substringFromIndex:storyboardRange.location + storyboardRange.length]; 155 | storyboardName = [storyboardName substringFromIndex:1]; 156 | NSRange range = [storyboardName rangeOfString:@"\""]; 157 | if (range.location > [storyboardName length]) { 158 | continue; 159 | } 160 | storyboardName = [storyboardName substringWithRange:NSMakeRange(0, range.location)]; 161 | [storyboardArrayM addObject:storyboardName]; 162 | } 163 | 164 | isImplementation = YES; 165 | }else{ 166 | NSRange preRange = [lineStr rangeOfString:staticImport]; 167 | 168 | NSRange includeRange = [lineStr rangeOfString:staticInclude]; 169 | if (preRange.location == NSNotFound) { 170 | preRange = includeRange; 171 | } 172 | 173 | if (preRange.location != NSNotFound) { 174 | 175 | NSRange charRange = [lineStr rangeOfString:@"\""]; 176 | NSInteger charIndex = 0; 177 | if (charRange.location != NSNotFound) { 178 | charIndex = (charRange.location - (preRange.location + preRange.length) + charRange.length); 179 | } 180 | 181 | NSString *replaceStr = [lineStr substringFromIndex:preRange.location + preRange.length + charIndex]; 182 | NSString *preStr = [replaceStr stringByReplacingOccurrencesOfString:@"\"" withString:@""]; 183 | if (![[pathName stringByDeletingPathExtension] isEqualToString:[preStr stringByDeletingPathExtension]]) { 184 | [deletePaths addObject:preStr]; 185 | } 186 | } 187 | 188 | } 189 | } 190 | }else { 191 | // storyBoard xml 192 | for (NSString *lineStr in mPathLineContents) { 193 | if (![lineStr length]) { 194 | continue; 195 | } 196 | NSRange lineRange = [lineStr rangeOfString:[NSString stringWithFormat:@"%@=\"",staticStoryboardCustomClass]]; 197 | if(lineRange.location != NSNotFound){ 198 | NSString *str = [lineStr substringFromIndex:lineRange.location + lineRange.length]; 199 | NSRange lineStrRange = [str rangeOfString:@"\""]; 200 | if (lineStrRange.location > [lineStr length]) { 201 | continue; 202 | } 203 | if (lineStrRange.location > [str length]) { 204 | continue; 205 | } 206 | str = [str substringWithRange:NSMakeRange(0, lineStrRange.location)]; 207 | 208 | if (![[pathName stringByDeletingPathExtension] isEqualToString:[str stringByDeletingPathExtension]]) { 209 | [deletePaths addObject:str]; 210 | } 211 | } 212 | 213 | } 214 | } 215 | } 216 | 217 | 218 | for (ZLFile *file in allPathsM) { 219 | if ([self.matchsFileArray inArray:[file.fileName lastPathComponent]]|| [self.matchsFileArray inArray:[file.fileName pathExtension]] || [storyboardArrayM inArray:[file.fileName stringByDeletingPathExtension]]){ 220 | [endPathsM removeObject:file]; 221 | } 222 | 223 | if ([file.fileName rangeOfString:staticAppDelegate].location != NSNotFound 224 | || [file.fileName isEqualToString:[self.infoDict[UIMainStoryboardFile] stringByAppendingPathExtension:staticStoryboard]] 225 | || [[file.fileName stringByDeletingPathExtension] isEqualToString:self.infoDict[NSPrincipalClass]] 226 | ) { 227 | [endPathsM removeObject:file]; 228 | } 229 | 230 | for (NSString *preStr in deletePaths) { 231 | if ( 232 | [[file.fileName stringByDeletingPathExtension] isEqualToString:[preStr stringByDeletingPathExtension]]) { 233 | 234 | [endPathsM removeObject:file]; 235 | break; 236 | } 237 | } 238 | } 239 | 240 | dispatch_async(dispatch_get_main_queue(), ^{ 241 | _files = endPathsM; 242 | callBack(endPathsM); 243 | }); 244 | }); 245 | 246 | 247 | } 248 | 249 | #pragma mark - search files 250 | - (NSArray *)searchFilesWithText:(NSString *)searchText{ 251 | if (!searchText.length) { 252 | return _files; 253 | } 254 | 255 | return [self.files searchArrayWithSearchText:searchText]; 256 | } 257 | 258 | #pragma mark - export Plist 259 | - (NSString *)exportFilesInBundlePlist{ 260 | 261 | NSString *plist = [[[_instance workSpacePath] stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"ZLCheckFilePlugin-Files.plist"]; 262 | 263 | if ([_files exportPlistWithPath:plist]) { 264 | return plist; 265 | } 266 | return nil; 267 | } 268 | 269 | @end 270 | -------------------------------------------------------------------------------- /ZLCheckFilePlugin/ZLFile.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZLFile.h 3 | // ZLCheckFilePlugin 4 | // 5 | // Created by 张磊 on 15-1-15. 6 | // Copyright (c) 2015年 com.zixue101.www. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZLFile : NSObject 12 | 13 | @property (copy,nonatomic) NSString *fileName; 14 | @property (copy,nonatomic) NSString *filePath; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /ZLCheckFilePlugin/ZLFile.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZLFile.m 3 | // ZLCheckFilePlugin 4 | // 5 | // Created by 张磊 on 15-1-15. 6 | // Copyright (c) 2015年 com.zixue101.www. All rights reserved. 7 | // 8 | 9 | #import "ZLFile.h" 10 | 11 | @implementation ZLFile 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ZLCheckFilePlugin/files.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | name 7 | ZLCheckFile.h 8 | path 9 | ZLCheckFile.h 10 | 11 | 12 | name 13 | ZLCheckFile.m 14 | path 15 | ZLCheckFile.m 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /screenhost1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MakeZL/ZLCheckFilePlugin-Xcode/46446306050a583387d56d5872272da4bacd6507/screenhost1.png -------------------------------------------------------------------------------- /screenhost2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MakeZL/ZLCheckFilePlugin-Xcode/46446306050a583387d56d5872272da4bacd6507/screenhost2.png --------------------------------------------------------------------------------