├── .gitignore ├── RegX ├── Info.plist ├── RegX-Bridging-Header.h ├── RegXPlugin.h ├── RegularExpressionGroupSettings.swift ├── RegXPlugin.m ├── String+Extensions.swift ├── RegXLogging.swift ├── RegXPlugin.swift ├── RegularForm.swift ├── XCodeInternals.m ├── Functional.swift ├── XCodeInternals.h ├── XCodeService.swift ├── Regularizer.swift └── Configuration.swift ├── UnitTests ├── UnitTests-Bridging-Header.h ├── Info.plist └── TestAlign.swift ├── RegX.xcodeproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── RegX.xccheckout └── project.pbxproj ├── LICENSE.md └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | *.xcodeproj/xcuserdata/ 4 | -------------------------------------------------------------------------------- /RegX/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kzaher/RegX/HEAD/RegX/Info.plist -------------------------------------------------------------------------------- /UnitTests/UnitTests-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | 6 | #import "XCodeInternals.h" -------------------------------------------------------------------------------- /RegX/RegX-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | #import "XCodeInternals.h" 6 | #import "RegXPlugin.h" 7 | -------------------------------------------------------------------------------- /RegX.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /RegX/RegXPlugin.h: -------------------------------------------------------------------------------- 1 | // 2 | // RegXPlugin.h 3 | // RegX 4 | // 5 | // Created by Krunoslav Zaher on 9/10/16. 6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface RegXPlugin : NSObject 12 | 13 | 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /RegX/RegularExpressionGroupSettings.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RegularExpressionGroupSettings.swift 3 | // RegX 4 | // 5 | // Created by Krunoslav Zaher on 10/15/14. 6 | // Copyright (c) 2014 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class RegularExpressionGroupSettings { 12 | let needsSpaceAtThenEnd : Bool = false 13 | } 14 | -------------------------------------------------------------------------------- /RegX/RegXPlugin.m: -------------------------------------------------------------------------------- 1 | // 2 | // RegXPlugin.m 3 | // RegX 4 | // 5 | // Created by Krunoslav Zaher on 9/10/16. 6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | #import "RegXPlugin.h" 10 | #import "RegX-Swift.h" 11 | 12 | @implementation RegXPlugin 13 | 14 | + (void) load{ 15 | NSBundle* app = [NSBundle mainBundle]; 16 | NSString* identifier = [app bundleIdentifier]; 17 | 18 | // Load only into Xcode 19 | if( ![identifier isEqualToString:@"com.apple.dt.Xcode"] ){ 20 | return; 21 | } 22 | 23 | [self pluginDidLoadWithPlugin:app]; 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /RegX/String+Extensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // String+Extensions.swift 3 | // RegX 4 | // 5 | // Created by Krunoslav Zaher on 9/9/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | extension String { 12 | func count() -> Int { 13 | return distance(from: startIndex, to: self.endIndex) 14 | } 15 | 16 | func index(at: Int) -> Index { 17 | return self.index(self.startIndex, offsetBy: at) 18 | } 19 | 20 | func character(_ index: Int) -> Character { 21 | let characterIndex = self.characters.index(self.characters.startIndex, offsetBy: index) 22 | return self.characters[characterIndex] 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /RegX/RegXLogging.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Logging.swift 3 | // RegX 4 | // 5 | // Created by Krunoslav Zaher on 10/18/14. 6 | // Copyright (c) 2014 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | #if DEBUG = 1 12 | public let Log = NSLog 13 | #else 14 | public let Log = NilLogger 15 | #endif 16 | 17 | func NilLogger(_ format: String, args: CVarArg...) { 18 | 19 | } 20 | 21 | protocol ErrorPresenter { 22 | func showError(errorText: String) 23 | } 24 | 25 | class AlertErrorPresenter: ErrorPresenter { 26 | func showError(errorText: String) { 27 | let alert = NSAlert() 28 | alert.messageText = errorText 29 | alert.addButton(withTitle: "OK") 30 | 31 | NSLog(errorText) 32 | alert.runModal() 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /UnitTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 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 | 24 | 25 | -------------------------------------------------------------------------------- /RegX/RegXPlugin.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RegXPlugin.swift 3 | // RegX 4 | // 5 | // Created by Krunoslav Zaher on 10/18/14. 6 | // Copyright (c) 2014 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | var service : XCodeService? = nil 12 | 13 | extension RegXPlugin { 14 | private struct Instances { 15 | static var service : XCodeService? = nil 16 | } 17 | 18 | public class func pluginDidLoad(plugin: Bundle) { 19 | Log("RegXPlugin Loaded") 20 | 21 | let sharedApplication = NSApplication.shared() 22 | let errorPresenter = AlertErrorPresenter() 23 | 24 | let tabWidth = { 1 } // { return Int(RegX_tabWidth()) } 25 | 26 | Instances.service = XCodeService(xcodeApp:sharedApplication, 27 | tabWidth: tabWidth, 28 | notificationCenter: NotificationCenter.default, 29 | errorPresenter: errorPresenter, 30 | forms: Configuration.forms) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | **Copyright (c) 2014 Krunoslav Zaher** 2 | **All rights reserved.** 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | -------------------------------------------------------------------------------- /RegX/RegularForm.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RegularForm.swift 3 | // RegX 4 | // 5 | // Created by Krunoslav Zaher on 10/18/14. 6 | // Copyright (c) 2014 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import AppKit 11 | 12 | struct GroupSettings { 13 | let paddingBefore: Int? 14 | let paddingAfter: Int? 15 | 16 | init(_ paddingBefore: Int?, _ paddingAfter: Int?) { 17 | self.paddingBefore = paddingBefore 18 | self.paddingAfter = paddingAfter 19 | } 20 | } 21 | 22 | struct RegularForm { 23 | let name : String 24 | let pattern : String 25 | let shortcut : String 26 | let modifier : NSEventModifierFlags 27 | let settings : [GroupSettings] 28 | 29 | func alignColumns(text: String, tabWidth: Int) -> String { 30 | let regularExpression = try! 31 | NSRegularExpression(pattern: pattern, 32 | options: NSRegularExpression.Options.allowCommentsAndWhitespace) 33 | 34 | return Regularizer(tabWidth: tabWidth).regularize(text: text, 35 | settings: settings, 36 | regularExpression: regularExpression) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /RegX/XCodeInternals.m: -------------------------------------------------------------------------------- 1 | // 2 | // XCodeInternals.m 3 | // RegX 4 | // 5 | // Created by Krunoslav Zaher on 10/18/14. 6 | // Copyright (c) 2014 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | #import "XCodeInternals.h" 10 | 11 | id RegX_performSelector(id object, NSString *selector) { 12 | SEL selectorObject = NSSelectorFromString(selector); 13 | id (*method)(id, SEL) = (void*)[object methodForSelector:selectorObject]; 14 | if (method == nil) { 15 | return nil; 16 | } 17 | 18 | id result = method(object, selectorObject); 19 | 20 | return result; 21 | } 22 | 23 | void RegX_replaceSelectedText(IDESourceCodeDocument *document, NSRange range, NSString *text) { 24 | DVTSourceTextStorage *textStorage = document.textStorage; 25 | [textStorage beginEditing]; 26 | [textStorage replaceCharactersInRange:range withString:text withUndoManager:document.undoManager]; 27 | [textStorage endEditing]; 28 | } 29 | 30 | NSRange RegX_fixRange(IDESourceCodeDocument *document, NSRange range) { 31 | DVTSourceTextStorage *textStorage = document.textStorage; 32 | 33 | NSRange lineRange = [textStorage lineRangeForCharacterRange:range]; 34 | NSRange characterRange = [textStorage characterRangeForLineRange:lineRange]; 35 | 36 | return characterRange; 37 | } 38 | 39 | #if LOGIC_TESTS 40 | long long RegX_tabWidth() { 41 | assert(false); 42 | } 43 | #else 44 | long long RegX_tabWidth() { 45 | return DVTTextPreferences.preferences.tabWidth; 46 | } 47 | #endif -------------------------------------------------------------------------------- /RegX.xcodeproj/project.xcworkspace/xcshareddata/RegX.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 060DE94D-D5C5-47B8-8179-619A12262790 9 | IDESourceControlProjectName 10 | RegX 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | B6952A2EA6A26CAA10AE5DDD2DF1734B7CAED591 14 | github.com:kzaher/RegX.git 15 | 16 | IDESourceControlProjectPath 17 | RegX.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | B6952A2EA6A26CAA10AE5DDD2DF1734B7CAED591 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | github.com:kzaher/RegX.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | B6952A2EA6A26CAA10AE5DDD2DF1734B7CAED591 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | B6952A2EA6A26CAA10AE5DDD2DF1734B7CAED591 36 | IDESourceControlWCCName 37 | RegX 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | RegX 2 | ==== 3 | 4 | Prettify plugin for Xcode. It enables alignment of specific source code elements and makes code easier to read and understand. 5 | 6 | ![How does it work](/../content/images/demo.gif?raw=true "How does it work?") 7 | 8 | # Installation 9 | 10 | 1. `$ git clone git@github.com:kzaher/RegX.git` 11 | 2. Build in Xcode. (building will automagically install it) 12 | 3. Restart Xcode and that should be it. 13 | 14 | If it doesn't work, please check messages in console (`Console.app`) while starting Xcode and look for error messages. There is a possibility that you have Xcode version whose DVTPlugInCompatibilityUUID hasn't been specified in Info.plist. To resolve the issue, add your DVTPlugInCompatibilityUUID to Info.plist 15 | 16 | # How does it work? 17 | 18 | RegX uses regular expressions to group text in columns and align those columns. 19 | Every regular expression group creates one vertically aligned column. 20 | Additional settings for columns can be specified. 21 | 22 | # Customization 23 | 24 | All of the regular expressions and settings for them are defined in a file called 'Configuration.swift'. 25 | 26 | e.g. 27 | 28 | ```swift 29 | static let assignments = "^" + 30 | " (?# lvalue GROUP)" + 31 | " ([^=]*)" + 32 | " (?# = GROUP)" + 33 | " (\\=) " + 34 | " (?# expression GROUP)" + 35 | " ((?:[^/] | (?:/(?!/)) )*)" + 36 | " (?# comments GROUP)" + 37 | " (//.*)?" + 38 | "$" 39 | ``` 40 | 41 | ```swift 42 | RegularForm(name: "Assignments", // name in Edit -> RegX menu 43 | pattern: Patterns.assignments, // grouping regular expression 44 | shortcut: String(UnicodeScalar(NSF4FunctionKey)), // shortcut key 45 | modifier: NSEventModifierFlags.CommandKeyMask, // shortcut modifier 46 | settings: [ // each setting controls start and end padding 47 | GroupSettings(nil, 0), // nil means keep existing padding 48 | GroupSettings(1, 1), // value means ensure padding 49 | GroupSettings(0, 0), 50 | GroupSettings(1, 0), 51 | ] 52 | ) 53 | ``` 54 | -------------------------------------------------------------------------------- /RegX/Functional.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Functional.swift 3 | // RegX 4 | // 5 | // Created by Krunoslav Zaher on 10/19/14. 6 | // Copyright (c) 2014 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | // this is because of accessing privately defined members 10 | enum OptionalReflection { 11 | case Failure(AnyObject?, String) 12 | case Success(AnyObject!) 13 | 14 | var hasValue : Bool { 15 | get { 16 | switch (self) { 17 | case .Success(let object) : return object != nil; 18 | default: return false; 19 | } 20 | } 21 | } 22 | 23 | var value : AnyObject { 24 | get { 25 | switch (self) { 26 | case .Success(let result) : return result 27 | default: fatalError("Doesn't have value") 28 | } 29 | } 30 | } 31 | 32 | var description : String { 33 | get { 34 | switch self { 35 | case .Success(let object) : return "\(object)" 36 | case .Failure(let object, let selectors) : return "\(object):\(selectors)" 37 | } 38 | } 39 | } 40 | } 41 | 42 | precedencegroup VeryLowPrecedence { 43 | associativity: left 44 | lowerThan: AssignmentPrecedence 45 | } 46 | 47 | infix operator .. : VeryLowPrecedence 48 | postfix operator !! 49 | func .. (object: OptionalReflection, selector: String) -> OptionalReflection { 50 | switch(object) { 51 | case .Failure(_, _): return object; 52 | case .Success(let object): 53 | let result : AnyObject! = RegX_performSelector(object, selector) as AnyObject; 54 | return result != nil 55 | ? OptionalReflection.Success(result) 56 | : OptionalReflection.Failure(object, selector) 57 | } 58 | } 59 | 60 | func .. (object: AnyObject!, selector: String) -> OptionalReflection { 61 | if object == nil { 62 | return .Failure(nil, selector) 63 | } 64 | 65 | let result : AnyObject! = RegX_performSelector(object, selector) as AnyObject; 66 | 67 | if result == nil { 68 | return .Failure(object!, selector) 69 | } 70 | 71 | return .Success(result) 72 | } 73 | 74 | func .. (object: OptionalReflection, selectors: [String]) -> OptionalReflection { 75 | switch object { 76 | case .Failure(_, _): return object 77 | default: break 78 | } 79 | 80 | for selector in selectors { 81 | let result = object .. selector 82 | 83 | switch result { 84 | case .Success(_):return result 85 | default:break 86 | } 87 | } 88 | 89 | return .Failure(object.value, "\(selectors)") 90 | } 91 | -------------------------------------------------------------------------------- /RegX/XCodeInternals.h: -------------------------------------------------------------------------------- 1 | // 2 | // XCodeInternals.h 3 | // RegX 4 | // 5 | // Created by Krunoslav Zaher on 10/18/14. 6 | // Copyright (c) 2014 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class IDESourceCodeDocument; 12 | 13 | id RegX_performSelector(id object, NSString *selector); 14 | void RegX_replaceSelectedText(id document, NSRange range, NSString *text); 15 | NSRange RegX_fixRange(id document, NSRange range); 16 | long long RegX_tabWidth(); 17 | 18 | @interface DVTTextDocumentLocation : NSObject 19 | @property (readonly) NSRange characterRange; 20 | @property (readonly) NSRange lineRange; 21 | @end 22 | 23 | @interface DVTTextPreferences : NSObject 24 | + (DVTTextPreferences*)preferences; 25 | @property BOOL trimWhitespaceOnlyLines; 26 | @property BOOL trimTrailingWhitespace; 27 | @property BOOL useSyntaxAwareIndenting; 28 | @property long long tabWidth; 29 | @end 30 | 31 | @interface DVTSourceTextStorage : NSTextStorage 32 | - (void)replaceCharactersInRange:(NSRange)range withString:(NSString *)string withUndoManager:(id)undoManager; 33 | - (NSRange)lineRangeForCharacterRange:(NSRange)range; 34 | - (NSRange)characterRangeForLineRange:(NSRange)range; 35 | - (void)indentCharacterRange:(NSRange)range undoManager:(id)undoManager; 36 | @end 37 | 38 | @interface DVTFileDataType : NSObject 39 | @property (readonly) NSString *identifier; 40 | @end 41 | 42 | @interface DVTFilePath : NSObject 43 | @property (readonly) NSURL *fileURL; 44 | @property (readonly) DVTFileDataType *fileDataTypePresumed; 45 | @end 46 | 47 | @interface IDEContainerItem : NSObject 48 | @property (readonly) DVTFilePath *resolvedFilePath; 49 | @end 50 | 51 | @interface IDEGroup : IDEContainerItem 52 | 53 | @end 54 | 55 | @interface IDEFileReference : IDEContainerItem 56 | 57 | @end 58 | 59 | @interface IDENavigableItem : NSObject 60 | @property (readonly) IDENavigableItem *parentItem; 61 | @property (readonly) id representedObject; 62 | @end 63 | 64 | @interface IDEFileNavigableItem : IDENavigableItem 65 | @property (readonly) DVTFileDataType *documentType; 66 | @property (readonly) NSURL *fileURL; 67 | @end 68 | 69 | @interface IDEStructureNavigator : NSObject 70 | @property (retain) NSArray *selectedObjects; 71 | @end 72 | 73 | @interface IDENavigableItemCoordinator : NSObject 74 | - (id)structureNavigableItemForDocumentURL:(id)arg1 inWorkspace:(id)arg2 error:(id *)arg3; 75 | @end 76 | 77 | @interface IDENavigatorArea : NSObject 78 | - (id)currentNavigator; 79 | @end 80 | 81 | @interface IDEWorkspaceTabController : NSObject 82 | @property (readonly) IDENavigatorArea *navigatorArea; 83 | @end 84 | 85 | @interface IDEDocumentController : NSDocumentController 86 | + (id)editorDocumentForNavigableItem:(id)arg1; 87 | + (id)retainedEditorDocumentForNavigableItem:(id)arg1 error:(id *)arg2; 88 | + (void)releaseEditorDocument:(id)arg1; 89 | @end 90 | 91 | @interface IDESourceCodeDocument : NSDocument 92 | - (DVTSourceTextStorage *)textStorage; 93 | - (NSUndoManager *)undoManager; 94 | @end 95 | 96 | @interface IDESourceCodeComparisonEditor : NSObject 97 | @property (readonly) NSTextView *keyTextView; 98 | @property (retain) NSDocument *primaryDocument; 99 | @end 100 | 101 | @interface IDESourceCodeEditor : NSObject 102 | @property (retain) NSTextView *textView; 103 | - (IDESourceCodeDocument *)sourceCodeDocument; 104 | @end 105 | 106 | @interface IDEEditorContext : NSObject 107 | - (id)editor; // returns the current editor. If the editor is the code editor, the class is `IDESourceCodeEditor` 108 | @end 109 | 110 | @interface IDEEditorArea : NSObject 111 | - (IDEEditorContext *)lastActiveEditorContext; 112 | @end 113 | 114 | @interface IDEWorkspaceWindowController : NSObject 115 | @property (readonly) IDEWorkspaceTabController *activeWorkspaceTabController; 116 | - (IDEEditorArea *)editorArea; 117 | @end 118 | 119 | @interface IDEWorkspace : NSObject 120 | @property (readonly) DVTFilePath *representingFilePath; 121 | @end 122 | 123 | @interface IDEWorkspaceDocument : NSDocument 124 | @property (readonly) IDEWorkspace *workspace; 125 | @end 126 | -------------------------------------------------------------------------------- /RegX/XCodeService.swift: -------------------------------------------------------------------------------- 1 | // 2 | // XCodeService.swift 3 | // RegX 4 | // 5 | // Created by Krunoslav Zaher on 10/18/14. 6 | // Copyright (c) 2014 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import AppKit 11 | 12 | class XCodeService : NSObject { 13 | 14 | let notificationCenter : NotificationCenter 15 | let xcodeApp : NSApplication 16 | let tabWidth : () -> Int 17 | let errorPresenter : ErrorPresenter 18 | let forms : [RegularForm] 19 | 20 | init(xcodeApp: NSApplication, 21 | tabWidth: @escaping () -> Int, 22 | notificationCenter: NotificationCenter, 23 | errorPresenter: ErrorPresenter, 24 | forms: [RegularForm]) { 25 | 26 | self.xcodeApp = xcodeApp 27 | self.tabWidth = tabWidth 28 | self.notificationCenter = notificationCenter 29 | self.errorPresenter = errorPresenter 30 | self.forms = forms 31 | 32 | super.init() 33 | 34 | self.notificationCenter.addObserver(self, selector: #selector(NSApplicationDelegate.applicationDidFinishLaunching(_:)), name: NSNotification.Name.NSApplicationDidFinishLaunching, object: nil) 35 | } 36 | 37 | func showError(error: String) { 38 | self.errorPresenter.showError(errorText: error) 39 | } 40 | 41 | func registerItemsAndShortcuts() { 42 | let refactorItem = self.xcodeApp.mainMenu?.item(withTitle: "Edit")?.submenu?.item(withTitle: "Refactor") 43 | 44 | if refactorItem == nil { 45 | showError(error: "Can't find refactor menu") 46 | return; 47 | } 48 | 49 | let regXMenuItem = NSMenuItem(title: "RegX", action:nil, keyEquivalent: "R") 50 | let mask 51 | = NSEventModifierFlags.command 52 | .union(NSEventModifierFlags.option) 53 | regXMenuItem.keyEquivalentModifierMask = mask 54 | 55 | let indexToInsert = refactorItem!.menu!.index(of: refactorItem!) + 1 56 | 57 | refactorItem!.menu!.insertItem(regXMenuItem, at: indexToInsert) 58 | 59 | let regXMenu = NSMenu(title:"RegX") 60 | 61 | var index = 0 62 | for form in self.forms { 63 | let formItem = NSMenuItem(title: form.name, 64 | action: #selector(XCodeService.regularizeCommand(_:)), 65 | keyEquivalent: form.shortcut) 66 | formItem.keyEquivalentModifierMask = form.modifier 67 | 68 | formItem.target = self 69 | formItem.representedObject = index 70 | regXMenu.addItem(formItem) 71 | 72 | index += 1 73 | } 74 | 75 | regXMenuItem.submenu = regXMenu 76 | } 77 | 78 | func regularizeCommand(_ item: NSMenuItem) { 79 | let index : Int = item.representedObject as! Int 80 | let form = forms[index] 81 | 82 | changeSelectedText { (selectedText) -> String in 83 | return form.alignColumns(text: selectedText, tabWidth:self.tabWidth()) 84 | } 85 | } 86 | 87 | func applicationDidFinishLaunching(_ notification: NSNotification) { 88 | Log("Application did Finish Launching") 89 | registerItemsAndShortcuts() 90 | } 91 | 92 | class func substring(string: String, range: NSRange) -> String { 93 | let start = string.index(at: Int(range.location)) 94 | let end = string.index(at: Int(range.location + range.length)) 95 | let range = Range(uncheckedBounds: (lower: start, upper: end)) 96 | return string.substring(with: range) 97 | } 98 | 99 | class func paragraphRange(string: NSString, range: NSRange) -> NSRange { 100 | let emptyLineRegex = try! NSRegularExpression(pattern: "^\\s*$", options: NSRegularExpression.Options.anchorsMatchLines) 101 | 102 | let lineMatches = emptyLineRegex.matches(in: string as String, options: NSRegularExpression.MatchingOptions(rawValue: 0), range: NSMakeRange(0, string.length)) 103 | 104 | let lineStartIndexes : [Int] = lineMatches.map { 105 | let location = $0.range.location 106 | return location != NSNotFound ? location : 0 107 | } 108 | 109 | let rangeEnd = range.location + range.length 110 | 111 | let paragraphSeparatorBeforeRange = lineStartIndexes.filter { $0 < range.location }.last 112 | let paragraphSeparatorAfterRange = lineStartIndexes.filter { $0 > rangeEnd }.first 113 | 114 | let startIndex = paragraphSeparatorBeforeRange != nil ? paragraphSeparatorBeforeRange! : 0 115 | let endIndex = paragraphSeparatorAfterRange != nil ? paragraphSeparatorAfterRange! : string.length 116 | 117 | return NSMakeRange(startIndex, endIndex - startIndex) 118 | } 119 | 120 | func changeSelectedText(_ changeAction: (_ selectedText : String) -> String) { 121 | let controller = self.xcodeApp .. "keyWindow" .. "windowController" 122 | let editor = controller .. "editorArea" .. "lastActiveEditorContext" .. "editor" 123 | let currentDocumentOptional = editor .. ["sourceCodeDocument", "primaryDocument"] 124 | let currentTextViewOptional = editor .. ["textView", "keyTextView"] 125 | 126 | if !currentTextViewOptional.hasValue || !currentDocumentOptional.hasValue { 127 | errorPresenter.showError(errorText: "Invalid context. Aligning only works in source code windows. \(currentTextViewOptional.description)") 128 | return 129 | } 130 | 131 | let currentTextView = currentTextViewOptional.value as? NSTextView 132 | 133 | let firstRange = currentTextView!.selectedRanges.first 134 | 135 | if firstRange == nil { 136 | errorPresenter.showError(errorText: "Please select range.") 137 | return 138 | } 139 | 140 | let code = currentTextView!.textStorage?.string 141 | 142 | if code == nil { 143 | errorPresenter.showError(errorText: "Can't fetch code.") 144 | return 145 | } 146 | 147 | let firstRangeValue = firstRange!.rangeValue 148 | 149 | let range = firstRangeValue.length == 0 150 | ? XCodeService.paragraphRange(string: code! as NSString, range: firstRangeValue) 151 | : RegX_fixRange(currentDocumentOptional.value, firstRangeValue) 152 | 153 | let selectedCode = XCodeService.substring(string: code!, range:range) 154 | 155 | let resultSelectedCode = changeAction(selectedCode) 156 | 157 | RegX_replaceSelectedText(currentDocumentOptional.value, range, resultSelectedCode) 158 | } 159 | 160 | deinit { 161 | self.notificationCenter.removeObserver(self) 162 | } 163 | } 164 | -------------------------------------------------------------------------------- /RegX/Regularizer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Regularize.swift 3 | // RegX 4 | // 5 | // Created by Krunoslav Zaher on 10/15/14. 6 | // Copyright (c) 2014 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class Regularizer { 12 | let tabWidth : Int 13 | 14 | init (tabWidth : Int) { 15 | self.tabWidth = tabWidth 16 | } 17 | 18 | private enum ParsedLineResult { 19 | case Raw(String) 20 | case Sections([String]) 21 | 22 | func description() -> String { 23 | switch (self) { 24 | case .Raw(let line):return line 25 | case .Sections(let columns):return columns.joined(separator: "|") 26 | } 27 | } 28 | 29 | var numberOfColumns : Int { 30 | switch (self) { 31 | case .Raw: 32 | assert(false) 33 | return 0 34 | case .Sections(let columns): 35 | return columns.count 36 | } 37 | } 38 | } 39 | 40 | private class func maxColumnWidth(parsedLines : [ParsedLineResult], index: Int) -> Int { 41 | return parsedLines.reduce(0) { max, line -> Int in 42 | switch line { 43 | case .Raw(_): 44 | return max 45 | case .Sections(let columns): 46 | if columns.count > index { 47 | let column = columns[index] 48 | let length = column.count() 49 | return length > max ? length : max 50 | } 51 | else { 52 | return max 53 | } 54 | } 55 | } 56 | } 57 | 58 | private class func paddColumnToWidths(parsedLines : [ParsedLineResult], widths: [Int]) -> [ParsedLineResult] { 59 | return parsedLines.map { line in 60 | switch (line) { 61 | case .Sections(let columns): 62 | let transformed = zip(columns, widths).map { 63 | ($0 as NSString).padding(toLength: $1, withPad: " ", startingAt: 0) 64 | } 65 | return .Sections(transformed) 66 | default: 67 | return line 68 | } 69 | } 70 | } 71 | 72 | private class func isWhitespace(char: Character) -> Bool { 73 | // other solutions is swift were too compicated 74 | // this was good enough 75 | return char == " " || char == "\n" || char == "\t" 76 | } 77 | 78 | private class func trimStartWhitespace(string: String) -> String { 79 | for i in 0 ..< string.characters.count { 80 | let char = string.character(i) 81 | if !Regularizer.isWhitespace(char: char) { 82 | let range = string.index(at: i) ..< string.endIndex 83 | return string.substring(with: range) 84 | } 85 | } 86 | 87 | return "" 88 | } 89 | 90 | private class func trimEndWhitespace(string: String) -> String { 91 | for i in (0 ..< string.characters.count).reversed() { 92 | let char = string.character(i) 93 | if !Regularizer.isWhitespace(char: char) { 94 | let range = string.startIndex ..< string.index(at: i + 1) 95 | return string.substring(with: range) 96 | } 97 | } 98 | 99 | return "" 100 | } 101 | 102 | private class func trim(string: String, start: Bool, end: Bool) -> String { 103 | let str1 = start ? Regularizer.trimStartWhitespace(string: string) : string 104 | let str2 = end ? Regularizer.trimEndWhitespace(string: str1) : str1 105 | 106 | return str2 107 | } 108 | 109 | private func finalColumnWidth(startWidth: Int) -> Int { 110 | let minimalTargetWidth = startWidth 111 | 112 | let tabWidth = self.tabWidth > 0 ? self.tabWidth: 4 113 | 114 | return minimalTargetWidth % tabWidth == 0 115 | ? minimalTargetWidth 116 | : ((minimalTargetWidth / tabWidth) + 1) * tabWidth 117 | } 118 | 119 | func regularize(text: String, 120 | settings:[GroupSettings], 121 | regularExpression: NSRegularExpression) -> String { 122 | let lines = text.components(separatedBy: "\n") 123 | 124 | let parsedLines : [ParsedLineResult] = lines.map { line -> ParsedLineResult in 125 | if (line.count() == 0) { 126 | return ParsedLineResult.Raw(line) 127 | } 128 | 129 | let range = NSMakeRange(0, line.count()) 130 | let matches = regularExpression.matches(in: line, options: NSRegularExpression.MatchingOptions(), range:range) 131 | 132 | if (matches.count == 0) { 133 | return ParsedLineResult.Raw(line) 134 | } 135 | 136 | let match : NSTextCheckingResult = matches[0] 137 | var tokens : [String] = [] 138 | 139 | var widthGroup = 0 140 | for i in 1.. sections.count ? $0 : sections.count 169 | default: 170 | return $0 171 | } 172 | } 173 | 174 | var resultColumns = parsedLines 175 | let widths = (0.. String in 182 | switch (line) { 183 | case .Sections(let columns): 184 | return Regularizer.trimEndWhitespace(string: columns.joined(separator: "")) 185 | case .Raw(let content): 186 | return content 187 | } 188 | } 189 | 190 | return linesWithJoinedLineContent.joined(separator: "\n") 191 | } 192 | } 193 | -------------------------------------------------------------------------------- /RegX/Configuration.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Configuration.swift 3 | // RegX 4 | // 5 | // Created by Krunoslav Zaher on 10/19/14. 6 | // Copyright (c) 2014 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | struct Configuration { 10 | 11 | struct Patterns { 12 | // 13 | // https://www.debuggex.com/ <- use it 14 | // Unit test will print concatenated pattern in console. 15 | // The printed pattern has comments and '#' and that breaks the tool, 16 | // so unit tests print expression that has no comments and '#' so it's 17 | // suitable for pasting into the browser. 18 | 19 | static func nonterminatedVariable(preserveStartSpace: Bool) -> String { 20 | let preserveStartSpacePattern = preserveStartSpace ? "\\s*" : "" 21 | return "" + 22 | " (?# type declaration GROUP) " + 23 | " (" + preserveStartSpacePattern + "" + 24 | " (?:[^\\s] " + 25 | " (?: [^\\*=/] | (?:(?<=/)\\*) | (?:\\*(?=/)) | (?:/(?!/)) )*" + 26 | " )" + 27 | " )" + 28 | " (?# space GROUP) " + 29 | " (?:\\s*)" + 30 | " (?# pointer GROUP) " + 31 | " ((?:(? String { 43 | let stripCommentsRegex = try! NSRegularExpression(pattern:"\\(\\?#[^\\)]*\\)", options: NSRegularExpression.Options()) 44 | 45 | let range = NSMakeRange(0, pattern.count()) 46 | 47 | let nsPattern : NSString = pattern as NSString 48 | let mutableNsPattern : NSMutableString = nsPattern.mutableCopy() as! NSMutableString 49 | 50 | stripCommentsRegex.replaceMatches(in: mutableNsPattern, options: NSRegularExpression.MatchingOptions(), range:range, withTemplate: "") 51 | 52 | let hashless = mutableNsPattern.replacingOccurrences(of: "#", with: "") 53 | 54 | return hashless 55 | } 56 | 57 | private func testOriginal(original: String, target: String, specifier: RegularForm) { 58 | let result : String = specifier.alignColumns(text: original, tabWidth:1) 59 | if result != target { 60 | print("RegEx pattern: \n\(specifier.pattern)") 61 | print("RegEx to debug on https://www.debuggex.com/ (choose PCRE and ignore spaces option):\n\(escapeForVisualization(pattern: specifier.pattern))") 62 | print("result: \n\(result)") 63 | } 64 | compareResult(result: result, test:target) 65 | } 66 | 67 | func testObjCTestAlignmentForVariables() { 68 | testOriginal( 69 | original: 70 | " NSString* wrong;\n" + 71 | " NSString *hello;\n" + 72 | " id *hello2;\n" + 73 | " id/**/ hello2;\n", 74 | target: 75 | " NSString *wrong;\n" + 76 | " NSString *hello;\n" + 77 | " id *hello2;\n" + 78 | " id/**/ hello2;\n", 79 | specifier: Configuration.forms[2]) 80 | } 81 | 82 | func testObjCTestAlignmentForVariablesAndComments() { 83 | testOriginal( 84 | original: 85 | " NSString* wrong; // *a;\n" + 86 | " NSString *hello; // 12310238193* sdfs = 34;\n" + 87 | " id *hello2;\n" + 88 | " id/**/ hello2;\n", 89 | target: 90 | " NSString *wrong; // *a;\n" + 91 | " NSString *hello; // 12310238193* sdfs = 34;\n" + 92 | " id *hello2;\n" + 93 | " id/**/ hello2;\n", 94 | specifier: Configuration.forms[2]) 95 | } 96 | 97 | func testObjCTestAlignmentForVariablesWithInitializers() { 98 | testOriginal( 99 | original: 100 | " NSString* wrong = [something there];\n" + 101 | " NSString *hello = adaa();\n" + 102 | " id *hello2 = 34 * lj;\n" + 103 | " id/**/ hello2 = nil;\n", 104 | target: 105 | " NSString *wrong = [something there];\n" + 106 | " NSString *hello = adaa();\n" + 107 | " id *hello2 = 34 * lj;\n" + 108 | " id/**/ hello2 = nil;\n", 109 | specifier: Configuration.forms[2]) 110 | } 111 | 112 | func testObjCTestAlignmentForVariablesWithInitializersAndComments() { 113 | testOriginal( 114 | original: 115 | " NSString* wrong = [something there]; // a\n" + 116 | " NSString *hello = adaa(); // * dsds\n" + 117 | " id *hello2 = 34 * lj; // = 23\n" + 118 | " id/**/ hello2 = nil; // * sds = 34343\n", 119 | target: 120 | " NSString *wrong = [something there]; // a\n" + 121 | " NSString *hello = adaa(); // * dsds\n" + 122 | " id *hello2 = 34 * lj; // = 23\n" + 123 | " id/**/ hello2 = nil; // * sds = 34343\n", 124 | specifier: Configuration.forms[2]) 125 | } 126 | 127 | func testObjCAlignmentForDefines1() { 128 | testOriginal( 129 | original: 130 | "#define A 1000\n" + 131 | "#define B() 4000\n" + 132 | "#define C (,,,er) 3000 + s\n", 133 | target: 134 | "#define A 1000\n" + 135 | "#define B() 4000\n" + 136 | "#define C (,,,er) 3000 + s\n", 137 | specifier: Configuration.forms[0]) 138 | } 139 | 140 | func testObjCAlignmentForDefines2() { 141 | testOriginal( 142 | original: 143 | "#if CHERRY && VINE\n" + 144 | "# elif CHERRY2 && VINE2\n" + 145 | "# else BERRY\n" + 146 | "#endif\n" 147 | , 148 | target: 149 | "#if CHERRY && VINE\n" + 150 | "# elif CHERRY2 && VINE2\n" + 151 | "# else BERRY\n" + 152 | "#endif\n", 153 | specifier: Configuration.forms[0]) 154 | } 155 | 156 | 157 | func testObjCAlignmentForDefinesWithComments() { 158 | testOriginal( 159 | original: 160 | "#if CHERRY && VINE // () comment define 1\n" + 161 | "# elif CHERRY2 && VINE2 // # else\n" + 162 | "# else BERRY // * this is a normal comment\n" + 163 | "#endif // comment end\n" 164 | , 165 | target: 166 | "#if CHERRY && VINE // () comment define 1\n" + 167 | "# elif CHERRY2 && VINE2 // # else\n" + 168 | "# else BERRY // * this is a normal comment\n" + 169 | "#endif // comment end\n", 170 | specifier: Configuration.forms[0]) 171 | } 172 | 173 | func testObjCAlignmentForDefinesWithComments2() { 174 | testOriginal( 175 | original: 176 | "#define TEXPECT(ocmock) (__typeof(ocmock))([(OCMockObject*)(ocmock) expect]) // first * ()\n" + 177 | "#define STUB_IGNORING_NON_OBJECT_ARGS(ocmock) [[(OCMockObject*)(ocmock) stub] // hi ()\n" + 178 | "#define STUB_IGNORING_NON_OBJECT_ARGS(ocmock) [[(OCMockObject*)(ocmock) stub]\n" + 179 | "" 180 | , 181 | target: 182 | "#define TEXPECT(ocmock) (__typeof(ocmock))([(OCMockObject*)(ocmock) expect]) // first * ()\n" + 183 | "#define STUB_IGNORING_NON_OBJECT_ARGS(ocmock) [[(OCMockObject*)(ocmock) stub] // hi ()\n" + 184 | "#define STUB_IGNORING_NON_OBJECT_ARGS(ocmock) [[(OCMockObject*)(ocmock) stub]\n" + 185 | "", 186 | specifier: Configuration.forms[0]) 187 | } 188 | 189 | func testPropertyRegex() { 190 | testOriginal( 191 | original: 192 | " @property (nonatomic, strong) NSMutableDictionary*stationSessions;\n" + 193 | " @property (nonatomic, assign) id/*some description*/ variable;\n" + 194 | " @property (nonatomic, strong, readonly) NSNumber *variable;\n" + 195 | " @property (nonatomic, weak, copy) Fan variable;\n" + 196 | "" 197 | , 198 | target: 199 | " @property (nonatomic, strong ) NSMutableDictionary *stationSessions;\n" + 200 | " @property (nonatomic, assign ) id/*some description*/ variable;\n" + 201 | " @property (nonatomic, strong, readonly) NSNumber *variable;\n" + 202 | " @property (nonatomic, weak, copy ) Fan variable;\n" + 203 | "", 204 | specifier: Configuration.forms[1]) 205 | } 206 | 207 | func testPropertiesWithComments() { 208 | testOriginal( 209 | original: 210 | " @property (nonatomic, strong) NSMutableDictionary*stationSessions; // a *dasda;\n" + 211 | " @property (nonatomic, assign) id/*some description*/ variable; // @property\n" + 212 | " @property (nonatomic, strong, readonly) NSNumber *variable; // normal comment\n" + 213 | " @property (nonatomic, weak, copy) Fan variable; // ^)(*__)(&%@%$@\n" + 214 | "" 215 | , 216 | target: 217 | " @property (nonatomic, strong ) NSMutableDictionary *stationSessions; // a *dasda;\n" + 218 | " @property (nonatomic, assign ) id/*some description*/ variable; // @property\n" + 219 | " @property (nonatomic, strong, readonly) NSNumber *variable; // normal comment\n" + 220 | " @property (nonatomic, weak, copy ) Fan variable; // ^)(*__)(&%@%$@\n" + 221 | "", 222 | specifier: Configuration.forms[1]) 223 | } 224 | 225 | func testAssignments() { 226 | testOriginal( 227 | original: 228 | " aas01312[23] = seven / 23 // comment;\n" + 229 | " *(aas01312[23] + 1) = [self sendMessage:@\"hello\"] + 23;\n" + 230 | " _variable = sum(square(34); // third comment = sum\n" + 231 | "" 232 | , 233 | target: 234 | " aas01312[23] = seven / 23 // comment;\n" + 235 | " *(aas01312[23] + 1) = [self sendMessage:@\"hello\"] + 23;\n" + 236 | " _variable = sum(square(34); // third comment = sum\n" + 237 | "", 238 | specifier: Configuration.forms[3]) 239 | } 240 | 241 | func testBigMacro() { 242 | testOriginal( 243 | original: 244 | " something1 \\\n" + 245 | " something1 adsakjda \\\n" + 246 | " something1 \\\n" + 247 | "", 248 | target: 249 | " something1 \\\n" + 250 | " something1 adsakjda \\\n" + 251 | " something1 \\\n" + 252 | "", 253 | specifier: Configuration.forms[4]) 254 | } 255 | } 256 | -------------------------------------------------------------------------------- /RegX.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | C8130E3419F3F01600A13EFB /* Functional.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8130E3319F3F01600A13EFB /* Functional.swift */; }; 11 | C8130E3519F3F91500A13EFB /* Functional.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8130E3319F3F01600A13EFB /* Functional.swift */; }; 12 | C84354641D84582200E9D21A /* RegXPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = C84354631D84582200E9D21A /* RegXPlugin.m */; }; 13 | C86692A319F1D2FC00582722 /* RegXPlugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = C86692A219F1D2FC00582722 /* RegXPlugin.swift */; }; 14 | C86692B619F1D41300582722 /* TestAlign.swift in Sources */ = {isa = PBXBuildFile; fileRef = C86692B219F1D41300582722 /* TestAlign.swift */; }; 15 | C8A6E7FD1BA039B7007D6489 /* String+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8A6E7FC1BA039B7007D6489 /* String+Extensions.swift */; }; 16 | C8A6E7FE1BA039B7007D6489 /* String+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8A6E7FC1BA039B7007D6489 /* String+Extensions.swift */; }; 17 | C8BC35C919EEECE800DFF3BB /* Regularizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8BC35C819EEECE800DFF3BB /* Regularizer.swift */; }; 18 | C8BC35CC19EF243900DFF3BB /* RegularExpressionGroupSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8BC35CB19EF243900DFF3BB /* RegularExpressionGroupSettings.swift */; }; 19 | C8D7D1B519F2995700483BFA /* RegularForm.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8D7D1B419F2995700483BFA /* RegularForm.swift */; }; 20 | C8D7D1B919F29E5C00483BFA /* Regularizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8BC35C819EEECE800DFF3BB /* Regularizer.swift */; }; 21 | C8D7D1BA19F29E5C00483BFA /* RegularForm.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8D7D1B419F2995700483BFA /* RegularForm.swift */; }; 22 | C8D7D1BB19F29E5C00483BFA /* RegularExpressionGroupSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8BC35CB19EF243900DFF3BB /* RegularExpressionGroupSettings.swift */; }; 23 | C8D7D1BD19F29E5C00483BFA /* RegXLogging.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8E8F8D619F26A0500101518 /* RegXLogging.swift */; }; 24 | C8D7D1BE19F29E5C00483BFA /* XCodeService.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8E8F8C419F25E7600101518 /* XCodeService.swift */; }; 25 | C8DCC42319F40E56005B4648 /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8DCC42219F40E56005B4648 /* Configuration.swift */; }; 26 | C8DCC42419F40F39005B4648 /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8DCC42219F40E56005B4648 /* Configuration.swift */; }; 27 | C8DCC42619F40FB2005B4648 /* XCodeInternals.m in Sources */ = {isa = PBXBuildFile; fileRef = C8E8F8E219F276B100101518 /* XCodeInternals.m */; }; 28 | C8E8F8C519F25E7600101518 /* XCodeService.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8E8F8C419F25E7600101518 /* XCodeService.swift */; }; 29 | C8E8F8D719F26A0500101518 /* RegXLogging.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8E8F8D619F26A0500101518 /* RegXLogging.swift */; }; 30 | C8E8F8E319F276B100101518 /* XCodeInternals.m in Sources */ = {isa = PBXBuildFile; fileRef = C8E8F8E219F276B100101518 /* XCodeInternals.m */; }; 31 | C8F0E21119F2B72E0037838E /* DVTFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C8F0E20C19F2B72E0037838E /* DVTFoundation.framework */; }; 32 | C8F0E21219F2B72E0037838E /* IDEFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C8F0E20D19F2B72E0037838E /* IDEFoundation.framework */; }; 33 | C8F0E21319F2B72E0037838E /* IDEKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C8F0E20E19F2B72E0037838E /* IDEKit.framework */; }; 34 | C8F0E21419F2B72E0037838E /* DVTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C8F0E20F19F2B72E0037838E /* DVTKit.framework */; }; 35 | C8F0E21519F2B72E0037838E /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C8F0E21019F2B72E0037838E /* Cocoa.framework */; }; 36 | /* End PBXBuildFile section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | C8130E3319F3F01600A13EFB /* Functional.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Functional.swift; sourceTree = ""; }; 40 | C84354621D84582200E9D21A /* RegXPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegXPlugin.h; sourceTree = ""; }; 41 | C84354631D84582200E9D21A /* RegXPlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RegXPlugin.m; sourceTree = ""; }; 42 | C84DFF0D19EE775100C64E17 /* RegX.xcplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RegX.xcplugin; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | C84DFF1119EE775100C64E17 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 44 | C85B2D5619F5AC8000EB8482 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 45 | C86692A219F1D2FC00582722 /* RegXPlugin.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RegXPlugin.swift; sourceTree = ""; }; 46 | C86692A819F1D3EA00582722 /* UnitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = UnitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 47 | C86692B219F1D41300582722 /* TestAlign.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestAlign.swift; sourceTree = ""; }; 48 | C86692B319F1D41300582722 /* UnitTests-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UnitTests-Bridging-Header.h"; sourceTree = ""; }; 49 | C8A6E7FC1BA039B7007D6489 /* String+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+Extensions.swift"; sourceTree = ""; }; 50 | C8BC35C719EEECE800DFF3BB /* RegX-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RegX-Bridging-Header.h"; sourceTree = ""; }; 51 | C8BC35C819EEECE800DFF3BB /* Regularizer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Regularizer.swift; sourceTree = ""; }; 52 | C8BC35CB19EF243900DFF3BB /* RegularExpressionGroupSettings.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RegularExpressionGroupSettings.swift; sourceTree = ""; }; 53 | C8D7D1B419F2995700483BFA /* RegularForm.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RegularForm.swift; sourceTree = ""; }; 54 | C8DCC42219F40E56005B4648 /* Configuration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; }; 55 | C8E8F8C419F25E7600101518 /* XCodeService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = XCodeService.swift; sourceTree = ""; }; 56 | C8E8F8D519F2639700101518 /* XCodeInternals.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XCodeInternals.h; sourceTree = ""; }; 57 | C8E8F8D619F26A0500101518 /* RegXLogging.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RegXLogging.swift; sourceTree = ""; }; 58 | C8E8F8E219F276B100101518 /* XCodeInternals.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XCodeInternals.m; sourceTree = ""; }; 59 | C8F0E20C19F2B72E0037838E /* DVTFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DVTFoundation.framework; path = ../../../../Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework; sourceTree = ""; }; 60 | C8F0E20D19F2B72E0037838E /* IDEFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IDEFoundation.framework; path = ../../../../Applications/Xcode.app/Contents/Frameworks/IDEFoundation.framework; sourceTree = ""; }; 61 | C8F0E20E19F2B72E0037838E /* IDEKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IDEKit.framework; path = ../../../../Applications/Xcode.app/Contents/Frameworks/IDEKit.framework; sourceTree = ""; }; 62 | C8F0E20F19F2B72E0037838E /* DVTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DVTKit.framework; path = ../../../../Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework; sourceTree = ""; }; 63 | C8F0E21019F2B72E0037838E /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 64 | /* End PBXFileReference section */ 65 | 66 | /* Begin PBXFrameworksBuildPhase section */ 67 | C84DFF0A19EE775100C64E17 /* Frameworks */ = { 68 | isa = PBXFrameworksBuildPhase; 69 | buildActionMask = 2147483647; 70 | files = ( 71 | C8F0E21219F2B72E0037838E /* IDEFoundation.framework in Frameworks */, 72 | C8F0E21519F2B72E0037838E /* Cocoa.framework in Frameworks */, 73 | C8F0E21319F2B72E0037838E /* IDEKit.framework in Frameworks */, 74 | C8F0E21419F2B72E0037838E /* DVTKit.framework in Frameworks */, 75 | C8F0E21119F2B72E0037838E /* DVTFoundation.framework in Frameworks */, 76 | ); 77 | runOnlyForDeploymentPostprocessing = 0; 78 | }; 79 | C86692A519F1D3EA00582722 /* Frameworks */ = { 80 | isa = PBXFrameworksBuildPhase; 81 | buildActionMask = 2147483647; 82 | files = ( 83 | ); 84 | runOnlyForDeploymentPostprocessing = 0; 85 | }; 86 | /* End PBXFrameworksBuildPhase section */ 87 | 88 | /* Begin PBXGroup section */ 89 | C84DFF0419EE775100C64E17 = { 90 | isa = PBXGroup; 91 | children = ( 92 | C84DFF0F19EE775100C64E17 /* RegX */, 93 | C86692A919F1D3EA00582722 /* UnitTests */, 94 | C84DFF0E19EE775100C64E17 /* Products */, 95 | C8E8F8C819F25FB100101518 /* Frameworks */, 96 | C85B2D5619F5AC8000EB8482 /* README.md */, 97 | ); 98 | sourceTree = ""; 99 | }; 100 | C84DFF0E19EE775100C64E17 /* Products */ = { 101 | isa = PBXGroup; 102 | children = ( 103 | C84DFF0D19EE775100C64E17 /* RegX.xcplugin */, 104 | C86692A819F1D3EA00582722 /* UnitTests.xctest */, 105 | ); 106 | name = Products; 107 | sourceTree = ""; 108 | }; 109 | C84DFF0F19EE775100C64E17 /* RegX */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | C84DFF1019EE775100C64E17 /* Supporting Files */, 113 | C8DCC42219F40E56005B4648 /* Configuration.swift */, 114 | C8130E3319F3F01600A13EFB /* Functional.swift */, 115 | C8D7D1B419F2995700483BFA /* RegularForm.swift */, 116 | C8BC35C819EEECE800DFF3BB /* Regularizer.swift */, 117 | C8BC35CB19EF243900DFF3BB /* RegularExpressionGroupSettings.swift */, 118 | C86692A219F1D2FC00582722 /* RegXPlugin.swift */, 119 | C8E8F8D619F26A0500101518 /* RegXLogging.swift */, 120 | C8E8F8C419F25E7600101518 /* XCodeService.swift */, 121 | C8A6E7FC1BA039B7007D6489 /* String+Extensions.swift */, 122 | C8BC35C719EEECE800DFF3BB /* RegX-Bridging-Header.h */, 123 | C8E8F8D519F2639700101518 /* XCodeInternals.h */, 124 | C8E8F8E219F276B100101518 /* XCodeInternals.m */, 125 | C84354621D84582200E9D21A /* RegXPlugin.h */, 126 | C84354631D84582200E9D21A /* RegXPlugin.m */, 127 | ); 128 | path = RegX; 129 | sourceTree = ""; 130 | }; 131 | C84DFF1019EE775100C64E17 /* Supporting Files */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | C84DFF1119EE775100C64E17 /* Info.plist */, 135 | ); 136 | name = "Supporting Files"; 137 | sourceTree = ""; 138 | }; 139 | C86692A919F1D3EA00582722 /* UnitTests */ = { 140 | isa = PBXGroup; 141 | children = ( 142 | C86692B219F1D41300582722 /* TestAlign.swift */, 143 | C86692B319F1D41300582722 /* UnitTests-Bridging-Header.h */, 144 | ); 145 | path = UnitTests; 146 | sourceTree = ""; 147 | }; 148 | C8E8F8C819F25FB100101518 /* Frameworks */ = { 149 | isa = PBXGroup; 150 | children = ( 151 | C8F0E20C19F2B72E0037838E /* DVTFoundation.framework */, 152 | C8F0E20D19F2B72E0037838E /* IDEFoundation.framework */, 153 | C8F0E20E19F2B72E0037838E /* IDEKit.framework */, 154 | C8F0E20F19F2B72E0037838E /* DVTKit.framework */, 155 | C8F0E21019F2B72E0037838E /* Cocoa.framework */, 156 | ); 157 | name = Frameworks; 158 | sourceTree = ""; 159 | }; 160 | /* End PBXGroup section */ 161 | 162 | /* Begin PBXNativeTarget section */ 163 | C84DFF0C19EE775100C64E17 /* RegX */ = { 164 | isa = PBXNativeTarget; 165 | buildConfigurationList = C84DFF1419EE775100C64E17 /* Build configuration list for PBXNativeTarget "RegX" */; 166 | buildPhases = ( 167 | C83AA01C1A8A386800E0605C /* ShellScript */, 168 | C84DFF0919EE775100C64E17 /* Sources */, 169 | C84DFF0A19EE775100C64E17 /* Frameworks */, 170 | C84DFF0B19EE775100C64E17 /* Resources */, 171 | ); 172 | buildRules = ( 173 | ); 174 | dependencies = ( 175 | ); 176 | name = RegX; 177 | productName = RegX; 178 | productReference = C84DFF0D19EE775100C64E17 /* RegX.xcplugin */; 179 | productType = "com.apple.product-type.bundle"; 180 | }; 181 | C86692A719F1D3EA00582722 /* UnitTests */ = { 182 | isa = PBXNativeTarget; 183 | buildConfigurationList = C86692AE19F1D3EA00582722 /* Build configuration list for PBXNativeTarget "UnitTests" */; 184 | buildPhases = ( 185 | C86692A419F1D3EA00582722 /* Sources */, 186 | C86692A519F1D3EA00582722 /* Frameworks */, 187 | C86692A619F1D3EA00582722 /* Resources */, 188 | ); 189 | buildRules = ( 190 | ); 191 | dependencies = ( 192 | ); 193 | name = UnitTests; 194 | productName = UnitTests; 195 | productReference = C86692A819F1D3EA00582722 /* UnitTests.xctest */; 196 | productType = "com.apple.product-type.bundle.unit-test"; 197 | }; 198 | /* End PBXNativeTarget section */ 199 | 200 | /* Begin PBXProject section */ 201 | C84DFF0519EE775100C64E17 /* Project object */ = { 202 | isa = PBXProject; 203 | attributes = { 204 | LastSwiftUpdateCheck = 0700; 205 | LastUpgradeCheck = 0700; 206 | ORGANIZATIONNAME = "Krunoslav Zaher"; 207 | TargetAttributes = { 208 | C84DFF0C19EE775100C64E17 = { 209 | CreatedOnToolsVersion = 6.1; 210 | }; 211 | C86692A719F1D3EA00582722 = { 212 | CreatedOnToolsVersion = 6.1; 213 | LastSwiftMigration = 0800; 214 | }; 215 | }; 216 | }; 217 | buildConfigurationList = C84DFF0819EE775100C64E17 /* Build configuration list for PBXProject "RegX" */; 218 | compatibilityVersion = "Xcode 3.2"; 219 | developmentRegion = English; 220 | hasScannedForEncodings = 0; 221 | knownRegions = ( 222 | en, 223 | ); 224 | mainGroup = C84DFF0419EE775100C64E17; 225 | productRefGroup = C84DFF0E19EE775100C64E17 /* Products */; 226 | projectDirPath = ""; 227 | projectRoot = ""; 228 | targets = ( 229 | C84DFF0C19EE775100C64E17 /* RegX */, 230 | C86692A719F1D3EA00582722 /* UnitTests */, 231 | ); 232 | }; 233 | /* End PBXProject section */ 234 | 235 | /* Begin PBXResourcesBuildPhase section */ 236 | C84DFF0B19EE775100C64E17 /* Resources */ = { 237 | isa = PBXResourcesBuildPhase; 238 | buildActionMask = 2147483647; 239 | files = ( 240 | ); 241 | runOnlyForDeploymentPostprocessing = 0; 242 | }; 243 | C86692A619F1D3EA00582722 /* Resources */ = { 244 | isa = PBXResourcesBuildPhase; 245 | buildActionMask = 2147483647; 246 | files = ( 247 | ); 248 | runOnlyForDeploymentPostprocessing = 0; 249 | }; 250 | /* End PBXResourcesBuildPhase section */ 251 | 252 | /* Begin PBXShellScriptBuildPhase section */ 253 | C83AA01C1A8A386800E0605C /* ShellScript */ = { 254 | isa = PBXShellScriptBuildPhase; 255 | buildActionMask = 2147483647; 256 | files = ( 257 | ); 258 | inputPaths = ( 259 | ); 260 | outputPaths = ( 261 | ); 262 | runOnlyForDeploymentPostprocessing = 0; 263 | shellPath = /bin/sh; 264 | shellScript = "\nXcodeInfoPlistPath=\"${SYSTEM_DEVELOPER_TOOLS}/../../Info.plist\"\n\nif [ ! -f \"${XcodeInfoPlistPath}\" ]\nthen\n echo \"Xcode plist file ${XcodeInfoPlistPath} doesn't exist\"\n exit -1\nfi\n\necho \"Xcode plist file ${XcodeInfoPlistPath}\"\nUDID=`defaults read $XcodeInfoPlistPath DVTPlugInCompatibilityUUID`\necho \"Found Xcode UDID:${UDID}\"\nN=`defaults read $PRODUCT_SETTINGS_PATH DVTPlugInCompatibilityUUIDs | grep $UDID | wc -l`\nif [ $N -eq 0 ]\nthen\n defaults write $PRODUCT_SETTINGS_PATH DVTPlugInCompatibilityUUIDs -array-add $UDID\n echo \"Added ${UDID} to list\"\nelse\n echo \"${UDID} already added\"\nfi"; 265 | }; 266 | /* End PBXShellScriptBuildPhase section */ 267 | 268 | /* Begin PBXSourcesBuildPhase section */ 269 | C84DFF0919EE775100C64E17 /* Sources */ = { 270 | isa = PBXSourcesBuildPhase; 271 | buildActionMask = 2147483647; 272 | files = ( 273 | C8D7D1B519F2995700483BFA /* RegularForm.swift in Sources */, 274 | C8A6E7FD1BA039B7007D6489 /* String+Extensions.swift in Sources */, 275 | C86692A319F1D2FC00582722 /* RegXPlugin.swift in Sources */, 276 | C8E8F8D719F26A0500101518 /* RegXLogging.swift in Sources */, 277 | C8DCC42319F40E56005B4648 /* Configuration.swift in Sources */, 278 | C8E8F8E319F276B100101518 /* XCodeInternals.m in Sources */, 279 | C84354641D84582200E9D21A /* RegXPlugin.m in Sources */, 280 | C8E8F8C519F25E7600101518 /* XCodeService.swift in Sources */, 281 | C8BC35C919EEECE800DFF3BB /* Regularizer.swift in Sources */, 282 | C8130E3419F3F01600A13EFB /* Functional.swift in Sources */, 283 | C8BC35CC19EF243900DFF3BB /* RegularExpressionGroupSettings.swift in Sources */, 284 | ); 285 | runOnlyForDeploymentPostprocessing = 0; 286 | }; 287 | C86692A419F1D3EA00582722 /* Sources */ = { 288 | isa = PBXSourcesBuildPhase; 289 | buildActionMask = 2147483647; 290 | files = ( 291 | C8A6E7FE1BA039B7007D6489 /* String+Extensions.swift in Sources */, 292 | C8D7D1B919F29E5C00483BFA /* Regularizer.swift in Sources */, 293 | C86692B619F1D41300582722 /* TestAlign.swift in Sources */, 294 | C8D7D1BE19F29E5C00483BFA /* XCodeService.swift in Sources */, 295 | C8D7D1BD19F29E5C00483BFA /* RegXLogging.swift in Sources */, 296 | C8D7D1BA19F29E5C00483BFA /* RegularForm.swift in Sources */, 297 | C8DCC42419F40F39005B4648 /* Configuration.swift in Sources */, 298 | C8130E3519F3F91500A13EFB /* Functional.swift in Sources */, 299 | C8D7D1BB19F29E5C00483BFA /* RegularExpressionGroupSettings.swift in Sources */, 300 | C8DCC42619F40FB2005B4648 /* XCodeInternals.m in Sources */, 301 | ); 302 | runOnlyForDeploymentPostprocessing = 0; 303 | }; 304 | /* End PBXSourcesBuildPhase section */ 305 | 306 | /* Begin XCBuildConfiguration section */ 307 | C84DFF1219EE775100C64E17 /* Debug */ = { 308 | isa = XCBuildConfiguration; 309 | buildSettings = { 310 | ALWAYS_SEARCH_USER_PATHS = NO; 311 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 312 | CLANG_CXX_LIBRARY = "libc++"; 313 | CLANG_ENABLE_MODULES = YES; 314 | CLANG_ENABLE_OBJC_ARC = YES; 315 | CLANG_WARN_BOOL_CONVERSION = YES; 316 | CLANG_WARN_CONSTANT_CONVERSION = YES; 317 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 318 | CLANG_WARN_EMPTY_BODY = YES; 319 | CLANG_WARN_ENUM_CONVERSION = YES; 320 | CLANG_WARN_INT_CONVERSION = YES; 321 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 322 | CLANG_WARN_UNREACHABLE_CODE = YES; 323 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 324 | COPY_PHASE_STRIP = NO; 325 | ENABLE_STRICT_OBJC_MSGSEND = YES; 326 | ENABLE_TESTABILITY = YES; 327 | GCC_C_LANGUAGE_STANDARD = gnu99; 328 | GCC_DYNAMIC_NO_PIC = NO; 329 | GCC_OPTIMIZATION_LEVEL = 0; 330 | GCC_PREPROCESSOR_DEFINITIONS = ( 331 | "DEBUG=1", 332 | "$(inherited)", 333 | ); 334 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 335 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 336 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 337 | GCC_WARN_UNDECLARED_SELECTOR = YES; 338 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 339 | GCC_WARN_UNUSED_FUNCTION = YES; 340 | GCC_WARN_UNUSED_VARIABLE = YES; 341 | LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks @executable_path/../Frameworks"; 342 | MACOSX_DEPLOYMENT_TARGET = 10.9; 343 | MTL_ENABLE_DEBUG_INFO = YES; 344 | ONLY_ACTIVE_ARCH = YES; 345 | OTHER_SWIFT_FLAGS = "-DDEBUG"; 346 | SDKROOT = macosx; 347 | SWIFT_VERSION = 3.0; 348 | }; 349 | name = Debug; 350 | }; 351 | C84DFF1319EE775100C64E17 /* Release */ = { 352 | isa = XCBuildConfiguration; 353 | buildSettings = { 354 | ALWAYS_SEARCH_USER_PATHS = NO; 355 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 356 | CLANG_CXX_LIBRARY = "libc++"; 357 | CLANG_ENABLE_MODULES = YES; 358 | CLANG_ENABLE_OBJC_ARC = YES; 359 | CLANG_WARN_BOOL_CONVERSION = YES; 360 | CLANG_WARN_CONSTANT_CONVERSION = YES; 361 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 362 | CLANG_WARN_EMPTY_BODY = YES; 363 | CLANG_WARN_ENUM_CONVERSION = YES; 364 | CLANG_WARN_INT_CONVERSION = YES; 365 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 366 | CLANG_WARN_UNREACHABLE_CODE = YES; 367 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 368 | COPY_PHASE_STRIP = YES; 369 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 370 | ENABLE_NS_ASSERTIONS = NO; 371 | ENABLE_STRICT_OBJC_MSGSEND = YES; 372 | GCC_C_LANGUAGE_STANDARD = gnu99; 373 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 374 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 375 | GCC_WARN_UNDECLARED_SELECTOR = YES; 376 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 377 | GCC_WARN_UNUSED_FUNCTION = YES; 378 | GCC_WARN_UNUSED_VARIABLE = YES; 379 | LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks @executable_path/../Frameworks"; 380 | MACOSX_DEPLOYMENT_TARGET = 10.9; 381 | MTL_ENABLE_DEBUG_INFO = NO; 382 | SDKROOT = macosx; 383 | SWIFT_VERSION = 3.0; 384 | }; 385 | name = Release; 386 | }; 387 | C84DFF1519EE775100C64E17 /* Debug */ = { 388 | isa = XCBuildConfiguration; 389 | buildSettings = { 390 | CLANG_ENABLE_MODULES = YES; 391 | COMBINE_HIDPI_IMAGES = YES; 392 | DEPLOYMENT_LOCATION = YES; 393 | DSTROOT = "${HOME}"; 394 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; 395 | FRAMEWORK_SEARCH_PATHS = ( 396 | "$(inherited)", 397 | "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/SharedFrameworks", 398 | "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Frameworks", 399 | ); 400 | INFOPLIST_FILE = RegX/Info.plist; 401 | INSTALL_PATH = "/Library/Application Support/Developer/Shared/Xcode/Plug-ins"; 402 | PRODUCT_BUNDLE_IDENTIFIER = "KZ.$(PRODUCT_NAME:rfc1034identifier)"; 403 | PRODUCT_NAME = "$(TARGET_NAME)"; 404 | SWIFT_OBJC_BRIDGING_HEADER = "RegX/RegX-Bridging-Header.h"; 405 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 406 | WRAPPER_EXTENSION = xcplugin; 407 | }; 408 | name = Debug; 409 | }; 410 | C84DFF1619EE775100C64E17 /* Release */ = { 411 | isa = XCBuildConfiguration; 412 | buildSettings = { 413 | CLANG_ENABLE_MODULES = YES; 414 | COMBINE_HIDPI_IMAGES = YES; 415 | DEPLOYMENT_LOCATION = YES; 416 | DSTROOT = "${HOME}"; 417 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; 418 | FRAMEWORK_SEARCH_PATHS = ( 419 | "$(inherited)", 420 | "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/SharedFrameworks", 421 | "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Frameworks", 422 | ); 423 | INFOPLIST_FILE = RegX/Info.plist; 424 | INSTALL_PATH = "/Library/Application Support/Developer/Shared/Xcode/Plug-ins"; 425 | PRODUCT_BUNDLE_IDENTIFIER = "KZ.$(PRODUCT_NAME:rfc1034identifier)"; 426 | PRODUCT_NAME = "$(TARGET_NAME)"; 427 | SWIFT_OBJC_BRIDGING_HEADER = "RegX/RegX-Bridging-Header.h"; 428 | WRAPPER_EXTENSION = xcplugin; 429 | }; 430 | name = Release; 431 | }; 432 | C86692AF19F1D3EA00582722 /* Debug */ = { 433 | isa = XCBuildConfiguration; 434 | buildSettings = { 435 | COMBINE_HIDPI_IMAGES = YES; 436 | DSTROOT = "${HOME}"; 437 | FRAMEWORK_SEARCH_PATHS = ( 438 | "$(DEVELOPER_FRAMEWORKS_DIR)", 439 | "$(inherited)", 440 | "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Frameworks", 441 | "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/SharedFrameworks", 442 | ); 443 | GCC_PREPROCESSOR_DEFINITIONS = ( 444 | LOGIC_TESTS, 445 | "$(inherited)", 446 | ); 447 | INFOPLIST_FILE = UnitTests/Info.plist; 448 | INSTALL_PATH = "/Library/Application Support/Developer/Shared/Xcode/Plug-ins"; 449 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 450 | MACOSX_DEPLOYMENT_TARGET = 10.10; 451 | OTHER_SWIFT_FLAGS = "-DLOGIC_TESTS $(inherited)"; 452 | PRODUCT_BUNDLE_IDENTIFIER = "KZ.$(PRODUCT_NAME:rfc1034identifier)"; 453 | PRODUCT_NAME = "$(TARGET_NAME)"; 454 | SWIFT_OBJC_BRIDGING_HEADER = "UnitTests/UnitTests-Bridging-Header.h"; 455 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 456 | }; 457 | name = Debug; 458 | }; 459 | C86692B019F1D3EA00582722 /* Release */ = { 460 | isa = XCBuildConfiguration; 461 | buildSettings = { 462 | COMBINE_HIDPI_IMAGES = YES; 463 | DSTROOT = "${HOME}"; 464 | FRAMEWORK_SEARCH_PATHS = ( 465 | "$(DEVELOPER_FRAMEWORKS_DIR)", 466 | "$(inherited)", 467 | "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Frameworks", 468 | "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/SharedFrameworks", 469 | ); 470 | GCC_PREPROCESSOR_DEFINITIONS = ( 471 | LOGIC_TESTS, 472 | "$(inherited)", 473 | ); 474 | INFOPLIST_FILE = UnitTests/Info.plist; 475 | INSTALL_PATH = "/Library/Application Support/Developer/Shared/Xcode/Plug-ins"; 476 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 477 | MACOSX_DEPLOYMENT_TARGET = 10.10; 478 | OTHER_SWIFT_FLAGS = "-DLOGIC_TESTS $(inherited)"; 479 | PRODUCT_BUNDLE_IDENTIFIER = "KZ.$(PRODUCT_NAME:rfc1034identifier)"; 480 | PRODUCT_NAME = "$(TARGET_NAME)"; 481 | SWIFT_OBJC_BRIDGING_HEADER = "UnitTests/UnitTests-Bridging-Header.h"; 482 | }; 483 | name = Release; 484 | }; 485 | /* End XCBuildConfiguration section */ 486 | 487 | /* Begin XCConfigurationList section */ 488 | C84DFF0819EE775100C64E17 /* Build configuration list for PBXProject "RegX" */ = { 489 | isa = XCConfigurationList; 490 | buildConfigurations = ( 491 | C84DFF1219EE775100C64E17 /* Debug */, 492 | C84DFF1319EE775100C64E17 /* Release */, 493 | ); 494 | defaultConfigurationIsVisible = 0; 495 | defaultConfigurationName = Release; 496 | }; 497 | C84DFF1419EE775100C64E17 /* Build configuration list for PBXNativeTarget "RegX" */ = { 498 | isa = XCConfigurationList; 499 | buildConfigurations = ( 500 | C84DFF1519EE775100C64E17 /* Debug */, 501 | C84DFF1619EE775100C64E17 /* Release */, 502 | ); 503 | defaultConfigurationIsVisible = 0; 504 | defaultConfigurationName = Release; 505 | }; 506 | C86692AE19F1D3EA00582722 /* Build configuration list for PBXNativeTarget "UnitTests" */ = { 507 | isa = XCConfigurationList; 508 | buildConfigurations = ( 509 | C86692AF19F1D3EA00582722 /* Debug */, 510 | C86692B019F1D3EA00582722 /* Release */, 511 | ); 512 | defaultConfigurationIsVisible = 0; 513 | defaultConfigurationName = Release; 514 | }; 515 | /* End XCConfigurationList section */ 516 | }; 517 | rootObject = C84DFF0519EE775100C64E17 /* Project object */; 518 | } 519 | --------------------------------------------------------------------------------