├── DemoXcodePlugin.xcodeproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── mikeash.xcuserdatad │ │ └── UserInterfaceState.xcuserstate ├── xcuserdata │ └── mikeash.xcuserdatad │ │ └── xcschemes │ │ ├── xcschememanagement.plist │ │ └── DemoXcodePlugin.xcscheme └── project.pbxproj └── DemoXcodePlugin ├── DemoXcodePlugin.h ├── DemoXcodePlugin.m └── Info.plist /DemoXcodePlugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DemoXcodePlugin.xcodeproj/project.xcworkspace/xcuserdata/mikeash.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeash/DemoXcodePlugin/HEAD/DemoXcodePlugin.xcodeproj/project.xcworkspace/xcuserdata/mikeash.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /DemoXcodePlugin/DemoXcodePlugin.h: -------------------------------------------------------------------------------- 1 | // 2 | // DemoXcodePlugin.h 3 | // DemoXcodePlugin 4 | // 5 | // Created by Michael Ash on 8/11/15. 6 | // Copyright © 2015 mikeash. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DemoXcodePlugin : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /DemoXcodePlugin.xcodeproj/xcuserdata/mikeash.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DemoXcodePlugin.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | C2720E7E1B7AC45A00AB34D5 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /DemoXcodePlugin/DemoXcodePlugin.m: -------------------------------------------------------------------------------- 1 | // 2 | // DemoXcodePlugin.m 3 | // DemoXcodePlugin 4 | // 5 | // Created by Michael Ash on 8/11/15. 6 | // Copyright © 2015 mikeash. All rights reserved. 7 | // 8 | 9 | #import "DemoXcodePlugin.h" 10 | 11 | #import 12 | #import 13 | 14 | 15 | @implementation DemoXcodePlugin 16 | 17 | + (void)load { 18 | NSLog(@"DemoXcodePlugin loaded"); 19 | 20 | Class nstv = [NSTextView class]; 21 | SEL drawRect = @selector(drawRect:); 22 | Method m = class_getInstanceMethod(nstv, drawRect); 23 | IMP oldImplementation = method_getImplementation(m); 24 | IMP newImplementation = imp_implementationWithBlock(^(NSTextView *self, NSRect rect) { 25 | [[self layoutManager] setUsesScreenFonts: YES]; 26 | ((void (*)(id, SEL, NSRect))oldImplementation)(self, drawRect, rect); 27 | }); 28 | method_setImplementation(m, newImplementation); 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /DemoXcodePlugin/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | XCPluginHasUI 6 | 7 | XC4Compatible 8 | 9 | DVTPlugInCompatibilityUUIDs 10 | 11 | 7FDF5C7A-131F-4ABB-9EDC-8C5F8F0B8A90 12 | 13 | CFBundleDevelopmentRegion 14 | en 15 | CFBundleExecutable 16 | $(EXECUTABLE_NAME) 17 | CFBundleIdentifier 18 | $(PRODUCT_BUNDLE_IDENTIFIER) 19 | CFBundleInfoDictionaryVersion 20 | 6.0 21 | CFBundleName 22 | $(PRODUCT_NAME) 23 | CFBundlePackageType 24 | BNDL 25 | CFBundleShortVersionString 26 | 1.0 27 | CFBundleSignature 28 | ???? 29 | CFBundleVersion 30 | 1 31 | NSHumanReadableCopyright 32 | Copyright © 2015 mikeash. All rights reserved. 33 | NSPrincipalClass 34 | DemoXcodePlugin 35 | 36 | 37 | -------------------------------------------------------------------------------- /DemoXcodePlugin.xcodeproj/xcuserdata/mikeash.xcuserdatad/xcschemes/DemoXcodePlugin.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 47 | 50 | 51 | 52 | 58 | 59 | 60 | 61 | 62 | 63 | 69 | 70 | 76 | 77 | 78 | 79 | 81 | 82 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /DemoXcodePlugin.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | C2720E8C1B7AC53700AB34D5 /* DemoXcodePlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = C2720E8B1B7AC53700AB34D5 /* DemoXcodePlugin.m */; }; 11 | C27E0A461B7AC82E009DCBB6 /* DemoXcodePlugin.xcplugin in CopyFiles */ = {isa = PBXBuildFile; fileRef = C2720E7F1B7AC45A00AB34D5 /* DemoXcodePlugin.xcplugin */; }; 12 | /* End PBXBuildFile section */ 13 | 14 | /* Begin PBXCopyFilesBuildPhase section */ 15 | C27E0A451B7AC81E009DCBB6 /* CopyFiles */ = { 16 | isa = PBXCopyFilesBuildPhase; 17 | buildActionMask = 2147483647; 18 | dstPath = "~/Library/Application Support/Developer/Shared/Xcode/Plug-ins"; 19 | dstSubfolderSpec = 0; 20 | files = ( 21 | C27E0A461B7AC82E009DCBB6 /* DemoXcodePlugin.xcplugin in CopyFiles */, 22 | ); 23 | runOnlyForDeploymentPostprocessing = 0; 24 | }; 25 | /* End PBXCopyFilesBuildPhase section */ 26 | 27 | /* Begin PBXFileReference section */ 28 | C2720E7F1B7AC45A00AB34D5 /* DemoXcodePlugin.xcplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DemoXcodePlugin.xcplugin; sourceTree = BUILT_PRODUCTS_DIR; }; 29 | C2720E821B7AC45A00AB34D5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 30 | C2720E8A1B7AC53700AB34D5 /* DemoXcodePlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DemoXcodePlugin.h; sourceTree = ""; }; 31 | C2720E8B1B7AC53700AB34D5 /* DemoXcodePlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DemoXcodePlugin.m; sourceTree = ""; }; 32 | /* End PBXFileReference section */ 33 | 34 | /* Begin PBXFrameworksBuildPhase section */ 35 | C2720E7C1B7AC45A00AB34D5 /* Frameworks */ = { 36 | isa = PBXFrameworksBuildPhase; 37 | buildActionMask = 2147483647; 38 | files = ( 39 | ); 40 | runOnlyForDeploymentPostprocessing = 0; 41 | }; 42 | /* End PBXFrameworksBuildPhase section */ 43 | 44 | /* Begin PBXGroup section */ 45 | C2720E761B7AC45A00AB34D5 = { 46 | isa = PBXGroup; 47 | children = ( 48 | C2720E811B7AC45A00AB34D5 /* DemoXcodePlugin */, 49 | C2720E801B7AC45A00AB34D5 /* Products */, 50 | ); 51 | sourceTree = ""; 52 | }; 53 | C2720E801B7AC45A00AB34D5 /* Products */ = { 54 | isa = PBXGroup; 55 | children = ( 56 | C2720E7F1B7AC45A00AB34D5 /* DemoXcodePlugin.xcplugin */, 57 | ); 58 | name = Products; 59 | sourceTree = ""; 60 | }; 61 | C2720E811B7AC45A00AB34D5 /* DemoXcodePlugin */ = { 62 | isa = PBXGroup; 63 | children = ( 64 | C2720E821B7AC45A00AB34D5 /* Info.plist */, 65 | C2720E8A1B7AC53700AB34D5 /* DemoXcodePlugin.h */, 66 | C2720E8B1B7AC53700AB34D5 /* DemoXcodePlugin.m */, 67 | ); 68 | path = DemoXcodePlugin; 69 | sourceTree = ""; 70 | }; 71 | /* End PBXGroup section */ 72 | 73 | /* Begin PBXNativeTarget section */ 74 | C2720E7E1B7AC45A00AB34D5 /* DemoXcodePlugin */ = { 75 | isa = PBXNativeTarget; 76 | buildConfigurationList = C2720E851B7AC45A00AB34D5 /* Build configuration list for PBXNativeTarget "DemoXcodePlugin" */; 77 | buildPhases = ( 78 | C2720E7B1B7AC45A00AB34D5 /* Sources */, 79 | C2720E7C1B7AC45A00AB34D5 /* Frameworks */, 80 | C2720E7D1B7AC45A00AB34D5 /* Resources */, 81 | E0C3A1961B8B0A6500B031AA /* Add current xcode plugin keys to plugin info.plist */, 82 | C27E0A451B7AC81E009DCBB6 /* CopyFiles */, 83 | ); 84 | buildRules = ( 85 | ); 86 | dependencies = ( 87 | ); 88 | name = DemoXcodePlugin; 89 | productName = DemoXcodePlugin; 90 | productReference = C2720E7F1B7AC45A00AB34D5 /* DemoXcodePlugin.xcplugin */; 91 | productType = "com.apple.product-type.bundle"; 92 | }; 93 | /* End PBXNativeTarget section */ 94 | 95 | /* Begin PBXProject section */ 96 | C2720E771B7AC45A00AB34D5 /* Project object */ = { 97 | isa = PBXProject; 98 | attributes = { 99 | LastUpgradeCheck = 0700; 100 | ORGANIZATIONNAME = mikeash; 101 | TargetAttributes = { 102 | C2720E7E1B7AC45A00AB34D5 = { 103 | CreatedOnToolsVersion = 7.0; 104 | }; 105 | }; 106 | }; 107 | buildConfigurationList = C2720E7A1B7AC45A00AB34D5 /* Build configuration list for PBXProject "DemoXcodePlugin" */; 108 | compatibilityVersion = "Xcode 3.2"; 109 | developmentRegion = English; 110 | hasScannedForEncodings = 0; 111 | knownRegions = ( 112 | en, 113 | ); 114 | mainGroup = C2720E761B7AC45A00AB34D5; 115 | productRefGroup = C2720E801B7AC45A00AB34D5 /* Products */; 116 | projectDirPath = ""; 117 | projectRoot = ""; 118 | targets = ( 119 | C2720E7E1B7AC45A00AB34D5 /* DemoXcodePlugin */, 120 | ); 121 | }; 122 | /* End PBXProject section */ 123 | 124 | /* Begin PBXResourcesBuildPhase section */ 125 | C2720E7D1B7AC45A00AB34D5 /* Resources */ = { 126 | isa = PBXResourcesBuildPhase; 127 | buildActionMask = 2147483647; 128 | files = ( 129 | ); 130 | runOnlyForDeploymentPostprocessing = 0; 131 | }; 132 | /* End PBXResourcesBuildPhase section */ 133 | 134 | /* Begin PBXShellScriptBuildPhase section */ 135 | E0C3A1961B8B0A6500B031AA /* Add current xcode plugin keys to plugin info.plist */ = { 136 | isa = PBXShellScriptBuildPhase; 137 | buildActionMask = 2147483647; 138 | files = ( 139 | ); 140 | inputPaths = ( 141 | ); 142 | name = "Add current xcode plugin keys to plugin info.plist"; 143 | outputPaths = ( 144 | ); 145 | runOnlyForDeploymentPostprocessing = 0; 146 | shellPath = /bin/zsh; 147 | shellScript = "#!/bin/zsh\n\ninstalledxcodeversions=(`find /Applications -name 'Xcode*' -type d -maxdepth 1 -exec defaults read {}/Contents/Info.plist DVTPlugInCompatibilityUUID \\;`)\n\nfor xcodeversion in $installedxcodeversions\ndo\n echo ${xcodeversion}\n defaults write ${TARGET_BUILD_DIR}/${INFOPLIST_PATH} DVTPlugInCompatibilityUUIDs -array-add ${xcodeversion}\ndone\n\n\n"; 148 | }; 149 | /* End PBXShellScriptBuildPhase section */ 150 | 151 | /* Begin PBXSourcesBuildPhase section */ 152 | C2720E7B1B7AC45A00AB34D5 /* Sources */ = { 153 | isa = PBXSourcesBuildPhase; 154 | buildActionMask = 2147483647; 155 | files = ( 156 | C2720E8C1B7AC53700AB34D5 /* DemoXcodePlugin.m in Sources */, 157 | ); 158 | runOnlyForDeploymentPostprocessing = 0; 159 | }; 160 | /* End PBXSourcesBuildPhase section */ 161 | 162 | /* Begin XCBuildConfiguration section */ 163 | C2720E831B7AC45A00AB34D5 /* Debug */ = { 164 | isa = XCBuildConfiguration; 165 | buildSettings = { 166 | ALWAYS_SEARCH_USER_PATHS = NO; 167 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 168 | CLANG_CXX_LIBRARY = "libc++"; 169 | CLANG_ENABLE_MODULES = YES; 170 | CLANG_ENABLE_OBJC_ARC = YES; 171 | CLANG_WARN_BOOL_CONVERSION = YES; 172 | CLANG_WARN_CONSTANT_CONVERSION = YES; 173 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 174 | CLANG_WARN_EMPTY_BODY = YES; 175 | CLANG_WARN_ENUM_CONVERSION = YES; 176 | CLANG_WARN_INT_CONVERSION = YES; 177 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 178 | CLANG_WARN_UNREACHABLE_CODE = YES; 179 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 180 | COPY_PHASE_STRIP = NO; 181 | DEBUG_INFORMATION_FORMAT = dwarf; 182 | ENABLE_STRICT_OBJC_MSGSEND = YES; 183 | ENABLE_TESTABILITY = YES; 184 | GCC_C_LANGUAGE_STANDARD = gnu99; 185 | GCC_DYNAMIC_NO_PIC = NO; 186 | GCC_NO_COMMON_BLOCKS = YES; 187 | GCC_OPTIMIZATION_LEVEL = 0; 188 | GCC_PREPROCESSOR_DEFINITIONS = ( 189 | "DEBUG=1", 190 | "$(inherited)", 191 | ); 192 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 193 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 194 | GCC_WARN_UNDECLARED_SELECTOR = YES; 195 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 196 | GCC_WARN_UNUSED_FUNCTION = YES; 197 | GCC_WARN_UNUSED_VARIABLE = YES; 198 | MACOSX_DEPLOYMENT_TARGET = 10.10; 199 | MTL_ENABLE_DEBUG_INFO = YES; 200 | ONLY_ACTIVE_ARCH = YES; 201 | SDKROOT = macosx; 202 | }; 203 | name = Debug; 204 | }; 205 | C2720E841B7AC45A00AB34D5 /* Release */ = { 206 | isa = XCBuildConfiguration; 207 | buildSettings = { 208 | ALWAYS_SEARCH_USER_PATHS = NO; 209 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 210 | CLANG_CXX_LIBRARY = "libc++"; 211 | CLANG_ENABLE_MODULES = YES; 212 | CLANG_ENABLE_OBJC_ARC = YES; 213 | CLANG_WARN_BOOL_CONVERSION = YES; 214 | CLANG_WARN_CONSTANT_CONVERSION = YES; 215 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 216 | CLANG_WARN_EMPTY_BODY = YES; 217 | CLANG_WARN_ENUM_CONVERSION = YES; 218 | CLANG_WARN_INT_CONVERSION = YES; 219 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 220 | CLANG_WARN_UNREACHABLE_CODE = YES; 221 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 222 | COPY_PHASE_STRIP = NO; 223 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 224 | ENABLE_NS_ASSERTIONS = NO; 225 | ENABLE_STRICT_OBJC_MSGSEND = YES; 226 | GCC_C_LANGUAGE_STANDARD = gnu99; 227 | GCC_NO_COMMON_BLOCKS = YES; 228 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 229 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 230 | GCC_WARN_UNDECLARED_SELECTOR = YES; 231 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 232 | GCC_WARN_UNUSED_FUNCTION = YES; 233 | GCC_WARN_UNUSED_VARIABLE = YES; 234 | MACOSX_DEPLOYMENT_TARGET = 10.10; 235 | MTL_ENABLE_DEBUG_INFO = NO; 236 | SDKROOT = macosx; 237 | }; 238 | name = Release; 239 | }; 240 | C2720E861B7AC45A00AB34D5 /* Debug */ = { 241 | isa = XCBuildConfiguration; 242 | buildSettings = { 243 | COMBINE_HIDPI_IMAGES = YES; 244 | INFOPLIST_FILE = DemoXcodePlugin/Info.plist; 245 | PRODUCT_BUNDLE_IDENTIFIER = com.mikeash.DemoXcodePlugin; 246 | PRODUCT_NAME = "$(TARGET_NAME)"; 247 | WRAPPER_EXTENSION = xcplugin; 248 | }; 249 | name = Debug; 250 | }; 251 | C2720E871B7AC45A00AB34D5 /* Release */ = { 252 | isa = XCBuildConfiguration; 253 | buildSettings = { 254 | COMBINE_HIDPI_IMAGES = YES; 255 | INFOPLIST_FILE = DemoXcodePlugin/Info.plist; 256 | PRODUCT_BUNDLE_IDENTIFIER = com.mikeash.DemoXcodePlugin; 257 | PRODUCT_NAME = "$(TARGET_NAME)"; 258 | WRAPPER_EXTENSION = xcplugin; 259 | }; 260 | name = Release; 261 | }; 262 | /* End XCBuildConfiguration section */ 263 | 264 | /* Begin XCConfigurationList section */ 265 | C2720E7A1B7AC45A00AB34D5 /* Build configuration list for PBXProject "DemoXcodePlugin" */ = { 266 | isa = XCConfigurationList; 267 | buildConfigurations = ( 268 | C2720E831B7AC45A00AB34D5 /* Debug */, 269 | C2720E841B7AC45A00AB34D5 /* Release */, 270 | ); 271 | defaultConfigurationIsVisible = 0; 272 | defaultConfigurationName = Release; 273 | }; 274 | C2720E851B7AC45A00AB34D5 /* Build configuration list for PBXNativeTarget "DemoXcodePlugin" */ = { 275 | isa = XCConfigurationList; 276 | buildConfigurations = ( 277 | C2720E861B7AC45A00AB34D5 /* Debug */, 278 | C2720E871B7AC45A00AB34D5 /* Release */, 279 | ); 280 | defaultConfigurationIsVisible = 0; 281 | defaultConfigurationName = Release; 282 | }; 283 | /* End XCConfigurationList section */ 284 | }; 285 | rootObject = C2720E771B7AC45A00AB34D5 /* Project object */; 286 | } 287 | --------------------------------------------------------------------------------