├── Documents ├── DevelopmentNotes.md ├── Documentation.md ├── FAQ.md ├── Images │ ├── Prime_Source_Implementation.png │ └── XAspect_illustration.png ├── Introduction_of_XAspect.md ├── ReleaseNotes.md └── XAspect_Inside.md ├── LICENSE.md ├── README.md ├── XAspect.podspec ├── XAspect ├── Core │ ├── XACExtensions.c │ ├── XACExtensions.h │ ├── XACrystallization.cpp │ ├── XACrystallization.h │ ├── XAWeaveHandler.cpp │ └── XAWeaveHandler.h ├── Macros │ ├── XADebugMacros.h │ ├── XAExtObjcMetamacros.h │ ├── XAFoundation.h │ └── XAObjcMetaprogramming.h ├── Unused │ ├── XAInjectionTemplate.cpp │ └── XAInjectionTemplate.h └── XAspect.h └── XAspectDev ├── Podfile ├── Podfile.lock ├── Pods ├── CocoaLumberjack │ ├── Classes │ │ ├── CLI │ │ │ ├── CLIColor.h │ │ │ └── CLIColor.m │ │ ├── CocoaLumberjack.h │ │ ├── DDASLLogCapture.h │ │ ├── DDASLLogCapture.m │ │ ├── DDASLLogger.h │ │ ├── DDASLLogger.m │ │ ├── DDAbstractDatabaseLogger.h │ │ ├── DDAbstractDatabaseLogger.m │ │ ├── DDAssertMacros.h │ │ ├── DDFileLogger.h │ │ ├── DDFileLogger.m │ │ ├── DDLog+LOGV.h │ │ ├── DDLog.h │ │ ├── DDLog.m │ │ ├── DDLogMacros.h │ │ ├── DDTTYLogger.h │ │ ├── DDTTYLogger.m │ │ └── Extensions │ │ │ ├── DDContextFilterLogFormatter.h │ │ │ ├── DDContextFilterLogFormatter.m │ │ │ ├── DDDispatchQueueLogFormatter.h │ │ │ ├── DDDispatchQueueLogFormatter.m │ │ │ ├── DDMultiFormatter.h │ │ │ └── DDMultiFormatter.m │ ├── LICENSE.txt │ └── README.md ├── Headers │ ├── Build │ │ ├── CocoaLumberjack │ │ │ ├── CLIColor.h │ │ │ ├── CocoaLumberjack.h │ │ │ ├── DDASLLogCapture.h │ │ │ ├── DDASLLogger.h │ │ │ ├── DDAbstractDatabaseLogger.h │ │ │ ├── DDAssertMacros.h │ │ │ ├── DDContextFilterLogFormatter.h │ │ │ ├── DDDispatchQueueLogFormatter.h │ │ │ ├── DDFileLogger.h │ │ │ ├── DDLog+LOGV.h │ │ │ ├── DDLog.h │ │ │ ├── DDLogMacros.h │ │ │ ├── DDMultiFormatter.h │ │ │ └── DDTTYLogger.h │ │ └── XAspect │ │ │ ├── XACExtensions.h │ │ │ ├── XACrystallization.h │ │ │ ├── XADebugMacros.h │ │ │ ├── XAExtObjcMetamacros.h │ │ │ ├── XAFoundation.h │ │ │ ├── XAObjcMetaprogramming.h │ │ │ ├── XAWeaveHandler.h │ │ │ └── XAspect.h │ └── Public │ │ ├── CocoaLumberjack │ │ ├── CLIColor.h │ │ ├── CocoaLumberjack.h │ │ ├── DDASLLogCapture.h │ │ ├── DDASLLogger.h │ │ ├── DDAbstractDatabaseLogger.h │ │ ├── DDAssertMacros.h │ │ ├── DDContextFilterLogFormatter.h │ │ ├── DDDispatchQueueLogFormatter.h │ │ ├── DDFileLogger.h │ │ ├── DDLog+LOGV.h │ │ ├── DDLog.h │ │ ├── DDLogMacros.h │ │ ├── DDMultiFormatter.h │ │ └── DDTTYLogger.h │ │ └── XAspect │ │ ├── XACExtensions.h │ │ ├── XACrystallization.h │ │ ├── XADebugMacros.h │ │ ├── XAExtObjcMetamacros.h │ │ ├── XAFoundation.h │ │ ├── XAObjcMetaprogramming.h │ │ ├── XAWeaveHandler.h │ │ └── XAspect.h ├── Local Podspecs │ └── XAspect.podspec ├── Manifest.lock ├── Pods.xcodeproj │ ├── project.pbxproj │ └── xcuserdata │ │ └── Xaree.xcuserdatad │ │ └── xcschemes │ │ ├── Pods-CocoaLumberjack.xcscheme │ │ ├── Pods-XAspect.xcscheme │ │ ├── Pods-XAspectDevTests-CocoaLumberjack.xcscheme │ │ ├── Pods-XAspectDevTests-XAspect.xcscheme │ │ ├── Pods-XAspectDevTests.xcscheme │ │ ├── Pods.xcscheme │ │ └── xcschememanagement.plist └── Target Support Files │ ├── Pods-CocoaLumberjack │ ├── Pods-CocoaLumberjack-Private.xcconfig │ ├── Pods-CocoaLumberjack-dummy.m │ ├── Pods-CocoaLumberjack-prefix.pch │ └── Pods-CocoaLumberjack.xcconfig │ ├── Pods-XAspect │ ├── Pods-XAspect-Private.xcconfig │ ├── Pods-XAspect-dummy.m │ ├── Pods-XAspect-prefix.pch │ └── Pods-XAspect.xcconfig │ ├── Pods-XAspectDevTests-CocoaLumberjack │ ├── Pods-XAspectDevTests-CocoaLumberjack-Private.xcconfig │ ├── Pods-XAspectDevTests-CocoaLumberjack-dummy.m │ ├── Pods-XAspectDevTests-CocoaLumberjack-prefix.pch │ └── Pods-XAspectDevTests-CocoaLumberjack.xcconfig │ ├── Pods-XAspectDevTests-XAspect │ ├── Pods-XAspectDevTests-XAspect-Private.xcconfig │ ├── Pods-XAspectDevTests-XAspect-dummy.m │ ├── Pods-XAspectDevTests-XAspect-prefix.pch │ └── Pods-XAspectDevTests-XAspect.xcconfig │ ├── Pods-XAspectDevTests │ ├── Pods-XAspectDevTests-acknowledgements.markdown │ ├── Pods-XAspectDevTests-acknowledgements.plist │ ├── Pods-XAspectDevTests-dummy.m │ ├── Pods-XAspectDevTests-environment.h │ ├── Pods-XAspectDevTests-resources.sh │ ├── Pods-XAspectDevTests.debug.xcconfig │ └── Pods-XAspectDevTests.release.xcconfig │ └── Pods │ ├── Pods-acknowledgements.markdown │ ├── Pods-acknowledgements.plist │ ├── Pods-dummy.m │ ├── Pods-environment.h │ ├── Pods-resources.sh │ ├── Pods.debug.xcconfig │ └── Pods.release.xcconfig ├── XAspectDev.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── XAspectDev.xccheckout │ └── xcuserdata │ │ └── Xaree.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── Xaree.xcuserdatad │ └── xcschemes │ ├── XAspectDev.xcscheme │ └── xcschememanagement.plist ├── XAspectDev.xcworkspace ├── contents.xcworkspacedata ├── xcshareddata │ └── XAspectDev.xccheckout └── xcuserdata │ └── Xaree.xcuserdatad │ ├── UserInterfaceState.xcuserstate │ ├── WorkspaceSettings.xcsettings │ └── xcdebugger │ └── Breakpoints_v2.xcbkptlist ├── XAspectDev ├── AppDelegate.h ├── AppDelegate.m ├── Aspect-Foundation_UnicodifyingDescriptionsOfObjects.m ├── Aspects │ ├── Aspect-CocoaLumberjack.m │ └── Aspect-ObjectAllocation.m ├── Base.lproj │ └── Main.storyboard ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── LaunchImage.launchimage │ │ └── Contents.json ├── Info.plist ├── SharedClassBetweenTargets.h ├── SharedClassBetweenTargets.m ├── XAViewController.h ├── XAViewController.m ├── XAspect-TargetTestFromProduct.m └── main.m └── XAspectDevTests ├── BasicWeavingForTypesTest.m ├── CExtensionTest.m ├── CustomizedDefaultPatchTest.m ├── CustomizedSupercalllerPatchTest.m ├── DuplicatedAspectPatchesTest.m ├── FunctionForTesting.h ├── FunctionForTesting.m ├── HierarchyTest.m ├── Info.plist ├── MethodPrefixTest.m ├── MultiTargetTest.m ├── NucleationTest.m ├── NullReturnValueImpTest.m ├── ObjCRuntimeTest.m ├── SafeCategoryTest.m ├── SelectorChainTest.m ├── SimpleMacroExpansionTest.m ├── Tier1.h ├── Tier1.m ├── Tier2.h ├── Tier2.m ├── Tier3.h ├── Tier3.m ├── Tier4.h ├── Tier4.m ├── Tier5.h ├── Tier5.m └── UserDefinedMacroKeywordTest.m /Documents/DevelopmentNotes.md: -------------------------------------------------------------------------------- 1 | Development Notes 2 | ================= 3 | 4 | This document contains the following sections: 5 | 6 | * [Bugs and Known Issues](#bugs-and-known-issues) 7 | * [TODO List](#todo-list) 8 | 9 | Bugs and Known Issues 10 | --------------------- 11 | 12 | No contents. 13 | 14 | 15 | TODO List 16 | --------- 17 | 18 | Sorted by target version. 19 | 20 | **@1.1.0** 21 | 22 | - Possible multiple targets issues: 23 | * Check the meta class of the root classes (NSObject) is itself. We should test whether the super caller for a class method should invoke the corresponding instance method. 24 | * Known issue: Multi-targets will cause wrong selector chain, because of the wrong method loading address. 25 | * Test the selector chain behavior. 26 | * Test whether Obj-C category method will overwrite the selector chain. 27 | 28 | - Reliability 29 | * Add more test cases. 30 | 31 | - Help 3rd party library embedding XAspect 32 | * Multiple executables/target loading issue. Avoid the duplicate symbols (functions/classes/methods) of XAspect in separated libraries using XAspect. 33 | * Provide a framework to be shared between libraries and projects. 34 | * Test in: 35 | * Extension 36 | * Framework 37 | * Unit test targets 38 | * static libraries 39 | 40 | - Usability (Injection) 41 | * "Can we inject aspect into multiple methods from multiple classes?" Try to share the same aspect implementation for multiple aspect classes (one patch be injected into multiple target classes). 42 | * Inject patches into a class which you don't have its class hierarchy (headers) but you know the class name (a string). 43 | * Inject patches to a class which you don't have. Assert at weaving time when loading. 44 | 45 | 46 | **@2.0.0** 47 | 48 | - Improve performance 49 | * Multi-threading to improve the performance for sorting and weaving aspect patch implementations. 50 | 51 | - Try to support Swift 52 | 53 | 54 | 55 | **@someday** 56 | 57 | - Use `@XAspect(AspectName) ... @endXAspect` statement instead of `#define AtAspect AspectName ... #undef AtAspect` to create an aspect field. 58 | 59 | * Currently, I don't find a way to do that. You can't use a C macro to define another C macro with C99: 60 | 61 | 62 | // The following macros don't work. 63 | #define XAspect(AspectName) class NSObject; #define AtAspect AspectName 64 | #define endXAspect class NSObject; #undef AtAspect 65 | 66 | - Refactor (method rename) problem: Xcode will crash. 67 | - Ensure user did invoke `XAMessageForward()` 68 | * Raising compiler error, not just warning. 69 | * Check when weaving (just loaded), not invoking time. 70 | 71 | - Auto-synthesize null and super caller implementation in `AspectPatch()`. 72 | * We can use C++ template to generate the null return value implementation. 73 | * We need to find a way to invoke the super's super implementation. Because the XAspect subclasses the target class to implement the patches, the keyword `super` is equal to the target class itself, not the superclass of the target class. 74 | 75 | -------------------------------------------------------------------------------- /Documents/FAQ.md: -------------------------------------------------------------------------------- 1 | FAQ 2 | === 3 | 4 | 5 | Compiler warning 6 | ---------------- 7 | 8 | ##### Apple Mach-O Linker Warning: **ld: warning: meta method '<#ClassName#>_XAspectCallSuperImp_<#SelectorName#>' in category from ... conflicts with same method from another category 9 | 10 | - You're repeating to synthesize super caller patches for the same selector. You can simply remove other duplicated auto-synthesizers to resolve this warning. 11 | 12 | 13 | -------------------------------------------------------------------------------- /Documents/Images/Prime_Source_Implementation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xareelee/XAspect/bb5ecef58bc2f5c791c8ed26a4c884d2f83e9777/Documents/Images/Prime_Source_Implementation.png -------------------------------------------------------------------------------- /Documents/Images/XAspect_illustration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xareelee/XAspect/bb5ecef58bc2f5c791c8ed26a4c884d2f83e9777/Documents/Images/XAspect_illustration.png -------------------------------------------------------------------------------- /Documents/ReleaseNotes.md: -------------------------------------------------------------------------------- 1 | Release Notes 2 | ============= 3 | 4 | This document contains the following sections: 5 | 6 | * [Restrictions for Current Version](#restrictions_for_current_version) 7 | * [Versions and Release Notes](#versions_and_release_notes) 8 | 9 | Restrictions for Current Version 10 | -------------------------------- 11 | 12 | - Don't use the keyword `super` in the `@classPatchField() ... @end` field. The keyword `super` is equivalent to `self` in the `@classPatchField() ... @end` field. 13 | 14 | - XAspect doesn't support any variadic method for aspect patches (e.g. `+[NSArray arrayWithObjects:(id)firstObj, ...]`). 15 | 16 | 17 | Versions and Release Notes 18 | -------------------------- 19 | 20 | ### Version 1.0.3 21 | 22 | - Fix the aspect patch assertion failure problem. Shared aspect file between targets won't cause the assertion fails. 23 | 24 | ### Version 1.0.2 25 | 26 | - Move *XAInjectionTemplate.{h, cpp}* to unused folder. This file currently is unused in XAspect. 27 | 28 | ### Version 1.0.1 29 | 30 | - Make the class parameter in `@classPatchField()` auto completable. Make the code snippet useful. 31 | 32 | ### Version 1.0.0 33 | 34 | - Remove Obj-C code from library to avoid trigger any Obj-C messaging before finishing weaving. Use C/C++ code instead. 35 | 36 | - Create a DSL (domain-specific language) for Obj-C to do aspect-oriented programming more intuitively (`AtAspect` keyword, `@classPatchField()...@end`, `AspectPatch()`, etc.). 37 | 38 | - Implement Safe category (the same as **libextobjc**). 39 | 40 | - Ignored method lists for safe category and aspect methods (ignore `+load` for safe category and aspect methods. 41 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | **Copyright (c) 2015 Kang-Yu Xaree Lee** 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /XAspect.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'XAspect' 3 | s.version = '1.0.5' 4 | s.license = 'MIT' 5 | s.summary = 'Making code maintainable and reusable with aspect-oriented programming for Objective-C' 6 | s.homepage = 'https://github.com/xareelee/XAspect' 7 | s.authors = { 'Kang-Yu Xaree Lee' => 'xareelee@gmail.com' } 8 | s.source = { :git => "https://github.com/xareelee/XAspect.git", :tag => s.version.to_s, :submodules => true } 9 | 10 | s.requires_arc = false 11 | 12 | s.ios.deployment_target = '5.0' 13 | s.osx.deployment_target = '10.7' 14 | 15 | s.library = 'c++' 16 | s.pod_target_xcconfig = { 17 | 'CLANG_CXX_LANGUAGE_STANDARD' => 'c++11', 18 | 'CLANG_CXX_LIBRARY' => 'libc++' 19 | } 20 | 21 | s.public_header_files = 'XAspect/XAspect.h' 22 | s.source_files = 'XAspect/XAspect.h' 23 | s.default_subspecs = 'Core', 'Macros' 24 | 25 | s.subspec 'Macros' do |ss| 26 | ss.source_files = 'XAspect/Macros/*.h' 27 | end 28 | 29 | s.subspec 'Core' do |ss| 30 | ss.source_files = 'XAspect/Core/*.{h,m,mm,c,cpp}' 31 | ss.dependency 'XAspect/Macros' 32 | end 33 | 34 | end 35 | -------------------------------------------------------------------------------- /XAspect/Core/XACExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // XACExtensions.h 3 | // 4 | // Copyright (c) 2015 Xaree Lee (Kang-Yu Lee) 5 | // Released under the MIT license (see below) 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | 26 | #ifndef XAspect_C_Extensions 27 | #define XAspect_C_Extensions 28 | 29 | #import 30 | #import 31 | #import "XAFoundation.h" 32 | #include 33 | #include 34 | 35 | 36 | typedef NS_ENUM(NSInteger, XAOriginImpType) { 37 | XAOriginImpTypeUndetermined, 38 | XAOriginImpTypeNotExists, 39 | XAOriginImpTypeExists, 40 | XAOriginImpTypeExistsInSuperclass, 41 | }; 42 | 43 | // ----------------------------------------------------------------------------- 44 | #pragma mark - C String 45 | // ----------------------------------------------------------------------------- 46 | /* 47 | The prefix 'xace' stands for XAspect C Extensions. 48 | */ 49 | 50 | /// Whether a string starts with a specific prefix. 51 | OBJC_EXTERN BOOL xace_isPrefixedCString(const char *str, const char *prefix); 52 | 53 | /// Whether a string ends with a specific suffix. 54 | OBJC_EXTERN BOOL xace_isSuffixedCString(const char *str, const char *suffix); 55 | 56 | /// @param len If len is 0, return the tail string. 57 | /// @warning You should free the string after using. 58 | OBJC_EXTERN const char *xace_createSubstring(const char* input, size_t offset, size_t len); 59 | 60 | /// Return a string which removes the prefix 61 | OBJC_EXTERN const char *xace_prefixRemovedString(const char *str, const char *prefix); 62 | 63 | /// @warning You should free the string after using. 64 | OBJC_EXTERN const char *xace_concat(int count, ...); 65 | 66 | 67 | // ----------------------------------------------------------------------------- 68 | #pragma mark - XAspect Prefix 69 | // ----------------------------------------------------------------------------- 70 | /// @warning You should free the string after using. 71 | OBJC_EXTERN const char *createAspectMethodPrefix(Class patchClass); 72 | 73 | /// @warning You should free the string after using. 74 | OBJC_EXTERN const char *createSupercallerMethodPrefix(Class targetClass); 75 | 76 | 77 | // ----------------------------------------------------------------------------- 78 | #pragma mark - Cleanup 79 | // ----------------------------------------------------------------------------- 80 | OBJC_EXTERN void free_methods(Method **methods); 81 | OBJC_EXTERN void free_const_char(const char **str); // Using as __attribute__((cleanup(free_const_char))) 82 | 83 | 84 | // ----------------------------------------------------------------------------- 85 | #pragma mark - Objc Runtime 86 | // ----------------------------------------------------------------------------- 87 | // Method Swizzling 88 | OBJC_EXTERN void makeSelectorChain(Class cls, SEL headSelector, SEL addOnSelector); 89 | 90 | OBJC_EXTERN Class classForName(const char *className); 91 | 92 | OBJC_EXTERN Class superclassForName(const char *className); 93 | 94 | OBJC_EXTERN Class metaclassForName(const char *className); 95 | 96 | OBJC_EXTERN XAOriginImpType originImplementationType(Class cls, SEL selector); 97 | 98 | 99 | // ----------------------------------------------------------------------------- 100 | #pragma mark - For Test and Debug 101 | // ----------------------------------------------------------------------------- 102 | 103 | OBJC_EXTERN void printMethodsForClass(Class cls); 104 | 105 | 106 | 107 | #endif // XAspect_C_Extensions 108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /XAspect/Core/XAWeaveHandler.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // XAWeaveHandler.cpp 3 | // 4 | // Copyright (c) 2015 Xaree Lee (Kang-Yu Lee) 5 | // Released under the MIT license (see below) 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #import "XAWeaveHandler.h" 26 | #import "XADebugMacros.h" 27 | #import "XACrystallization.h" 28 | #include 29 | 30 | 31 | // For Auto completion. 32 | XAutocompletionTypeHelper _XAutoNucleationHelper; 33 | NSUInteger XAspectWarningCounts; 34 | 35 | // ----------------------------------------------------------------------------- 36 | #pragma mark - Weaver 37 | // ----------------------------------------------------------------------------- 38 | 39 | // An API for calling C++ method to parse the patches. 40 | void _XAspect_build_patches(Class aspectMethodSourceClass, Class targetClass, const char *aspectName) { 41 | XAsepct::CrystallizationManager::sharedInstance()->constructPatchBuild(aspectMethodSourceClass, targetClass, aspectName); 42 | } 43 | 44 | // A contructor. Automatically be invoked after program is loaded. 45 | __attribute__((constructor)) 46 | static void crystallizeAllPatches(void) { 47 | XAsepct::CrystallizationManager::sharedInstance()->crystallizeAllPatches(); 48 | } 49 | 50 | 51 | -------------------------------------------------------------------------------- /XAspect/Core/XAWeaveHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // XAWeaveHandler.h 3 | // 4 | // Copyright (c) 2015 Xaree Lee (Kang-Yu Lee) 5 | // Released under the MIT license (see below) 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | 26 | #ifndef __XAspect__Weave__ 27 | #define __XAspect__Weave__ 28 | 29 | #import 30 | #import 31 | #import 32 | #import "XAFoundation.h" 33 | 34 | 35 | // ----------------------------------------------------------------------------- 36 | #pragma mark - Definitions 37 | // ----------------------------------------------------------------------------- 38 | 39 | typedef void * VoidPointer; 40 | 41 | typedef NSInteger AutoNucleationType ; 42 | 43 | typedef union { 44 | AutoNucleationType Default; 45 | AutoNucleationType SuperCaller; 46 | // AutoNucleationType DefaultAndSuperCaller; // No need 47 | } XAutocompletionTypeHelper; 48 | 49 | // For Auto completion. 50 | OBJC_EXTERN XAutocompletionTypeHelper _XAutoNucleationHelper; 51 | 52 | // Priority For Default Patch 53 | typedef long XACustomizedPriority; 54 | #define XACustomizedPriorityMax LONG_MAX 55 | 56 | // The count of calling `XALogWarning` 57 | OBJC_EXTERN NSUInteger XAspectWarningCounts; 58 | 59 | 60 | // ----------------------------------------------------------------------------- 61 | #pragma mark - Weaver 62 | // ----------------------------------------------------------------------------- 63 | // Invoke this method in the `+load` of aspect classes. 64 | OBJC_EXTERN void _XAspect_build_patches(Class aspectMethodSourceClass, Class targetClass, const char *aspectName); 65 | 66 | 67 | 68 | #endif // __XAspect__Weave__ 69 | 70 | -------------------------------------------------------------------------------- /XAspect/Macros/XADebugMacros.h: -------------------------------------------------------------------------------- 1 | // 2 | // XADebugMacros.h 3 | // 4 | // Copyright (c) 2015 Xaree Lee (Kang-Yu Lee) 5 | // Released under the MIT license (see below) 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #ifndef XAspect_Debug_Macro_h 26 | #define XAspect_Debug_Macro_h 27 | 28 | 29 | // If defining the following macros, XAspect will print out the corresponding 30 | // messages. You may macro out those macros to turn off the logging. 31 | //#define XAspectLogVerbose 32 | //#define XAspectLogSorting 33 | //#define XAspectLogMerging 34 | //#define XAspectLogWeaving 35 | //#define XAspectLogWarning 36 | #if defined(XAspectLogVerbose) || defined(XAspectLogSorting) || defined(XAspectLogMerging) || defined(XAspectLogWeaving) || defined(XAspectLogWarning) 37 | #warning Comment out the log macros before releasing to github. 38 | #endif 39 | 40 | 41 | // ============================================================================= 42 | // Macros 43 | // ============================================================================= 44 | #if defined(DEBUG) && defined(XAspectLogVerbose) 45 | # define XALogVerbose(...) printf(__VA_ARGS__) 46 | # define XALogVerboseIf(condition, ...) do{ if ((condition)) XALogVerbose(__VA_ARGS__); }while(0) 47 | #else // Do nothing; silence the message 48 | # define XALogVerbose(...) do{}while(0) 49 | # define XALogVerboseIf(condition, ...) do{}while(0) 50 | #endif 51 | // ----------------------------------------------------------------------------- 52 | #if defined(DEBUG) && defined(XAspectLogSorting) 53 | # define XALogSorting(...) printf(__VA_ARGS__) 54 | # define XALogSortingIf(condition, ...) do{ if ((condition)) XALogSorting(__VA_ARGS__); }while(0) 55 | #else // Do nothing; silence the message 56 | # define XALogSorting(...) do{}while(0) 57 | # define XALogSortingIf(condition, ...) do{}while(0) 58 | #endif 59 | // ----------------------------------------------------------------------------- 60 | #if defined(DEBUG) && defined(XAspectLogMerging) 61 | # define XALogMerging(...) printf(__VA_ARGS__) 62 | # define XALogMergingIf(condition, ...) do{ if ((condition)) XALogMerging(__VA_ARGS__); }while(0) 63 | #else // Do nothing; silence the message 64 | # define XALogMerging(...) do{}while(0) 65 | # define XALogMergingIf(condition, ...) do{}while(0) 66 | #endif 67 | // ----------------------------------------------------------------------------- 68 | #if defined(DEBUG) && (defined(XAspectLogSorting) || defined(XAspectLogMerging)) 69 | # define XALogBuilding(...) printf(__VA_ARGS__) 70 | # define XALogBuildingIf(condition, ...) do{ if ((condition)) XALogBuilding(__VA_ARGS__); }while(0) 71 | #else // Do nothing; silence the message 72 | # define XALogBuilding(...) do{}while(0) 73 | # define XALogBuildingIf(condition, ...) do{}while(0) 74 | #endif 75 | // ----------------------------------------------------------------------------- 76 | #if defined(DEBUG) && defined(XAspectLogWeaving) 77 | # define XALogWeaving(...) printf(__VA_ARGS__) 78 | # define XALogWeavingIf(condition, ...) do{ if ((condition)) XALogWeaving(__VA_ARGS__); }while(0) 79 | #else // Do nothing; silence the message 80 | # define XALogWeaving(...) do{}while(0) 81 | # define XALogWeavingIf(condition, ...) do{}while(0) 82 | #endif 83 | // ----------------------------------------------------------------------------- 84 | #if defined(XAspectLogWarning) 85 | # define XALogWarning(...) do{ XAspectWarningCounts++; printf("**XAspect Warning (%lu): ", (unsigned long) XAspectWarningCounts); printf(__VA_ARGS__); }while(0) 86 | #else 87 | # define XALogWarning(...) do{ XAspectWarningCounts++; }while(0) 88 | #endif 89 | #define XALogWarningIf(condition, ...) do{ if ((condition)) XALogWarning(__VA_ARGS__); }while(0) 90 | 91 | // ----------------------------------------------------------------------------- 92 | // Symbol for class type 93 | #define XASortingSymbol(type) ((type == XAClassTypeMetaclass)?"+":"-") 94 | // ----------------------------------------------------------------------------- 95 | // XAAssert() 96 | #ifdef DEBUG 97 | # define XAAssert(assertion, description, ...) \ 98 | do { \ 99 | if (!(assertion)) { \ 100 | fprintf(stderr, "\n--------------------------------------");\ 101 | fprintf(stderr, "\n****** XAspect Assertion Failed ******");\ 102 | fprintf(stderr, "\n--------------------------------------\n");\ 103 | fprintf(stderr, "** Condition: %s\n** Reason: ", #assertion); \ 104 | fprintf(stderr, description, ## __VA_ARGS__); \ 105 | fprintf(stderr, "\n** Function: %s", __PRETTY_FUNCTION__);\ 106 | fprintf(stderr, "\n** file %s, line %d\n", __FILE__, __LINE__); \ 107 | abort(); \ 108 | } \ 109 | } while (0) 110 | #else 111 | # define XAAssert(assertion, description, ...) do {} while (0)// consuming 112 | #endif /* DEBUG */ 113 | 114 | #define XAAssertNot(assertion, description, ...) \ 115 | XAAssert(!(assertion), description, ## __VA_ARGS__) 116 | // ----------------------------------------------------------------------------- 117 | #endif /* XAspect_Debug_Macro_h */ 118 | 119 | 120 | -------------------------------------------------------------------------------- /XAspect/Macros/XAFoundation.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef XAspect_XAFoundation_h 3 | #define XAspect_XAFoundation_h 4 | 5 | #import 6 | #include 7 | 8 | // ----------------------------------------------------------------------------- 9 | // Derived and modified from Apple's framework . 10 | // We don't import Foundation.framework, so we define NS_ENUM/NS_OPTIONS to 11 | // avoid the compilation error. 12 | 13 | // Enums and Options 14 | #if !defined(NS_ENUM) || !defined(NS_OPTIONS) 15 | # if (__cplusplus && __cplusplus >= 201103L && (__has_extension(cxx_strong_enums) || __has_feature(objc_fixed_enum))) || (!__cplusplus && __has_feature(objc_fixed_enum)) 16 | # define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type 17 | # if (__cplusplus) 18 | # define NS_OPTIONS(_type, _name) _type _name; enum : _type 19 | # else 20 | # define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type 21 | # endif 22 | # else 23 | # define NS_ENUM(_type, _name) _type _name; enum 24 | # define NS_OPTIONS(_type, _name) _type _name; enum 25 | # endif 26 | #endif 27 | 28 | // ----------------------------------------------------------------------------- 29 | 30 | // Raise a compilation error 31 | #if !defined(NSINTEGER_DEFINED) || !defined(NSIntegerMax) || !defined(NSIntegerMin) || !defined(NSUIntegerMax) || !defined(LONG_MAX) || !defined(LONG_MIN) || !defined(ULONG_MAX) 32 | #error NS integer types not defined! Please import the NSObjCRuntime.h. 33 | #endif 34 | 35 | // ----------------------------------------------------------------------------- 36 | 37 | #endif // End XAspect_XAFoundation_h 38 | -------------------------------------------------------------------------------- /XAspect/Unused/XAInjectionTemplate.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // XAInjectionTemplate.cpp 3 | // 4 | // Copyright (c) 2014 Xaree Lee (Kang-Yu Lee) 5 | // Released under the MIT license (see below) 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | 26 | #include "XAInjectionTemplate.h" 27 | 28 | extern "C" void voidRetValImpTemplate() { 29 | return; 30 | } 31 | -------------------------------------------------------------------------------- /XAspect/Unused/XAInjectionTemplate.h: -------------------------------------------------------------------------------- 1 | // 2 | // XAInjectionTemplate.h 3 | // 4 | // Copyright (c) 2014 Xaree Lee (Kang-Yu Lee) 5 | // Released under the MIT license (see below) 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | 26 | #ifndef __XAspect__InjectionTemplate__ 27 | #define __XAspect__InjectionTemplate__ 28 | 29 | 30 | #include 31 | #include 32 | #include 33 | 34 | 35 | // ----------------------------------------------------------------------------- 36 | #pragma mark - Null Return Value Implementation 37 | // ----------------------------------------------------------------------------- 38 | /// Use `nullRetValImpTemplate` to generate a function which will 39 | /// return a null value for the return type. You can inject this implementation 40 | /// to a Objective-C class for any seletor which has the same return type. 41 | /// 42 | /// @note Your should use `id` instead of `instancetype`, and use 43 | /// `voidRetValImpTemplate` instead of `nullRetValImpTemplate<>` for `void` 44 | /// return type. 45 | template T nullRetValImpTemplate() 46 | { 47 | T retVal; 48 | memset(&retVal, 0, sizeof(T)); 49 | return retVal; 50 | } 51 | 52 | /// For the return type `void`. 53 | extern "C" void voidRetValImpTemplate(); 54 | 55 | 56 | 57 | #endif /* defined(__XAspect__InjectionTemplate__) */ 58 | -------------------------------------------------------------------------------- /XAspect/XAspect.h: -------------------------------------------------------------------------------- 1 | // 2 | // XAspect.h 3 | // 4 | // Copyright (c) 2015 Xaree Lee (Kang-Yu Lee) 5 | // Released under the MIT license (see below) 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | 26 | #ifndef XAspect_h 27 | #define XAspect_h 28 | 29 | #import "XAObjcMetaprogramming.h" 30 | #import "XAWeaveHandler.h" 31 | 32 | 33 | #endif 34 | 35 | 36 | -------------------------------------------------------------------------------- /XAspectDev/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | platform :ios, '6.0' 3 | 4 | pod 'XAspect', :path => './../' 5 | pod 'CocoaLumberjack', '2.0.0-beta2' 6 | 7 | 8 | target :XAspectDevTests do 9 | pod 'XAspect', :path => './../' 10 | end 11 | -------------------------------------------------------------------------------- /XAspectDev/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - CocoaLumberjack (2.0.0-beta2): 3 | - CocoaLumberjack/CLI (= 2.0.0-beta2) 4 | - CocoaLumberjack/Core (= 2.0.0-beta2) 5 | - CocoaLumberjack/Extensions (= 2.0.0-beta2) 6 | - CocoaLumberjack/CLI (2.0.0-beta2): 7 | - CocoaLumberjack/Core 8 | - CocoaLumberjack/Core (2.0.0-beta2) 9 | - CocoaLumberjack/Extensions (2.0.0-beta2): 10 | - CocoaLumberjack/Core 11 | - XAspect (1.0.1): 12 | - XAspect/Core (= 1.0.1) 13 | - XAspect/Macros (= 1.0.1) 14 | - XAspect/Core (1.0.1): 15 | - XAspect/Macros 16 | - XAspect/Macros (1.0.1) 17 | 18 | DEPENDENCIES: 19 | - CocoaLumberjack (= 2.0.0-beta2) 20 | - XAspect (from `./../`) 21 | 22 | EXTERNAL SOURCES: 23 | XAspect: 24 | :path: ./../ 25 | 26 | SPEC CHECKSUMS: 27 | CocoaLumberjack: 956d3fb98fed498a13d56499f262c975ef431c98 28 | XAspect: 5b13a2afea2f9cdc2b847d81db551fdbb893681b 29 | 30 | COCOAPODS: 0.35.0 31 | -------------------------------------------------------------------------------- /XAspectDev/Pods/CocoaLumberjack/Classes/CLI/CLIColor.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2014, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import 17 | 18 | /** 19 | * This class represents an NSColor replacement for CLI projects that don't link with AppKit 20 | **/ 21 | 22 | @interface CLIColor : NSObject 23 | 24 | + (CLIColor *)colorWithCalibratedRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha; 25 | - (void)getRed:(CGFloat *)red green:(CGFloat *)green blue:(CGFloat *)blue alpha:(CGFloat *)alpha; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /XAspectDev/Pods/CocoaLumberjack/Classes/CLI/CLIColor.m: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2014, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import "CLIColor.h" 17 | 18 | @interface CLIColor () { 19 | CGFloat _red, _green, _blue, _alpha; 20 | } 21 | 22 | @end 23 | 24 | 25 | @implementation CLIColor 26 | 27 | + (CLIColor *)colorWithCalibratedRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha { 28 | CLIColor *color = [CLIColor new]; 29 | 30 | color->_red = red; 31 | color->_green = green; 32 | color->_blue = blue; 33 | color->_alpha = alpha; 34 | return color; 35 | } 36 | 37 | - (void)getRed:(CGFloat *)red green:(CGFloat *)green blue:(CGFloat *)blue alpha:(CGFloat *)alpha { 38 | if (red) { 39 | *red = _red; 40 | } 41 | 42 | if (green) { 43 | *green = _green; 44 | } 45 | 46 | if (blue) { 47 | *blue = _blue; 48 | } 49 | 50 | if (alpha) { 51 | *alpha = _alpha; 52 | } 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /XAspectDev/Pods/CocoaLumberjack/Classes/CocoaLumberjack.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2014, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | /** 17 | * Welcome to CocoaLumberjack! 18 | * 19 | * The project page has a wealth of documentation if you have any questions. 20 | * https://github.com/CocoaLumberjack/CocoaLumberjack 21 | * 22 | * If you're new to the project you may wish to read "Getting Started" at: 23 | * Documentation/GettingStarted.md 24 | * 25 | * Otherwise, here is a quick refresher. 26 | * There are three steps to using the macros: 27 | * 28 | * Step 1: 29 | * Import the header in your implementation or prefix file: 30 | * 31 | * #import 32 | * 33 | * Step 2: 34 | * Define your logging level in your implementation file: 35 | * 36 | * // Log levels: off, error, warn, info, verbose 37 | * static const int ddLogLevel = LOG_LEVEL_VERBOSE; 38 | * 39 | * Step 2 [3rd party frameworks]: 40 | * 41 | * Define your LOG_LEVEL_DEF to a different variable/function than ddLogLevel: 42 | * 43 | * // #undef LOG_LEVEL_DEF // Undefine first only if needed 44 | * #define LOG_LEVEL_DEF myLibLogLevel 45 | * 46 | * Define your logging level in your implementation file: 47 | * 48 | * // Log levels: off, error, warn, info, verbose 49 | * static const int myLibLogLevel = LOG_LEVEL_VERBOSE; 50 | * 51 | * Step 3: 52 | * Replace your NSLog statements with DDLog statements according to the severity of the message. 53 | * 54 | * NSLog(@"Fatal error, no dohickey found!"); -> DDLogError(@"Fatal error, no dohickey found!"); 55 | * 56 | * DDLog works exactly the same as NSLog. 57 | * This means you can pass it multiple variables just like NSLog. 58 | **/ 59 | 60 | #import "DDLog.h" 61 | #import "DDLogMacros.h" 62 | #import "DDAssertMacros.h" 63 | 64 | // Loggers 65 | #import "DDTTYLogger.h" 66 | #import "DDASLLogger.h" 67 | #import "DDFileLogger.h" 68 | -------------------------------------------------------------------------------- /XAspectDev/Pods/CocoaLumberjack/Classes/DDASLLogCapture.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2014, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import "DDASLLogger.h" 17 | 18 | @protocol DDLogger; 19 | 20 | /** 21 | * This class provides the ability to capture the ASL (Apple System Logs) 22 | */ 23 | @interface DDASLLogCapture : NSObject 24 | 25 | + (void)start; 26 | + (void)stop; 27 | 28 | // Default log level: LOG_LEVEL_VERBOSE (i.e. capture all ASL messages). 29 | + (int)captureLogLevel; 30 | + (void)setCaptureLogLevel:(int)LOG_LEVEL_XXX; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /XAspectDev/Pods/CocoaLumberjack/Classes/DDASLLogger.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2014, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import 17 | #import "DDLog.h" 18 | 19 | /** 20 | * This class provides a logger for the Apple System Log facility. 21 | * 22 | * As described in the "Getting Started" page, 23 | * the traditional NSLog() function directs it's output to two places: 24 | * 25 | * - Apple System Log 26 | * - StdErr (if stderr is a TTY) so log statements show up in Xcode console 27 | * 28 | * To duplicate NSLog() functionality you can simply add this logger and a tty logger. 29 | * However, if you instead choose to use file logging (for faster performance), 30 | * you may choose to use a file logger and a tty logger. 31 | **/ 32 | 33 | @interface DDASLLogger : DDAbstractLogger 34 | 35 | + (instancetype)sharedInstance; 36 | 37 | // Inherited from DDAbstractLogger 38 | 39 | // - (id )logFormatter; 40 | // - (void)setLogFormatter:(id )formatter; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /XAspectDev/Pods/CocoaLumberjack/Classes/DDASLLogger.m: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2014, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import "DDASLLogger.h" 17 | #import 18 | 19 | #if !__has_feature(objc_arc) 20 | #error This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC). 21 | #endif 22 | 23 | static DDASLLogger *sharedInstance; 24 | 25 | @interface DDASLLogger () { 26 | aslclient _client; 27 | } 28 | 29 | @end 30 | 31 | 32 | @implementation DDASLLogger 33 | 34 | + (instancetype)sharedInstance { 35 | static dispatch_once_t DDASLLoggerOnceToken; 36 | 37 | dispatch_once(&DDASLLoggerOnceToken, ^{ 38 | sharedInstance = [[[self class] alloc] init]; 39 | }); 40 | 41 | return sharedInstance; 42 | } 43 | 44 | - (id)init { 45 | if (sharedInstance != nil) { 46 | return nil; 47 | } 48 | 49 | if ((self = [super init])) { 50 | // A default asl client is provided for the main thread, 51 | // but background threads need to create their own client. 52 | 53 | _client = asl_open(NULL, "com.apple.console", 0); 54 | } 55 | 56 | return self; 57 | } 58 | 59 | - (void)logMessage:(DDLogMessage *)logMessage { 60 | // Skip captured log messages. 61 | if (strcmp(logMessage->file, "DDASLLogCapture") == 0) { 62 | return; 63 | } 64 | 65 | NSString *logMsg = logMessage->logMsg; 66 | 67 | if (formatter) { 68 | logMsg = [formatter formatLogMessage:logMessage]; 69 | } 70 | 71 | if (logMsg) { 72 | const char *msg = [logMsg UTF8String]; 73 | 74 | size_t aslLogLevel; 75 | switch (logMessage->logFlag) { 76 | // Note: By default ASL will filter anything above level 5 (Notice). 77 | // So our mappings shouldn't go above that level. 78 | case LOG_FLAG_ERROR : aslLogLevel = ASL_LEVEL_CRIT; break; 79 | case LOG_FLAG_WARN : aslLogLevel = ASL_LEVEL_ERR; break; 80 | case LOG_FLAG_INFO : aslLogLevel = ASL_LEVEL_WARNING; break; // Regular NSLog's level 81 | case LOG_FLAG_DEBUG : 82 | case LOG_FLAG_VERBOSE : 83 | default : aslLogLevel = ASL_LEVEL_NOTICE; break; 84 | } 85 | 86 | static char const *const level_strings[] = { "0", "1", "2", "3", "4", "5", "6", "7" }; 87 | 88 | // NSLog uses the current euid to set the ASL_KEY_READ_UID. 89 | uid_t const readUID = geteuid(); 90 | 91 | char readUIDString[16]; 92 | int l = snprintf(readUIDString, sizeof(readUIDString), "%d", readUID); 93 | 94 | NSAssert(l < sizeof(readUIDString), 95 | @"Formatted euid is too long."); 96 | NSAssert(aslLogLevel < (sizeof(level_strings) / sizeof(level_strings[0])), 97 | @"Unhandled ASL log level."); 98 | 99 | aslmsg m = asl_new(ASL_TYPE_MSG); 100 | if (m != NULL) { 101 | if (asl_set(m, ASL_KEY_LEVEL, level_strings[aslLogLevel]) == 0 && 102 | asl_set(m, ASL_KEY_MSG, msg) == 0 && 103 | asl_set(m, ASL_KEY_READ_UID, readUIDString) == 0) { 104 | asl_send(_client, m); 105 | } 106 | asl_free(m); 107 | } 108 | //TODO handle asl_* failures non-silently? 109 | } 110 | } 111 | 112 | - (NSString *)loggerName { 113 | return @"cocoa.lumberjack.aslLogger"; 114 | } 115 | 116 | @end 117 | -------------------------------------------------------------------------------- /XAspectDev/Pods/CocoaLumberjack/Classes/DDAbstractDatabaseLogger.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2014, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import "DDLog.h" 17 | 18 | /** 19 | * This class provides an abstract implementation of a database logger. 20 | * 21 | * That is, it provides the base implementation for a database logger to build atop of. 22 | * All that is needed for a concrete database logger is to extend this class 23 | * and override the methods in the implementation file that are prefixed with "db_". 24 | **/ 25 | 26 | @interface DDAbstractDatabaseLogger : DDAbstractLogger { 27 | 28 | @protected 29 | NSUInteger _saveThreshold; 30 | NSTimeInterval _saveInterval; 31 | NSTimeInterval _maxAge; 32 | NSTimeInterval _deleteInterval; 33 | BOOL _deleteOnEverySave; 34 | 35 | BOOL _saveTimerSuspended; 36 | NSUInteger _unsavedCount; 37 | dispatch_time_t _unsavedTime; 38 | dispatch_source_t _saveTimer; 39 | dispatch_time_t _lastDeleteTime; 40 | dispatch_source_t _deleteTimer; 41 | } 42 | 43 | /** 44 | * Specifies how often to save the data to disk. 45 | * Since saving is an expensive operation (disk io) it is not done after every log statement. 46 | * These properties allow you to configure how/when the logger saves to disk. 47 | * 48 | * A save is done when either (whichever happens first): 49 | * 50 | * - The number of unsaved log entries reaches saveThreshold 51 | * - The amount of time since the oldest unsaved log entry was created reaches saveInterval 52 | * 53 | * You can optionally disable the saveThreshold by setting it to zero. 54 | * If you disable the saveThreshold you are entirely dependent on the saveInterval. 55 | * 56 | * You can optionally disable the saveInterval by setting it to zero (or a negative value). 57 | * If you disable the saveInterval you are entirely dependent on the saveThreshold. 58 | * 59 | * It's not wise to disable both saveThreshold and saveInterval. 60 | * 61 | * The default saveThreshold is 500. 62 | * The default saveInterval is 60 seconds. 63 | **/ 64 | @property (assign, readwrite) NSUInteger saveThreshold; 65 | @property (assign, readwrite) NSTimeInterval saveInterval; 66 | 67 | /** 68 | * It is likely you don't want the log entries to persist forever. 69 | * Doing so would allow the database to grow infinitely large over time. 70 | * 71 | * The maxAge property provides a way to specify how old a log statement can get 72 | * before it should get deleted from the database. 73 | * 74 | * The deleteInterval specifies how often to sweep for old log entries. 75 | * Since deleting is an expensive operation (disk io) is is done on a fixed interval. 76 | * 77 | * An alternative to the deleteInterval is the deleteOnEverySave option. 78 | * This specifies that old log entries should be deleted during every save operation. 79 | * 80 | * You can optionally disable the maxAge by setting it to zero (or a negative value). 81 | * If you disable the maxAge then old log statements are not deleted. 82 | * 83 | * You can optionally disable the deleteInterval by setting it to zero (or a negative value). 84 | * 85 | * If you disable both deleteInterval and deleteOnEverySave then old log statements are not deleted. 86 | * 87 | * It's not wise to enable both deleteInterval and deleteOnEverySave. 88 | * 89 | * The default maxAge is 7 days. 90 | * The default deleteInterval is 5 minutes. 91 | * The default deleteOnEverySave is NO. 92 | **/ 93 | @property (assign, readwrite) NSTimeInterval maxAge; 94 | @property (assign, readwrite) NSTimeInterval deleteInterval; 95 | @property (assign, readwrite) BOOL deleteOnEverySave; 96 | 97 | /** 98 | * Forces a save of any pending log entries (flushes log entries to disk). 99 | **/ 100 | - (void)savePendingLogEntries; 101 | 102 | /** 103 | * Removes any log entries that are older than maxAge. 104 | **/ 105 | - (void)deleteOldLogEntries; 106 | 107 | @end 108 | -------------------------------------------------------------------------------- /XAspectDev/Pods/CocoaLumberjack/Classes/DDAssertMacros.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2014, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import "DDLogMacros.h" 17 | 18 | /** 19 | * NSAsset replacement that will output a log message even when assertions are disabled. 20 | **/ 21 | 22 | #define DDAssert(condition, frmt, ...) \ 23 | if (!(condition)) { \ 24 | NSString *description = [NSString stringWithFormat:frmt, ## __VA_ARGS__]; \ 25 | DDLogError(@"%@", description); \ 26 | NSAssert(NO, description); \ 27 | } 28 | 29 | #define DDAssertCondition(condition) DDAssert(condition, @"Condition not satisfied: %s", #condition) 30 | -------------------------------------------------------------------------------- /XAspectDev/Pods/CocoaLumberjack/Classes/DDLog+LOGV.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2014, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #ifndef Lumberjack_DDLog_LOGV_h 17 | #define Lumberjack_DDLog_LOGV_h 18 | 19 | #import "DDLog.h" 20 | 21 | 22 | #define LOGV_MACRO(isAsynchronous, lvl, flg, ctx, atag, fnct, frmt, avalist) \ 23 | [DDLog log:isAsynchronous \ 24 | level:lvl \ 25 | flag:flg \ 26 | context:ctx \ 27 | file:__FILE__ \ 28 | function:fnct \ 29 | line:__LINE__ \ 30 | tag:atag \ 31 | format:frmt \ 32 | args:avalist] 33 | 34 | #define LOGV_OBJC_MACRO(async, lvl, flg, ctx, frmt, avalist) \ 35 | LOGV_MACRO(async, lvl, flg, ctx, nil, sel_getName(_cmd), frmt, avalist) 36 | 37 | #define LOGV_C_MACRO(async, lvl, flg, ctx, frmt, avalist) \ 38 | LOGV_MACRO(async, lvl, flg, ctx, nil, __FUNCTION__, frmt, avalist) 39 | 40 | 41 | 42 | #define SYNC_LOGV_OBJC_MACRO(lvl, flg, ctx, frmt, avalist) \ 43 | LOGV_OBJC_MACRO(NO, lvl, flg, ctx, frmt, avalist) 44 | 45 | #define ASYNC_LOGV_OBJC_MACRO(lvl, flg, ctx, frmt, avalist) \ 46 | LOGV_OBJC_MACRO(YES, lvl, flg, ctx, frmt, avalist) 47 | 48 | #define SYNC_LOGV_C_MACRO(lvl, flg, ctx, frmt, avalist) \ 49 | LOGV_C_MACRO(NO, lvl, flg, ctx, frmt, avalist) 50 | 51 | #define ASYNC_LOGV_C_MACRO(lvl, flg, ctx, frmt, avalist) \ 52 | LOGV_C_MACRO(YES, lvl, flg, ctx, frmt, avalist) 53 | 54 | 55 | 56 | #define LOGV_MAYBE(async, lvl, flg, ctx, fnct, frmt, avalist) \ 57 | do { if(lvl & flg) LOGV_MACRO(async, lvl, flg, ctx, nil, fnct, frmt, avalist); } while(0) 58 | 59 | 60 | #define LOGV_OBJC_MAYBE(async, lvl, flg, ctx, frmt, avalist) \ 61 | LOGV_MAYBE(async, lvl, flg, ctx, sel_getName(_cmd), frmt, avalist) 62 | 63 | #define LOGV_C_MAYBE(async, lvl, flg, ctx, frmt, avalist) \ 64 | LOGV_MAYBE(async, lvl, flg, ctx, __FUNCTION__, frmt, avalist) 65 | 66 | #define SYNC_LOGV_OBJC_MAYBE(lvl, flg, ctx, frmt, avalist) \ 67 | LOGV_OBJC_MAYBE(NO, lvl, flg, ctx, frmt, avalist) 68 | 69 | #define ASYNC_LOGV_OBJC_MAYBE(lvl, flg, ctx, frmt, avalist) \ 70 | LOGV_OBJC_MAYBE(YES, lvl, flg, ctx, frmt, avalist) 71 | 72 | #define SYNC_LOGV_C_MAYBE(lvl, flg, ctx, frmt, avalist) \ 73 | LOGV_C_MAYBE(NO, lvl, flg, ctx, frmt, avalist) 74 | 75 | #define ASYNC_LOGV_C_MAYBE(lvl, flg, ctx, frmt, avalist) \ 76 | LOGV_C_MAYBE(YES, lvl, flg, ctx, frmt, avalist) 77 | 78 | 79 | 80 | #define LOGV_OBJC_TAG_MACRO(async, lvl, flg, ctx, tag, frmt, avalist) \ 81 | LOGV_MACRO(async, lvl, flg, ctx, tag, sel_getName(_cmd), frmt, avalist) 82 | 83 | #define LOGV_C_TAG_MACRO(async, lvl, flg, ctx, tag, frmt, avalist) \ 84 | LOGV_MACRO(async, lvl, flg, ctx, tag, __FUNCTION__, frmt, avalist) 85 | 86 | #define LOGV_TAG_MAYBE(async, lvl, flg, ctx, tag, fnct, frmt, avalist) \ 87 | do { if(lvl & flg) LOGV_MACRO(async, lvl, flg, ctx, tag, fnct, frmt, avalist); } while(0) 88 | 89 | #define LOGV_OBJC_TAG_MAYBE(async, lvl, flg, ctx, tag, frmt, avalist) \ 90 | LOGV_TAG_MAYBE(async, lvl, flg, ctx, tag, sel_getName(_cmd), frmt, avalist) 91 | 92 | #define LOGV_C_TAG_MAYBE(async, lvl, flg, ctx, tag, frmt, avalist) \ 93 | LOGV_TAG_MAYBE(async, lvl, flg, ctx, tag, __FUNCTION__, frmt, avalist) 94 | 95 | 96 | 97 | #define DDLogvError(frmt, avalist) LOGV_OBJC_MAYBE(LOG_ASYNC_ERROR, ddLogLevel, LOG_FLAG_ERROR, 0, frmt, avalist) 98 | #define DDLogvWarn(frmt, avalist) LOGV_OBJC_MAYBE(LOG_ASYNC_WARN, ddLogLevel, LOG_FLAG_WARN, 0, frmt, avalist) 99 | #define DDLogvInfo(frmt, avalist) LOGV_OBJC_MAYBE(LOG_ASYNC_INFO, ddLogLevel, LOG_FLAG_INFO, 0, frmt, avalist) 100 | #define DDLogvVerbose(frmt, avalist) LOGV_OBJC_MAYBE(LOG_ASYNC_VERBOSE, ddLogLevel, LOG_FLAG_VERBOSE, 0, frmt, avalist) 101 | 102 | #define DDLogvCError(frmt, avalist) LOGV_C_MAYBE(LOG_ASYNC_ERROR, ddLogLevel, LOG_FLAG_ERROR, 0, frmt, avalist) 103 | #define DDLogvCWarn(frmt, avalist) LOGV_C_MAYBE(LOG_ASYNC_WARN, ddLogLevel, LOG_FLAG_WARN, 0, frmt, avalist) 104 | #define DDLogvCInfo(frmt, avalist) LOGV_C_MAYBE(LOG_ASYNC_INFO, ddLogLevel, LOG_FLAG_INFO, 0, frmt, avalist) 105 | #define DDLogvCVerbose(frmt, avalist) LOGV_C_MAYBE(LOG_ASYNC_VERBOSE, ddLogLevel, LOG_FLAG_VERBOSE, 0, frmt, avalist) 106 | 107 | #endif /* ifndef Lumberjack_DDLog_LOGV_h */ 108 | -------------------------------------------------------------------------------- /XAspectDev/Pods/CocoaLumberjack/Classes/DDLogMacros.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2014, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import "DDLog.h" 17 | 18 | /** 19 | * Ready to use log macros. 20 | **/ 21 | 22 | #ifndef LOG_LEVEL_DEF 23 | #define LOG_LEVEL_DEF ddLogLevel 24 | #endif 25 | 26 | #define DDLogError(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_ERROR, LOG_LEVEL_DEF, LOG_FLAG_ERROR, 0, frmt, ## __VA_ARGS__) 27 | #define DDLogWarn(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_WARN, LOG_LEVEL_DEF, LOG_FLAG_WARN, 0, frmt, ## __VA_ARGS__) 28 | #define DDLogInfo(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_INFO, LOG_LEVEL_DEF, LOG_FLAG_INFO, 0, frmt, ## __VA_ARGS__) 29 | #define DDLogDebug(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_DEBUG, LOG_LEVEL_DEF, LOG_FLAG_DEBUG, 0, frmt, ## __VA_ARGS__) 30 | #define DDLogVerbose(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_VERBOSE, LOG_LEVEL_DEF, LOG_FLAG_VERBOSE, 0, frmt, ## __VA_ARGS__) 31 | -------------------------------------------------------------------------------- /XAspectDev/Pods/CocoaLumberjack/Classes/Extensions/DDContextFilterLogFormatter.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2014, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import 17 | #import "DDLog.h" 18 | 19 | /** 20 | * This class provides a log formatter that filters log statements from a logging context not on the whitelist. 21 | * 22 | * A log formatter can be added to any logger to format and/or filter its output. 23 | * You can learn more about log formatters here: 24 | * Documentation/CustomFormatters.md 25 | * 26 | * You can learn more about logging context's here: 27 | * Documentation/CustomContext.md 28 | * 29 | * But here's a quick overview / refresher: 30 | * 31 | * Every log statement has a logging context. 32 | * These come from the underlying logging macros defined in DDLog.h. 33 | * The default logging context is zero. 34 | * You can define multiple logging context's for use in your application. 35 | * For example, logically separate parts of your app each have a different logging context. 36 | * Also 3rd party frameworks that make use of Lumberjack generally use their own dedicated logging context. 37 | **/ 38 | @interface DDContextWhitelistFilterLogFormatter : NSObject 39 | 40 | - (id)init; 41 | 42 | - (void)addToWhitelist:(int)loggingContext; 43 | - (void)removeFromWhitelist:(int)loggingContext; 44 | 45 | - (NSArray *)whitelist; 46 | 47 | - (BOOL)isOnWhitelist:(int)loggingContext; 48 | 49 | @end 50 | 51 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 52 | #pragma mark - 53 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 54 | 55 | /** 56 | * This class provides a log formatter that filters log statements from a logging context on the blacklist. 57 | **/ 58 | @interface DDContextBlacklistFilterLogFormatter : NSObject 59 | 60 | - (id)init; 61 | 62 | - (void)addToBlacklist:(int)loggingContext; 63 | - (void)removeFromBlacklist:(int)loggingContext; 64 | 65 | - (NSArray *)blacklist; 66 | 67 | - (BOOL)isOnBlacklist:(int)loggingContext; 68 | 69 | @end 70 | -------------------------------------------------------------------------------- /XAspectDev/Pods/CocoaLumberjack/Classes/Extensions/DDContextFilterLogFormatter.m: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2014, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import "DDContextFilterLogFormatter.h" 17 | #import 18 | 19 | #if !__has_feature(objc_arc) 20 | #error This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC). 21 | #endif 22 | 23 | @interface DDLoggingContextSet : NSObject 24 | 25 | - (void)addToSet:(int)loggingContext; 26 | - (void)removeFromSet:(int)loggingContext; 27 | 28 | - (NSArray *)currentSet; 29 | 30 | - (BOOL)isInSet:(int)loggingContext; 31 | 32 | @end 33 | 34 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 35 | #pragma mark - 36 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 37 | 38 | @interface DDContextWhitelistFilterLogFormatter () { 39 | DDLoggingContextSet *_contextSet; 40 | } 41 | 42 | @end 43 | 44 | 45 | @implementation DDContextWhitelistFilterLogFormatter 46 | 47 | - (id)init { 48 | if ((self = [super init])) { 49 | _contextSet = [[DDLoggingContextSet alloc] init]; 50 | } 51 | 52 | return self; 53 | } 54 | 55 | - (void)addToWhitelist:(int)loggingContext { 56 | [_contextSet addToSet:loggingContext]; 57 | } 58 | 59 | - (void)removeFromWhitelist:(int)loggingContext { 60 | [_contextSet removeFromSet:loggingContext]; 61 | } 62 | 63 | - (NSArray *)whitelist { 64 | return [_contextSet currentSet]; 65 | } 66 | 67 | - (BOOL)isOnWhitelist:(int)loggingContext { 68 | return [_contextSet isInSet:loggingContext]; 69 | } 70 | 71 | - (NSString *)formatLogMessage:(DDLogMessage *)logMessage { 72 | if ([self isOnWhitelist:logMessage->logContext]) { 73 | return logMessage->logMsg; 74 | } else { 75 | return nil; 76 | } 77 | } 78 | 79 | @end 80 | 81 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 82 | #pragma mark - 83 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 84 | 85 | @interface DDContextBlacklistFilterLogFormatter () { 86 | DDLoggingContextSet *_contextSet; 87 | } 88 | 89 | @end 90 | 91 | 92 | @implementation DDContextBlacklistFilterLogFormatter 93 | 94 | - (id)init { 95 | if ((self = [super init])) { 96 | _contextSet = [[DDLoggingContextSet alloc] init]; 97 | } 98 | 99 | return self; 100 | } 101 | 102 | - (void)addToBlacklist:(int)loggingContext { 103 | [_contextSet addToSet:loggingContext]; 104 | } 105 | 106 | - (void)removeFromBlacklist:(int)loggingContext { 107 | [_contextSet removeFromSet:loggingContext]; 108 | } 109 | 110 | - (NSArray *)blacklist { 111 | return [_contextSet currentSet]; 112 | } 113 | 114 | - (BOOL)isOnBlacklist:(int)loggingContext { 115 | return [_contextSet isInSet:loggingContext]; 116 | } 117 | 118 | - (NSString *)formatLogMessage:(DDLogMessage *)logMessage { 119 | if ([self isOnBlacklist:logMessage->logContext]) { 120 | return nil; 121 | } else { 122 | return logMessage->logMsg; 123 | } 124 | } 125 | 126 | @end 127 | 128 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 129 | #pragma mark - 130 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 131 | 132 | 133 | @interface DDLoggingContextSet () { 134 | OSSpinLock _lock; 135 | NSMutableSet *_set; 136 | } 137 | 138 | @end 139 | 140 | 141 | @implementation DDLoggingContextSet 142 | 143 | - (id)init { 144 | if ((self = [super init])) { 145 | _set = [[NSMutableSet alloc] init]; 146 | } 147 | 148 | return self; 149 | } 150 | 151 | - (void)addToSet:(int)loggingContext { 152 | OSSpinLockLock(&_lock); 153 | { 154 | [_set addObject:@(loggingContext)]; 155 | } 156 | OSSpinLockUnlock(&_lock); 157 | } 158 | 159 | - (void)removeFromSet:(int)loggingContext { 160 | OSSpinLockLock(&_lock); 161 | { 162 | [_set removeObject:@(loggingContext)]; 163 | } 164 | OSSpinLockUnlock(&_lock); 165 | } 166 | 167 | - (NSArray *)currentSet { 168 | NSArray *result = nil; 169 | 170 | OSSpinLockLock(&_lock); 171 | { 172 | result = [_set allObjects]; 173 | } 174 | OSSpinLockUnlock(&_lock); 175 | 176 | return result; 177 | } 178 | 179 | - (BOOL)isInSet:(int)loggingContext { 180 | BOOL result = NO; 181 | 182 | OSSpinLockLock(&_lock); 183 | { 184 | result = [_set containsObject:@(loggingContext)]; 185 | } 186 | OSSpinLockUnlock(&_lock); 187 | 188 | return result; 189 | } 190 | 191 | @end 192 | -------------------------------------------------------------------------------- /XAspectDev/Pods/CocoaLumberjack/Classes/Extensions/DDDispatchQueueLogFormatter.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2014, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import 17 | #import 18 | #import "DDLog.h" 19 | 20 | 21 | /** 22 | * This class provides a log formatter that prints the dispatch_queue label instead of the mach_thread_id. 23 | * 24 | * A log formatter can be added to any logger to format and/or filter its output. 25 | * You can learn more about log formatters here: 26 | * Documentation/CustomFormatters.md 27 | * 28 | * A typical NSLog (or DDTTYLogger) prints detailed info as [:]. 29 | * For example: 30 | * 31 | * 2011-10-17 20:21:45.435 AppName[19928:5207] Your log message here 32 | * 33 | * Where: 34 | * - 19928 = process id 35 | * - 5207 = thread id (mach_thread_id printed in hex) 36 | * 37 | * When using grand central dispatch (GCD), this information is less useful. 38 | * This is because a single serial dispatch queue may be run on any thread from an internally managed thread pool. 39 | * For example: 40 | * 41 | * 2011-10-17 20:32:31.111 AppName[19954:4d07] Message from my_serial_dispatch_queue 42 | * 2011-10-17 20:32:31.112 AppName[19954:5207] Message from my_serial_dispatch_queue 43 | * 2011-10-17 20:32:31.113 AppName[19954:2c55] Message from my_serial_dispatch_queue 44 | * 45 | * This formatter allows you to replace the standard [box:info] with the dispatch_queue name. 46 | * For example: 47 | * 48 | * 2011-10-17 20:32:31.111 AppName[img-scaling] Message from my_serial_dispatch_queue 49 | * 2011-10-17 20:32:31.112 AppName[img-scaling] Message from my_serial_dispatch_queue 50 | * 2011-10-17 20:32:31.113 AppName[img-scaling] Message from my_serial_dispatch_queue 51 | * 52 | * If the dispatch_queue doesn't have a set name, then it falls back to the thread name. 53 | * If the current thread doesn't have a set name, then it falls back to the mach_thread_id in hex (like normal). 54 | * 55 | * Note: If manually creating your own background threads (via NSThread/alloc/init or NSThread/detachNeThread), 56 | * you can use [[NSThread currentThread] setName:(NSString *)]. 57 | **/ 58 | @interface DDDispatchQueueLogFormatter : NSObject 59 | 60 | /** 61 | * Standard init method. 62 | * Configure using properties as desired. 63 | **/ 64 | - (id)init; 65 | 66 | /** 67 | * The minQueueLength restricts the minimum size of the [detail box]. 68 | * If the minQueueLength is set to 0, there is no restriction. 69 | * 70 | * For example, say a dispatch_queue has a label of "diskIO": 71 | * 72 | * If the minQueueLength is 0: [diskIO] 73 | * If the minQueueLength is 4: [diskIO] 74 | * If the minQueueLength is 5: [diskIO] 75 | * If the minQueueLength is 6: [diskIO] 76 | * If the minQueueLength is 7: [diskIO ] 77 | * If the minQueueLength is 8: [diskIO ] 78 | * 79 | * The default minQueueLength is 0 (no minimum, so [detail box] won't be padded). 80 | * 81 | * If you want every [detail box] to have the exact same width, 82 | * set both minQueueLength and maxQueueLength to the same value. 83 | **/ 84 | @property (assign, atomic) NSUInteger minQueueLength; 85 | 86 | /** 87 | * The maxQueueLength restricts the number of characters that will be inside the [detail box]. 88 | * If the maxQueueLength is 0, there is no restriction. 89 | * 90 | * For example, say a dispatch_queue has a label of "diskIO": 91 | * 92 | * If the maxQueueLength is 0: [diskIO] 93 | * If the maxQueueLength is 4: [disk] 94 | * If the maxQueueLength is 5: [diskI] 95 | * If the maxQueueLength is 6: [diskIO] 96 | * If the maxQueueLength is 7: [diskIO] 97 | * If the maxQueueLength is 8: [diskIO] 98 | * 99 | * The default maxQueueLength is 0 (no maximum, so [detail box] won't be truncated). 100 | * 101 | * If you want every [detail box] to have the exact same width, 102 | * set both minQueueLength and maxQueueLength to the same value. 103 | **/ 104 | @property (assign, atomic) NSUInteger maxQueueLength; 105 | 106 | /** 107 | * Sometimes queue labels have long names like "com.apple.main-queue", 108 | * but you'd prefer something shorter like simply "main". 109 | * 110 | * This method allows you to set such preferred replacements. 111 | * The above example is set by default. 112 | * 113 | * To remove/undo a previous replacement, invoke this method with nil for the 'shortLabel' parameter. 114 | **/ 115 | - (NSString *)replacementStringForQueueLabel:(NSString *)longLabel; 116 | - (void)setReplacementString:(NSString *)shortLabel forQueueLabel:(NSString *)longLabel; 117 | 118 | @end 119 | 120 | /** 121 | * Method declarations that make it easier to extend/modify DDDispatchQueueLogFormatter 122 | **/ 123 | @interface DDDispatchQueueLogFormatter (OverridableMethods) 124 | 125 | - (NSString *)stringFromDate:(NSDate *)date; 126 | - (NSString *)queueThreadLabelForLogMessage:(DDLogMessage *)logMessage; 127 | - (NSString *)formatLogMessage:(DDLogMessage *)logMessage; 128 | 129 | @end 130 | -------------------------------------------------------------------------------- /XAspectDev/Pods/CocoaLumberjack/Classes/Extensions/DDMultiFormatter.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2014, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import 17 | #import "DDLog.h" 18 | 19 | /** 20 | * This formatter can be used to chain different formatters together. 21 | * The log message will processed in the order of the formatters added. 22 | **/ 23 | 24 | @interface DDMultiFormatter : NSObject 25 | 26 | /** 27 | * Array of chained formatters 28 | */ 29 | @property (readonly) NSArray *formatters; 30 | 31 | - (void)addFormatter:(id)formatter; 32 | - (void)removeFormatter:(id)formatter; 33 | - (void)removeAllFormatters; 34 | - (BOOL)isFormattingWithFormatter:(id)formatter; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /XAspectDev/Pods/CocoaLumberjack/Classes/Extensions/DDMultiFormatter.m: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2014, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import "DDMultiFormatter.h" 17 | 18 | 19 | #if TARGET_OS_IPHONE 20 | // Compiling for iOS 21 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000 // iOS 6.0 or later 22 | #define NEEDS_DISPATCH_RETAIN_RELEASE 0 23 | #else // iOS 5.X or earlier 24 | #define NEEDS_DISPATCH_RETAIN_RELEASE 1 25 | #endif 26 | #else 27 | // Compiling for Mac OS X 28 | #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 // Mac OS X 10.8 or later 29 | #define NEEDS_DISPATCH_RETAIN_RELEASE 0 30 | #else // Mac OS X 10.7 or earlier 31 | #define NEEDS_DISPATCH_RETAIN_RELEASE 1 32 | #endif 33 | #endif 34 | 35 | 36 | #if !__has_feature(objc_arc) 37 | #error This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC). 38 | #endif 39 | 40 | 41 | @interface DDMultiFormatter () { 42 | dispatch_queue_t _queue; 43 | NSMutableArray *_formatters; 44 | } 45 | 46 | - (DDLogMessage *)logMessageForLine:(NSString *)line originalMessage:(DDLogMessage *)message; 47 | 48 | @end 49 | 50 | 51 | @implementation DDMultiFormatter 52 | 53 | - (id)init { 54 | self = [super init]; 55 | 56 | if (self) { 57 | #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 58 | _queue = dispatch_queue_create("cocoa.lumberjack.multiformatter", DISPATCH_QUEUE_CONCURRENT); 59 | #else 60 | _queue = dispatch_queue_create("cocoa.lumberjack.multiformatter", NULL); 61 | #endif 62 | _formatters = [NSMutableArray new]; 63 | } 64 | 65 | return self; 66 | } 67 | 68 | #if NEEDS_DISPATCH_RETAIN_RELEASE 69 | - (void)dealloc { 70 | dispatch_release(_queue); 71 | } 72 | 73 | #endif 74 | 75 | #pragma mark Processing 76 | 77 | - (NSString *)formatLogMessage:(DDLogMessage *)logMessage { 78 | __block NSString *line = logMessage->logMsg; 79 | 80 | dispatch_sync(_queue, ^{ 81 | for (id formatter in _formatters) { 82 | DDLogMessage *message = [self logMessageForLine:line originalMessage:logMessage]; 83 | line = [formatter formatLogMessage:message]; 84 | 85 | if (!line) { 86 | break; 87 | } 88 | } 89 | }); 90 | 91 | return line; 92 | } 93 | 94 | - (DDLogMessage *)logMessageForLine:(NSString *)line originalMessage:(DDLogMessage *)message { 95 | DDLogMessage *newMessage = [message copy]; 96 | 97 | newMessage->logMsg = line; 98 | return newMessage; 99 | } 100 | 101 | #pragma mark Formatters 102 | 103 | - (NSArray *)formatters { 104 | __block NSArray *formatters; 105 | 106 | dispatch_sync(_queue, ^{ 107 | formatters = [_formatters copy]; 108 | }); 109 | 110 | return formatters; 111 | } 112 | 113 | - (void)addFormatter:(id)formatter { 114 | dispatch_barrier_async(_queue, ^{ 115 | [_formatters addObject:formatter]; 116 | }); 117 | } 118 | 119 | - (void)removeFormatter:(id)formatter { 120 | dispatch_barrier_async(_queue, ^{ 121 | [_formatters removeObject:formatter]; 122 | }); 123 | } 124 | 125 | - (void)removeAllFormatters { 126 | dispatch_barrier_async(_queue, ^{ 127 | [_formatters removeAllObjects]; 128 | }); 129 | } 130 | 131 | - (BOOL)isFormattingWithFormatter:(id)formatter { 132 | __block BOOL hasFormatter; 133 | 134 | dispatch_sync(_queue, ^{ 135 | hasFormatter = [_formatters containsObject:formatter]; 136 | }); 137 | 138 | return hasFormatter; 139 | } 140 | 141 | @end 142 | -------------------------------------------------------------------------------- /XAspectDev/Pods/CocoaLumberjack/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Software License Agreement (BSD License) 2 | 3 | Copyright (c) 2010-2014, Deusty, LLC 4 | All rights reserved. 5 | 6 | Redistribution and use of this software in source and binary forms, 7 | with or without modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above 10 | copyright notice, this list of conditions and the 11 | following disclaimer. 12 | 13 | * Neither the name of Deusty nor the names of its 14 | contributors may be used to endorse or promote products 15 | derived from this software without specific prior 16 | written permission of Deusty, LLC. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /XAspectDev/Pods/CocoaLumberjack/README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 | 5 | CocoaLumberjack 6 | =============== 7 | [![Build Status](http://img.shields.io/travis/CocoaLumberjack/CocoaLumberjack/master.svg?style=flat)](https://travis-ci.org/CocoaLumberjack/CocoaLumberjack) 8 | [![Pod Version](http://img.shields.io/cocoapods/v/CocoaLumberjack.svg?style=flat)](http://cocoadocs.org/docsets/CocoaLumberjack/) 9 | [![Pod Platform](http://img.shields.io/cocoapods/p/CocoaLumberjack.svg?style=flat)](http://cocoadocs.org/docsets/CocoaLumberjack/) 10 | [![Pod License](http://img.shields.io/cocoapods/l/CocoaLumberjack.svg?style=flat)](http://opensource.org/licenses/BSD-3-Clause) 11 | [![Reference Status](https://www.versioneye.com/objective-c/cocoalumberjack/reference_badge.svg?style=flat)](https://www.versioneye.com/objective-c/cocoalumberjack/references) 12 | 13 | **CocoaLumberjack** is a fast & simple, yet powerful & flexible logging framework for Mac and iOS. 14 | 15 | ### CocoaLumberjack 2 pre-release notes 16 | 17 | #### Migrating to 2.x-beta 18 | 19 | * Replace `DDLog.h` imports by `#import `. 20 | * Replace all `DDLogC` macros for regular `DDLog` macros. 21 | 22 | #### Forcing 1.x 23 | 24 | If an included library requires it, you can force CocoaLumberjack 1.x by setting the version before the conflicting library: 25 | 26 | ```ruby 27 | pod 'CocoaLumberjack', '~> 1.9' 28 | pod 'ConflictingLibrary' 29 | ``` 30 | 31 | ### Features 32 | 33 | #### Lumberjack is Fast & Simple, yet Powerful & Flexible. 34 | 35 | It is similar in concept to other popular logging frameworks such as log4j, yet is designed specifically for Objective-C, and takes advantage of features such as multi-threading, grand central dispatch (if available), lockless atomic operations, and the dynamic nature of the Objective-C runtime. 36 | 37 | #### Lumberjack is Fast 38 | 39 | In most cases it is an order of magnitude faster than NSLog. 40 | 41 | #### Lumberjack is Simple 42 | 43 | It takes as little as a single line of code to configure lumberjack when your application launches. Then simply replace your NSLog statements with DDLog statements and that's about it. (And the DDLog macros have the exact same format and syntax as NSLog, so it's super easy.) 44 | 45 | #### Lumberjack is Powerful: 46 | 47 | One log statement can be sent to multiple loggers, meaning you can log to a file and the console simultaneously. Want more? Create your own loggers (it's easy) and send your log statements over the network. Or to a database or distributed file system. The sky is the limit. 48 | 49 | #### Lumberjack is Flexible: 50 | 51 | Configure your logging however you want. Change log levels per file (perfect for debugging). Change log levels per logger (verbose console, but concise log file). Change log levels per xcode configuration (verbose debug, but concise release). Have your log statements compiled out of the release build. Customize the number of log levels for your application. Add your own fine-grained logging. Dynamically change log levels during runtime. Choose how & when you want your log files to be rolled. Upload your log files to a central server. Compress archived log files to save disk space... 52 | 53 | ### This framework is for you if: 54 | 55 | - You're looking for a way to track down that impossible-to-reproduce bug that keeps popping up in the field. 56 | - You're frustrated with the super short console log on the iPhone. 57 | - You're looking to take your application to the next level in terms of support and stability. 58 | - You're looking for an enterprise level logging solution for your application (Mac or iPhone). 59 | 60 | ### How to get started 61 | - install via [CocoaPods](http://cocoapods.org) 62 | 63 | ```ruby 64 | platform :ios, '6.1' 65 | pod 'CocoaLumberjack' 66 | ``` 67 | - read the [Getting started](Documentation/GettingStarted.md) guide, check out the [FAQ](Documentation/FAQ.md) section or the other [docs](Documentation/) 68 | - if you find issues or want to suggest improvements, create an issue or a pull request 69 | - for all kinds of questions involving CocoaLumberjack, use the [Google group](http://groups.google.com/group/cocoalumberjack) or StackOverflow (use [#lumberjack](http://stackoverflow.com/questions/tagged/lumberjack)). 70 | 71 | ### Documentation 72 | 73 | - **[Get started using Lumberjack](Documentation/GettingStarted.md)**
74 | - [Different log levels for Debug and Release builds](Documentation/XcodeTricks.md)
75 | - [Different log levels for each logger](Documentation/PerLoggerLogLevels.md)
76 | - [Use colors in the Xcode debugging console](Documentation/XcodeColors.md)
77 | - [Write your own custom formatters](Documentation/CustomFormatters.md)
78 | - [FAQ](Documentation/FAQ.md)
79 | - [Analysis of performance with benchmarks](Documentation/Performance.md)
80 | - [Common issues you may encounter and their solutions](Documentation/ProblemSolution.md)
81 | - [AppCode support](Documentation/AppCode-support.md) 82 | - **[Full Lumberjack documentation](Documentation/)**
83 | 84 | ### Requirements 85 | - Xcode 4.4 or later is required 86 | - iOS 5 or later 87 | - OS X 10.7 or later 88 | - for OS X < 10.7 support, use the 1.6.0 version 89 | 90 | ### Author 91 | - [Robbie Hanson](https://github.com/robbiehanson) 92 | - Love the project? Wanna buy me a coffee? (or a beer :D) [![donation](http://www.paypal.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UZRA26JPJB3DA) 93 | 94 | ### Collaborators 95 | - [Ernesto Rivera](https://github.com/rivera-ernesto) 96 | - [Dmitry Vorobyov](https://github.com/dvor) 97 | - [Bogdan Poplauschi](https://github.com/bpoplauschi) 98 | 99 | ### License 100 | - CocoaLumberjack is available under the BSD license. See the [LICENSE file](https://github.com/CocoaLumberjack/CocoaLumberjack/blob/master/LICENSE.txt). 101 | -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Build/CocoaLumberjack/CLIColor.h: -------------------------------------------------------------------------------- 1 | ../../../CocoaLumberjack/Classes/CLI/CLIColor.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Build/CocoaLumberjack/CocoaLumberjack.h: -------------------------------------------------------------------------------- 1 | ../../../CocoaLumberjack/Classes/CocoaLumberjack.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Build/CocoaLumberjack/DDASLLogCapture.h: -------------------------------------------------------------------------------- 1 | ../../../CocoaLumberjack/Classes/DDASLLogCapture.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Build/CocoaLumberjack/DDASLLogger.h: -------------------------------------------------------------------------------- 1 | ../../../CocoaLumberjack/Classes/DDASLLogger.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Build/CocoaLumberjack/DDAbstractDatabaseLogger.h: -------------------------------------------------------------------------------- 1 | ../../../CocoaLumberjack/Classes/DDAbstractDatabaseLogger.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Build/CocoaLumberjack/DDAssertMacros.h: -------------------------------------------------------------------------------- 1 | ../../../CocoaLumberjack/Classes/DDAssertMacros.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Build/CocoaLumberjack/DDContextFilterLogFormatter.h: -------------------------------------------------------------------------------- 1 | ../../../CocoaLumberjack/Classes/Extensions/DDContextFilterLogFormatter.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Build/CocoaLumberjack/DDDispatchQueueLogFormatter.h: -------------------------------------------------------------------------------- 1 | ../../../CocoaLumberjack/Classes/Extensions/DDDispatchQueueLogFormatter.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Build/CocoaLumberjack/DDFileLogger.h: -------------------------------------------------------------------------------- 1 | ../../../CocoaLumberjack/Classes/DDFileLogger.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Build/CocoaLumberjack/DDLog+LOGV.h: -------------------------------------------------------------------------------- 1 | ../../../CocoaLumberjack/Classes/DDLog+LOGV.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Build/CocoaLumberjack/DDLog.h: -------------------------------------------------------------------------------- 1 | ../../../CocoaLumberjack/Classes/DDLog.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Build/CocoaLumberjack/DDLogMacros.h: -------------------------------------------------------------------------------- 1 | ../../../CocoaLumberjack/Classes/DDLogMacros.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Build/CocoaLumberjack/DDMultiFormatter.h: -------------------------------------------------------------------------------- 1 | ../../../CocoaLumberjack/Classes/Extensions/DDMultiFormatter.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Build/CocoaLumberjack/DDTTYLogger.h: -------------------------------------------------------------------------------- 1 | ../../../CocoaLumberjack/Classes/DDTTYLogger.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Build/XAspect/XACExtensions.h: -------------------------------------------------------------------------------- 1 | ../../../../../XAspect/Core/XACExtensions.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Build/XAspect/XACrystallization.h: -------------------------------------------------------------------------------- 1 | ../../../../../XAspect/Core/XACrystallization.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Build/XAspect/XADebugMacros.h: -------------------------------------------------------------------------------- 1 | ../../../../../XAspect/Macros/XADebugMacros.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Build/XAspect/XAExtObjcMetamacros.h: -------------------------------------------------------------------------------- 1 | ../../../../../XAspect/Macros/XAExtObjcMetamacros.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Build/XAspect/XAFoundation.h: -------------------------------------------------------------------------------- 1 | ../../../../../XAspect/Macros/XAFoundation.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Build/XAspect/XAObjcMetaprogramming.h: -------------------------------------------------------------------------------- 1 | ../../../../../XAspect/Macros/XAObjcMetaprogramming.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Build/XAspect/XAWeaveHandler.h: -------------------------------------------------------------------------------- 1 | ../../../../../XAspect/Core/XAWeaveHandler.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Build/XAspect/XAspect.h: -------------------------------------------------------------------------------- 1 | ../../../../../XAspect/XAspect.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Public/CocoaLumberjack/CLIColor.h: -------------------------------------------------------------------------------- 1 | ../../../CocoaLumberjack/Classes/CLI/CLIColor.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Public/CocoaLumberjack/CocoaLumberjack.h: -------------------------------------------------------------------------------- 1 | ../../../CocoaLumberjack/Classes/CocoaLumberjack.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Public/CocoaLumberjack/DDASLLogCapture.h: -------------------------------------------------------------------------------- 1 | ../../../CocoaLumberjack/Classes/DDASLLogCapture.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Public/CocoaLumberjack/DDASLLogger.h: -------------------------------------------------------------------------------- 1 | ../../../CocoaLumberjack/Classes/DDASLLogger.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Public/CocoaLumberjack/DDAbstractDatabaseLogger.h: -------------------------------------------------------------------------------- 1 | ../../../CocoaLumberjack/Classes/DDAbstractDatabaseLogger.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Public/CocoaLumberjack/DDAssertMacros.h: -------------------------------------------------------------------------------- 1 | ../../../CocoaLumberjack/Classes/DDAssertMacros.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Public/CocoaLumberjack/DDContextFilterLogFormatter.h: -------------------------------------------------------------------------------- 1 | ../../../CocoaLumberjack/Classes/Extensions/DDContextFilterLogFormatter.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Public/CocoaLumberjack/DDDispatchQueueLogFormatter.h: -------------------------------------------------------------------------------- 1 | ../../../CocoaLumberjack/Classes/Extensions/DDDispatchQueueLogFormatter.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Public/CocoaLumberjack/DDFileLogger.h: -------------------------------------------------------------------------------- 1 | ../../../CocoaLumberjack/Classes/DDFileLogger.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Public/CocoaLumberjack/DDLog+LOGV.h: -------------------------------------------------------------------------------- 1 | ../../../CocoaLumberjack/Classes/DDLog+LOGV.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Public/CocoaLumberjack/DDLog.h: -------------------------------------------------------------------------------- 1 | ../../../CocoaLumberjack/Classes/DDLog.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Public/CocoaLumberjack/DDLogMacros.h: -------------------------------------------------------------------------------- 1 | ../../../CocoaLumberjack/Classes/DDLogMacros.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Public/CocoaLumberjack/DDMultiFormatter.h: -------------------------------------------------------------------------------- 1 | ../../../CocoaLumberjack/Classes/Extensions/DDMultiFormatter.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Public/CocoaLumberjack/DDTTYLogger.h: -------------------------------------------------------------------------------- 1 | ../../../CocoaLumberjack/Classes/DDTTYLogger.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Public/XAspect/XACExtensions.h: -------------------------------------------------------------------------------- 1 | ../../../../../XAspect/Core/XACExtensions.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Public/XAspect/XACrystallization.h: -------------------------------------------------------------------------------- 1 | ../../../../../XAspect/Core/XACrystallization.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Public/XAspect/XADebugMacros.h: -------------------------------------------------------------------------------- 1 | ../../../../../XAspect/Macros/XADebugMacros.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Public/XAspect/XAExtObjcMetamacros.h: -------------------------------------------------------------------------------- 1 | ../../../../../XAspect/Macros/XAExtObjcMetamacros.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Public/XAspect/XAFoundation.h: -------------------------------------------------------------------------------- 1 | ../../../../../XAspect/Macros/XAFoundation.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Public/XAspect/XAObjcMetaprogramming.h: -------------------------------------------------------------------------------- 1 | ../../../../../XAspect/Macros/XAObjcMetaprogramming.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Public/XAspect/XAWeaveHandler.h: -------------------------------------------------------------------------------- 1 | ../../../../../XAspect/Core/XAWeaveHandler.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Headers/Public/XAspect/XAspect.h: -------------------------------------------------------------------------------- 1 | ../../../../../XAspect/XAspect.h -------------------------------------------------------------------------------- /XAspectDev/Pods/Local Podspecs/XAspect.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'XAspect' 3 | s.version = '1.0.1' 4 | s.license = 'MIT' 5 | s.summary = 'Making code maintainable and reusable with aspect-oriented programming for Objective-C' 6 | s.homepage = 'https://github.com/xareelee/XAspect' 7 | s.authors = { 'Kang-Yu Xaree Lee' => 'xareelee@gmail.com' } 8 | s.source = { :git => "https://github.com/xareelee/XAspect.git", :tag => s.version.to_s, :submodules => true } 9 | 10 | s.requires_arc = false 11 | 12 | s.ios.deployment_target = '5.0' 13 | s.osx.deployment_target = '10.7' 14 | 15 | s.library = 'c++' 16 | s.xcconfig = { 17 | 'CLANG_CXX_LANGUAGE_STANDARD' => 'c++11', 18 | 'CLANG_CXX_LIBRARY' => 'libc++' 19 | } 20 | 21 | s.public_header_files = 'XAspect/XAspect.h' 22 | s.source_files = 'XAspect/XAspect.h' 23 | s.default_subspecs = 'Core', 'Macros' 24 | 25 | s.subspec 'Macros' do |ss| 26 | ss.source_files = 'XAspect/Macros/*.h' 27 | end 28 | 29 | s.subspec 'Core' do |ss| 30 | ss.source_files = 'XAspect/Core/*.{h,m,mm,c,cpp}' 31 | ss.dependency 'XAspect/Macros' 32 | end 33 | 34 | end 35 | -------------------------------------------------------------------------------- /XAspectDev/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - CocoaLumberjack (2.0.0-beta2): 3 | - CocoaLumberjack/CLI (= 2.0.0-beta2) 4 | - CocoaLumberjack/Core (= 2.0.0-beta2) 5 | - CocoaLumberjack/Extensions (= 2.0.0-beta2) 6 | - CocoaLumberjack/CLI (2.0.0-beta2): 7 | - CocoaLumberjack/Core 8 | - CocoaLumberjack/Core (2.0.0-beta2) 9 | - CocoaLumberjack/Extensions (2.0.0-beta2): 10 | - CocoaLumberjack/Core 11 | - XAspect (1.0.1): 12 | - XAspect/Core (= 1.0.1) 13 | - XAspect/Macros (= 1.0.1) 14 | - XAspect/Core (1.0.1): 15 | - XAspect/Macros 16 | - XAspect/Macros (1.0.1) 17 | 18 | DEPENDENCIES: 19 | - CocoaLumberjack (= 2.0.0-beta2) 20 | - XAspect (from `./../`) 21 | 22 | EXTERNAL SOURCES: 23 | XAspect: 24 | :path: ./../ 25 | 26 | SPEC CHECKSUMS: 27 | CocoaLumberjack: 956d3fb98fed498a13d56499f262c975ef431c98 28 | XAspect: 5b13a2afea2f9cdc2b847d81db551fdbb893681b 29 | 30 | COCOAPODS: 0.35.0 31 | -------------------------------------------------------------------------------- /XAspectDev/Pods/Pods.xcodeproj/xcuserdata/Xaree.xcuserdatad/xcschemes/Pods-CocoaLumberjack.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 42 | 43 | 44 | 45 | 51 | 52 | 54 | 55 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /XAspectDev/Pods/Pods.xcodeproj/xcuserdata/Xaree.xcuserdatad/xcschemes/Pods-XAspect.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 42 | 43 | 44 | 45 | 51 | 52 | 54 | 55 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /XAspectDev/Pods/Pods.xcodeproj/xcuserdata/Xaree.xcuserdatad/xcschemes/Pods-XAspectDevTests-CocoaLumberjack.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 42 | 43 | 44 | 45 | 51 | 52 | 54 | 55 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /XAspectDev/Pods/Pods.xcodeproj/xcuserdata/Xaree.xcuserdatad/xcschemes/Pods-XAspectDevTests-XAspect.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 42 | 43 | 44 | 45 | 51 | 52 | 54 | 55 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /XAspectDev/Pods/Pods.xcodeproj/xcuserdata/Xaree.xcuserdatad/xcschemes/Pods-XAspectDevTests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 42 | 43 | 44 | 45 | 51 | 52 | 54 | 55 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /XAspectDev/Pods/Pods.xcodeproj/xcuserdata/Xaree.xcuserdatad/xcschemes/Pods.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 42 | 43 | 44 | 45 | 51 | 52 | 54 | 55 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /XAspectDev/Pods/Pods.xcodeproj/xcuserdata/Xaree.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Pods-CocoaLumberjack.xcscheme 8 | 9 | isShown 10 | 11 | 12 | Pods-XAspect.xcscheme 13 | 14 | isShown 15 | 16 | 17 | Pods-XAspectDevTests-CocoaLumberjack.xcscheme 18 | 19 | isShown 20 | 21 | 22 | Pods-XAspectDevTests-XAspect.xcscheme 23 | 24 | isShown 25 | 26 | 27 | Pods-XAspectDevTests.xcscheme 28 | 29 | isShown 30 | 31 | 32 | Pods.xcscheme 33 | 34 | isShown 35 | 36 | 37 | 38 | SuppressBuildableAutocreation 39 | 40 | 001AC57DD249CF92A31BDC26 41 | 42 | primary 43 | 44 | 45 | 12D22DFDC2130D749BEC8F2B 46 | 47 | primary 48 | 49 | 50 | 84E5EA42F7E294DAFBB63BC6 51 | 52 | primary 53 | 54 | 55 | 9FB6EDEEDF077CD95CDF52D2 56 | 57 | primary 58 | 59 | 60 | F0D6A0F50AC2A7B760999F77 61 | 62 | primary 63 | 64 | 65 | F45A04C0AB4CDC77B16CF764 66 | 67 | primary 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /XAspectDev/Pods/Target Support Files/Pods-CocoaLumberjack/Pods-CocoaLumberjack-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-CocoaLumberjack.xcconfig" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Build" "${PODS_ROOT}/Headers/Build/CocoaLumberjack" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/XAspect" 4 | OTHER_LDFLAGS = -ObjC 5 | PODS_ROOT = ${SRCROOT} -------------------------------------------------------------------------------- /XAspectDev/Pods/Target Support Files/Pods-CocoaLumberjack/Pods-CocoaLumberjack-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_CocoaLumberjack : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_CocoaLumberjack 5 | @end 6 | -------------------------------------------------------------------------------- /XAspectDev/Pods/Target Support Files/Pods-CocoaLumberjack/Pods-CocoaLumberjack-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Pods-environment.h" 6 | -------------------------------------------------------------------------------- /XAspectDev/Pods/Target Support Files/Pods-CocoaLumberjack/Pods-CocoaLumberjack.xcconfig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xareelee/XAspect/bb5ecef58bc2f5c791c8ed26a4c884d2f83e9777/XAspectDev/Pods/Target Support Files/Pods-CocoaLumberjack/Pods-CocoaLumberjack.xcconfig -------------------------------------------------------------------------------- /XAspectDev/Pods/Target Support Files/Pods-XAspect/Pods-XAspect-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-XAspect.xcconfig" 2 | CLANG_CXX_LANGUAGE_STANDARD = ${PODS_XASPECT_CLANG_CXX_LANGUAGE_STANDARD} 3 | CLANG_CXX_LIBRARY = ${PODS_XASPECT_CLANG_CXX_LIBRARY} 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Build" "${PODS_ROOT}/Headers/Build/XAspect" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/XAspect" 6 | OTHER_LDFLAGS = ${PODS_XASPECT_OTHER_LDFLAGS} -ObjC 7 | PODS_ROOT = ${SRCROOT} -------------------------------------------------------------------------------- /XAspectDev/Pods/Target Support Files/Pods-XAspect/Pods-XAspect-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_XAspect : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_XAspect 5 | @end 6 | -------------------------------------------------------------------------------- /XAspectDev/Pods/Target Support Files/Pods-XAspect/Pods-XAspect-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Pods-environment.h" 6 | -------------------------------------------------------------------------------- /XAspectDev/Pods/Target Support Files/Pods-XAspect/Pods-XAspect.xcconfig: -------------------------------------------------------------------------------- 1 | PODS_XASPECT_CLANG_CXX_LANGUAGE_STANDARD = c++11 2 | PODS_XASPECT_CLANG_CXX_LIBRARY = libc++ 3 | PODS_XASPECT_OTHER_LDFLAGS = -l"c++" -------------------------------------------------------------------------------- /XAspectDev/Pods/Target Support Files/Pods-XAspectDevTests-CocoaLumberjack/Pods-XAspectDevTests-CocoaLumberjack-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-XAspectDevTests-CocoaLumberjack.xcconfig" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Build" "${PODS_ROOT}/Headers/Build/CocoaLumberjack" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/XAspect" 4 | OTHER_LDFLAGS = -ObjC 5 | PODS_ROOT = ${SRCROOT} -------------------------------------------------------------------------------- /XAspectDev/Pods/Target Support Files/Pods-XAspectDevTests-CocoaLumberjack/Pods-XAspectDevTests-CocoaLumberjack-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_XAspectDevTests_CocoaLumberjack : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_XAspectDevTests_CocoaLumberjack 5 | @end 6 | -------------------------------------------------------------------------------- /XAspectDev/Pods/Target Support Files/Pods-XAspectDevTests-CocoaLumberjack/Pods-XAspectDevTests-CocoaLumberjack-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Pods-XAspectDevTests-environment.h" 6 | -------------------------------------------------------------------------------- /XAspectDev/Pods/Target Support Files/Pods-XAspectDevTests-CocoaLumberjack/Pods-XAspectDevTests-CocoaLumberjack.xcconfig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xareelee/XAspect/bb5ecef58bc2f5c791c8ed26a4c884d2f83e9777/XAspectDev/Pods/Target Support Files/Pods-XAspectDevTests-CocoaLumberjack/Pods-XAspectDevTests-CocoaLumberjack.xcconfig -------------------------------------------------------------------------------- /XAspectDev/Pods/Target Support Files/Pods-XAspectDevTests-XAspect/Pods-XAspectDevTests-XAspect-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-XAspectDevTests-XAspect.xcconfig" 2 | CLANG_CXX_LANGUAGE_STANDARD = ${PODS_XASPECTDEVTESTS_XASPECT_CLANG_CXX_LANGUAGE_STANDARD} 3 | CLANG_CXX_LIBRARY = ${PODS_XASPECTDEVTESTS_XASPECT_CLANG_CXX_LIBRARY} 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Build" "${PODS_ROOT}/Headers/Build/XAspect" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/XAspect" 6 | OTHER_LDFLAGS = ${PODS_XASPECTDEVTESTS_XASPECT_OTHER_LDFLAGS} -ObjC 7 | PODS_ROOT = ${SRCROOT} -------------------------------------------------------------------------------- /XAspectDev/Pods/Target Support Files/Pods-XAspectDevTests-XAspect/Pods-XAspectDevTests-XAspect-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_XAspectDevTests_XAspect : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_XAspectDevTests_XAspect 5 | @end 6 | -------------------------------------------------------------------------------- /XAspectDev/Pods/Target Support Files/Pods-XAspectDevTests-XAspect/Pods-XAspectDevTests-XAspect-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Pods-XAspectDevTests-environment.h" 6 | -------------------------------------------------------------------------------- /XAspectDev/Pods/Target Support Files/Pods-XAspectDevTests-XAspect/Pods-XAspectDevTests-XAspect.xcconfig: -------------------------------------------------------------------------------- 1 | PODS_XASPECTDEVTESTS_XASPECT_CLANG_CXX_LANGUAGE_STANDARD = c++11 2 | PODS_XASPECTDEVTESTS_XASPECT_CLANG_CXX_LIBRARY = libc++ 3 | PODS_XASPECTDEVTESTS_XASPECT_OTHER_LDFLAGS = -l"c++" -------------------------------------------------------------------------------- /XAspectDev/Pods/Target Support Files/Pods-XAspectDevTests/Pods-XAspectDevTests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## CocoaLumberjack 5 | 6 | Software License Agreement (BSD License) 7 | 8 | Copyright (c) 2010-2014, Deusty, LLC 9 | All rights reserved. 10 | 11 | Redistribution and use of this software in source and binary forms, 12 | with or without modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above 15 | copyright notice, this list of conditions and the 16 | following disclaimer. 17 | 18 | * Neither the name of Deusty nor the names of its 19 | contributors may be used to endorse or promote products 20 | derived from this software without specific prior 21 | written permission of Deusty, LLC. 22 | 23 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | 25 | ## XAspect 26 | 27 | **Copyright (c) 2014 Kang-Yu Xaree Lee** 28 | 29 | Permission is hereby granted, free of charge, to any person obtaining a copy of 30 | this software and associated documentation files (the "Software"), to deal in 31 | the Software without restriction, including without limitation the rights to 32 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 33 | the Software, and to permit persons to whom the Software is furnished to do so, 34 | subject to the following conditions: 35 | 36 | The above copyright notice and this permission notice shall be included in all 37 | copies or substantial portions of the Software. 38 | 39 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 40 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 41 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 42 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 43 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 44 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 45 | Generated by CocoaPods - http://cocoapods.org 46 | -------------------------------------------------------------------------------- /XAspectDev/Pods/Target Support Files/Pods-XAspectDevTests/Pods-XAspectDevTests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Software License Agreement (BSD License) 18 | 19 | Copyright (c) 2010-2014, Deusty, LLC 20 | All rights reserved. 21 | 22 | Redistribution and use of this software in source and binary forms, 23 | with or without modification, are permitted provided that the following conditions are met: 24 | 25 | * Redistributions of source code must retain the above 26 | copyright notice, this list of conditions and the 27 | following disclaimer. 28 | 29 | * Neither the name of Deusty nor the names of its 30 | contributors may be used to endorse or promote products 31 | derived from this software without specific prior 32 | written permission of Deusty, LLC. 33 | 34 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | Title 36 | CocoaLumberjack 37 | Type 38 | PSGroupSpecifier 39 | 40 | 41 | FooterText 42 | **Copyright (c) 2014 Kang-Yu Xaree Lee** 43 | 44 | Permission is hereby granted, free of charge, to any person obtaining a copy of 45 | this software and associated documentation files (the "Software"), to deal in 46 | the Software without restriction, including without limitation the rights to 47 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 48 | the Software, and to permit persons to whom the Software is furnished to do so, 49 | subject to the following conditions: 50 | 51 | The above copyright notice and this permission notice shall be included in all 52 | copies or substantial portions of the Software. 53 | 54 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 55 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 56 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 57 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 58 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 59 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 60 | Title 61 | XAspect 62 | Type 63 | PSGroupSpecifier 64 | 65 | 66 | FooterText 67 | Generated by CocoaPods - http://cocoapods.org 68 | Title 69 | 70 | Type 71 | PSGroupSpecifier 72 | 73 | 74 | StringsTable 75 | Acknowledgements 76 | Title 77 | Acknowledgements 78 | 79 | 80 | -------------------------------------------------------------------------------- /XAspectDev/Pods/Target Support Files/Pods-XAspectDevTests/Pods-XAspectDevTests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_XAspectDevTests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_XAspectDevTests 5 | @end 6 | -------------------------------------------------------------------------------- /XAspectDev/Pods/Target Support Files/Pods-XAspectDevTests/Pods-XAspectDevTests-environment.h: -------------------------------------------------------------------------------- 1 | 2 | // To check if a library is compiled with CocoaPods you 3 | // can use the `COCOAPODS` macro definition which is 4 | // defined in the xcconfigs so it is available in 5 | // headers also when they are imported in the client 6 | // project. 7 | 8 | 9 | // CocoaLumberjack 10 | #define COCOAPODS_POD_AVAILABLE_CocoaLumberjack 11 | #define COCOAPODS_VERSION_MAJOR_CocoaLumberjack 2 12 | #define COCOAPODS_VERSION_MINOR_CocoaLumberjack 0 13 | #define COCOAPODS_VERSION_PATCH_CocoaLumberjack 0 14 | 15 | // CocoaLumberjack/CLI 16 | #define COCOAPODS_POD_AVAILABLE_CocoaLumberjack_CLI 17 | #define COCOAPODS_VERSION_MAJOR_CocoaLumberjack_CLI 2 18 | #define COCOAPODS_VERSION_MINOR_CocoaLumberjack_CLI 0 19 | #define COCOAPODS_VERSION_PATCH_CocoaLumberjack_CLI 0 20 | 21 | // CocoaLumberjack/Core 22 | #define COCOAPODS_POD_AVAILABLE_CocoaLumberjack_Core 23 | #define COCOAPODS_VERSION_MAJOR_CocoaLumberjack_Core 2 24 | #define COCOAPODS_VERSION_MINOR_CocoaLumberjack_Core 0 25 | #define COCOAPODS_VERSION_PATCH_CocoaLumberjack_Core 0 26 | 27 | // CocoaLumberjack/Extensions 28 | #define COCOAPODS_POD_AVAILABLE_CocoaLumberjack_Extensions 29 | #define COCOAPODS_VERSION_MAJOR_CocoaLumberjack_Extensions 2 30 | #define COCOAPODS_VERSION_MINOR_CocoaLumberjack_Extensions 0 31 | #define COCOAPODS_VERSION_PATCH_CocoaLumberjack_Extensions 0 32 | 33 | // XAspect 34 | #define COCOAPODS_POD_AVAILABLE_XAspect 35 | #define COCOAPODS_VERSION_MAJOR_XAspect 1 36 | #define COCOAPODS_VERSION_MINOR_XAspect 0 37 | #define COCOAPODS_VERSION_PATCH_XAspect 1 38 | 39 | // XAspect/Core 40 | #define COCOAPODS_POD_AVAILABLE_XAspect_Core 41 | #define COCOAPODS_VERSION_MAJOR_XAspect_Core 1 42 | #define COCOAPODS_VERSION_MINOR_XAspect_Core 0 43 | #define COCOAPODS_VERSION_PATCH_XAspect_Core 1 44 | 45 | // XAspect/Macros 46 | #define COCOAPODS_POD_AVAILABLE_XAspect_Macros 47 | #define COCOAPODS_VERSION_MAJOR_XAspect_Macros 1 48 | #define COCOAPODS_VERSION_MINOR_XAspect_Macros 0 49 | #define COCOAPODS_VERSION_PATCH_XAspect_Macros 1 50 | 51 | -------------------------------------------------------------------------------- /XAspectDev/Pods/Target Support Files/Pods-XAspectDevTests/Pods-XAspectDevTests-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | install_resource() 10 | { 11 | case $1 in 12 | *.storyboard) 13 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 14 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 15 | ;; 16 | *.xib) 17 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 18 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 19 | ;; 20 | *.framework) 21 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 22 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 23 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 24 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 25 | ;; 26 | *.xcdatamodel) 27 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" 28 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" 29 | ;; 30 | *.xcdatamodeld) 31 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" 32 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" 33 | ;; 34 | *.xcmappingmodel) 35 | echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" 36 | xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" 37 | ;; 38 | *.xcassets) 39 | ;; 40 | /*) 41 | echo "$1" 42 | echo "$1" >> "$RESOURCES_TO_COPY" 43 | ;; 44 | *) 45 | echo "${PODS_ROOT}/$1" 46 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" 47 | ;; 48 | esac 49 | } 50 | 51 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 52 | if [[ "${ACTION}" == "install" ]]; then 53 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 54 | fi 55 | rm -f "$RESOURCES_TO_COPY" 56 | 57 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ `find . -name '*.xcassets' | wc -l` -ne 0 ] 58 | then 59 | case "${TARGETED_DEVICE_FAMILY}" in 60 | 1,2) 61 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 62 | ;; 63 | 1) 64 | TARGET_DEVICE_ARGS="--target-device iphone" 65 | ;; 66 | 2) 67 | TARGET_DEVICE_ARGS="--target-device ipad" 68 | ;; 69 | *) 70 | TARGET_DEVICE_ARGS="--target-device mac" 71 | ;; 72 | esac 73 | find "${PWD}" -name "*.xcassets" -print0 | xargs -0 actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 74 | fi 75 | -------------------------------------------------------------------------------- /XAspectDev/Pods/Target Support Files/Pods-XAspectDevTests/Pods-XAspectDevTests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_CXX_LANGUAGE_STANDARD = c++11 2 | CLANG_CXX_LIBRARY = libc++ 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/XAspect" 5 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/CocoaLumberjack" -isystem "${PODS_ROOT}/Headers/Public/XAspect" 6 | OTHER_LDFLAGS = -ObjC -l"Pods-XAspectDevTests-CocoaLumberjack" -l"Pods-XAspectDevTests-XAspect" -l"c++" 7 | OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) 8 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /XAspectDev/Pods/Target Support Files/Pods-XAspectDevTests/Pods-XAspectDevTests.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_CXX_LANGUAGE_STANDARD = c++11 2 | CLANG_CXX_LIBRARY = libc++ 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/XAspect" 5 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/CocoaLumberjack" -isystem "${PODS_ROOT}/Headers/Public/XAspect" 6 | OTHER_LDFLAGS = -ObjC -l"Pods-XAspectDevTests-CocoaLumberjack" -l"Pods-XAspectDevTests-XAspect" -l"c++" 7 | OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) 8 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /XAspectDev/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## CocoaLumberjack 5 | 6 | Software License Agreement (BSD License) 7 | 8 | Copyright (c) 2010-2014, Deusty, LLC 9 | All rights reserved. 10 | 11 | Redistribution and use of this software in source and binary forms, 12 | with or without modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above 15 | copyright notice, this list of conditions and the 16 | following disclaimer. 17 | 18 | * Neither the name of Deusty nor the names of its 19 | contributors may be used to endorse or promote products 20 | derived from this software without specific prior 21 | written permission of Deusty, LLC. 22 | 23 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | 25 | ## XAspect 26 | 27 | **Copyright (c) 2014 Kang-Yu Xaree Lee** 28 | 29 | Permission is hereby granted, free of charge, to any person obtaining a copy of 30 | this software and associated documentation files (the "Software"), to deal in 31 | the Software without restriction, including without limitation the rights to 32 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 33 | the Software, and to permit persons to whom the Software is furnished to do so, 34 | subject to the following conditions: 35 | 36 | The above copyright notice and this permission notice shall be included in all 37 | copies or substantial portions of the Software. 38 | 39 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 40 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 41 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 42 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 43 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 44 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 45 | Generated by CocoaPods - http://cocoapods.org 46 | -------------------------------------------------------------------------------- /XAspectDev/Pods/Target Support Files/Pods/Pods-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Software License Agreement (BSD License) 18 | 19 | Copyright (c) 2010-2014, Deusty, LLC 20 | All rights reserved. 21 | 22 | Redistribution and use of this software in source and binary forms, 23 | with or without modification, are permitted provided that the following conditions are met: 24 | 25 | * Redistributions of source code must retain the above 26 | copyright notice, this list of conditions and the 27 | following disclaimer. 28 | 29 | * Neither the name of Deusty nor the names of its 30 | contributors may be used to endorse or promote products 31 | derived from this software without specific prior 32 | written permission of Deusty, LLC. 33 | 34 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | Title 36 | CocoaLumberjack 37 | Type 38 | PSGroupSpecifier 39 | 40 | 41 | FooterText 42 | **Copyright (c) 2014 Kang-Yu Xaree Lee** 43 | 44 | Permission is hereby granted, free of charge, to any person obtaining a copy of 45 | this software and associated documentation files (the "Software"), to deal in 46 | the Software without restriction, including without limitation the rights to 47 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 48 | the Software, and to permit persons to whom the Software is furnished to do so, 49 | subject to the following conditions: 50 | 51 | The above copyright notice and this permission notice shall be included in all 52 | copies or substantial portions of the Software. 53 | 54 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 55 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 56 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 57 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 58 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 59 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 60 | Title 61 | XAspect 62 | Type 63 | PSGroupSpecifier 64 | 65 | 66 | FooterText 67 | Generated by CocoaPods - http://cocoapods.org 68 | Title 69 | 70 | Type 71 | PSGroupSpecifier 72 | 73 | 74 | StringsTable 75 | Acknowledgements 76 | Title 77 | Acknowledgements 78 | 79 | 80 | -------------------------------------------------------------------------------- /XAspectDev/Pods/Target Support Files/Pods/Pods-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods : NSObject 3 | @end 4 | @implementation PodsDummy_Pods 5 | @end 6 | -------------------------------------------------------------------------------- /XAspectDev/Pods/Target Support Files/Pods/Pods-environment.h: -------------------------------------------------------------------------------- 1 | 2 | // To check if a library is compiled with CocoaPods you 3 | // can use the `COCOAPODS` macro definition which is 4 | // defined in the xcconfigs so it is available in 5 | // headers also when they are imported in the client 6 | // project. 7 | 8 | 9 | // CocoaLumberjack 10 | #define COCOAPODS_POD_AVAILABLE_CocoaLumberjack 11 | #define COCOAPODS_VERSION_MAJOR_CocoaLumberjack 2 12 | #define COCOAPODS_VERSION_MINOR_CocoaLumberjack 0 13 | #define COCOAPODS_VERSION_PATCH_CocoaLumberjack 0 14 | 15 | // CocoaLumberjack/CLI 16 | #define COCOAPODS_POD_AVAILABLE_CocoaLumberjack_CLI 17 | #define COCOAPODS_VERSION_MAJOR_CocoaLumberjack_CLI 2 18 | #define COCOAPODS_VERSION_MINOR_CocoaLumberjack_CLI 0 19 | #define COCOAPODS_VERSION_PATCH_CocoaLumberjack_CLI 0 20 | 21 | // CocoaLumberjack/Core 22 | #define COCOAPODS_POD_AVAILABLE_CocoaLumberjack_Core 23 | #define COCOAPODS_VERSION_MAJOR_CocoaLumberjack_Core 2 24 | #define COCOAPODS_VERSION_MINOR_CocoaLumberjack_Core 0 25 | #define COCOAPODS_VERSION_PATCH_CocoaLumberjack_Core 0 26 | 27 | // CocoaLumberjack/Extensions 28 | #define COCOAPODS_POD_AVAILABLE_CocoaLumberjack_Extensions 29 | #define COCOAPODS_VERSION_MAJOR_CocoaLumberjack_Extensions 2 30 | #define COCOAPODS_VERSION_MINOR_CocoaLumberjack_Extensions 0 31 | #define COCOAPODS_VERSION_PATCH_CocoaLumberjack_Extensions 0 32 | 33 | // XAspect 34 | #define COCOAPODS_POD_AVAILABLE_XAspect 35 | #define COCOAPODS_VERSION_MAJOR_XAspect 1 36 | #define COCOAPODS_VERSION_MINOR_XAspect 0 37 | #define COCOAPODS_VERSION_PATCH_XAspect 1 38 | 39 | // XAspect/Core 40 | #define COCOAPODS_POD_AVAILABLE_XAspect_Core 41 | #define COCOAPODS_VERSION_MAJOR_XAspect_Core 1 42 | #define COCOAPODS_VERSION_MINOR_XAspect_Core 0 43 | #define COCOAPODS_VERSION_PATCH_XAspect_Core 1 44 | 45 | // XAspect/Macros 46 | #define COCOAPODS_POD_AVAILABLE_XAspect_Macros 47 | #define COCOAPODS_VERSION_MAJOR_XAspect_Macros 1 48 | #define COCOAPODS_VERSION_MINOR_XAspect_Macros 0 49 | #define COCOAPODS_VERSION_PATCH_XAspect_Macros 1 50 | 51 | -------------------------------------------------------------------------------- /XAspectDev/Pods/Target Support Files/Pods/Pods-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | install_resource() 10 | { 11 | case $1 in 12 | *.storyboard) 13 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 14 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 15 | ;; 16 | *.xib) 17 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 18 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 19 | ;; 20 | *.framework) 21 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 22 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 23 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 24 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 25 | ;; 26 | *.xcdatamodel) 27 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" 28 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" 29 | ;; 30 | *.xcdatamodeld) 31 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" 32 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" 33 | ;; 34 | *.xcmappingmodel) 35 | echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" 36 | xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" 37 | ;; 38 | *.xcassets) 39 | ;; 40 | /*) 41 | echo "$1" 42 | echo "$1" >> "$RESOURCES_TO_COPY" 43 | ;; 44 | *) 45 | echo "${PODS_ROOT}/$1" 46 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" 47 | ;; 48 | esac 49 | } 50 | 51 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 52 | if [[ "${ACTION}" == "install" ]]; then 53 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 54 | fi 55 | rm -f "$RESOURCES_TO_COPY" 56 | 57 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ `find . -name '*.xcassets' | wc -l` -ne 0 ] 58 | then 59 | case "${TARGETED_DEVICE_FAMILY}" in 60 | 1,2) 61 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 62 | ;; 63 | 1) 64 | TARGET_DEVICE_ARGS="--target-device iphone" 65 | ;; 66 | 2) 67 | TARGET_DEVICE_ARGS="--target-device ipad" 68 | ;; 69 | *) 70 | TARGET_DEVICE_ARGS="--target-device mac" 71 | ;; 72 | esac 73 | find "${PWD}" -name "*.xcassets" -print0 | xargs -0 actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 74 | fi 75 | -------------------------------------------------------------------------------- /XAspectDev/Pods/Target Support Files/Pods/Pods.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_CXX_LANGUAGE_STANDARD = c++11 2 | CLANG_CXX_LIBRARY = libc++ 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/XAspect" 5 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/CocoaLumberjack" -isystem "${PODS_ROOT}/Headers/Public/XAspect" 6 | OTHER_LDFLAGS = -ObjC -l"Pods-CocoaLumberjack" -l"Pods-XAspect" -l"c++" 7 | OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) 8 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /XAspectDev/Pods/Target Support Files/Pods/Pods.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_CXX_LANGUAGE_STANDARD = c++11 2 | CLANG_CXX_LIBRARY = libc++ 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/XAspect" 5 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/CocoaLumberjack" -isystem "${PODS_ROOT}/Headers/Public/XAspect" 6 | OTHER_LDFLAGS = -ObjC -l"Pods-CocoaLumberjack" -l"Pods-XAspect" -l"c++" 7 | OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) 8 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /XAspectDev/XAspectDev.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDev.xcodeproj/project.xcworkspace/xcshareddata/XAspectDev.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | CD278CC7-9A79-4E73-9E39-2E0D3876572A 9 | IDESourceControlProjectName 10 | XAspectDev 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 865AF48E7F6DAC41174688D1922838541CE21A1F 14 | https://github.com/xareelee/XAspect.git 15 | 16 | IDESourceControlProjectPath 17 | XAspectDev/XAspectDev.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 865AF48E7F6DAC41174688D1922838541CE21A1F 21 | ../../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/xareelee/XAspect.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 865AF48E7F6DAC41174688D1922838541CE21A1F 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 865AF48E7F6DAC41174688D1922838541CE21A1F 36 | IDESourceControlWCCName 37 | XAspect 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDev.xcodeproj/project.xcworkspace/xcuserdata/Xaree.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xareelee/XAspect/bb5ecef58bc2f5c791c8ed26a4c884d2f83e9777/XAspectDev/XAspectDev.xcodeproj/project.xcworkspace/xcuserdata/Xaree.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /XAspectDev/XAspectDev.xcodeproj/xcuserdata/Xaree.xcuserdatad/xcschemes/XAspectDev.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 94 | 100 | 101 | 102 | 103 | 105 | 106 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDev.xcodeproj/xcuserdata/Xaree.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | XAspectDev.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 11C890B319B02A37007D12B7 16 | 17 | primary 18 | 19 | 20 | 11C890C919B02A37007D12B7 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDev.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDev.xcworkspace/xcshareddata/XAspectDev.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 03940BAA-2B49-4350-A3E8-55BCEF3CAD7E 9 | IDESourceControlProjectName 10 | XAspectDev 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 865AF48E7F6DAC41174688D1922838541CE21A1F 14 | https://github.com/xareelee/XAspect.git 15 | 16 | IDESourceControlProjectPath 17 | XAspectDev/XAspectDev.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 865AF48E7F6DAC41174688D1922838541CE21A1F 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/xareelee/XAspect.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 865AF48E7F6DAC41174688D1922838541CE21A1F 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 865AF48E7F6DAC41174688D1922838541CE21A1F 36 | IDESourceControlWCCName 37 | XAspect 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDev.xcworkspace/xcuserdata/Xaree.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xareelee/XAspect/bb5ecef58bc2f5c791c8ed26a4c884d2f83e9777/XAspectDev/XAspectDev.xcworkspace/xcuserdata/Xaree.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /XAspectDev/XAspectDev.xcworkspace/xcuserdata/Xaree.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges 6 | 7 | SnapshotAutomaticallyBeforeSignificantChanges 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDev.xcworkspace/xcuserdata/Xaree.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDev/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // XAspectDev 4 | // 5 | // Created by Xaree on 2014/8/29. 6 | // Copyright (c) 2014年 Xaree Lee. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDev/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // XAspectDev 4 | // 5 | // Created by Xaree on 2014/8/29. 6 | // Copyright (c) 2014年 Xaree Lee. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "SharedClassBetweenTargets.h" 11 | 12 | 13 | @implementation AppDelegate 14 | 15 | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 17 | 18 | // This value will be influenced by aspect patches. 19 | // The original value is 100. 20 | // An aspect from project 21 | NSLog(@"SharedClassBetweenTargets value: %ld", (long)[SharedClassBetweenTargets valueForSharedClassBetweenTargets]); 22 | return YES; 23 | } 24 | 25 | - (void)applicationWillResignActive:(UIApplication *)application { 26 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 27 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 28 | } 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | - (void)applicationWillEnterForeground:(UIApplication *)application { 36 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 37 | } 38 | 39 | - (void)applicationDidBecomeActive:(UIApplication *)application { 40 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 41 | } 42 | 43 | - (void)applicationWillTerminate:(UIApplication *)application { 44 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDev/Aspects/Aspect-CocoaLumberjack.m: -------------------------------------------------------------------------------- 1 | 2 | 3 | #import "AppDelegate.h" 4 | 5 | // ============================================================================= 6 | #import 7 | #define AtAspect CocoaLumberjack 8 | // ============================================================================= 9 | 10 | /** 11 | CocoaLumberjack 12 | 13 | @version 2.0.0-beta2 14 | @see https://github.com/CocoaLumberjack/CocoaLumberjack 15 | */ 16 | 17 | // We define the keyword `LOG_LEVEL_DEF` before importing CocoaLumberjack. We 18 | // use this macro to indicate the level in this aspect file. 19 | #ifdef DEBUG 20 | #define LOG_LEVEL_DEF LOG_LEVEL_VERBOSE 21 | #else 22 | #define LOG_LEVEL_DEF LOG_LEVEL_WARN 23 | #endif 24 | 25 | #import 26 | // ----------------------------------------------------------------------------- 27 | 28 | 29 | #define AtAspectOfClass AppDelegate 30 | @classPatchField(AppDelegate) 31 | 32 | 33 | @tryCustomizeDefaultPatch(1, -, BOOL, application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions){ 34 | return YES; 35 | } 36 | 37 | AspectPatch(-, BOOL, application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions) { 38 | 39 | [DDLog addLogger:[DDASLLogger sharedInstance]]; // sends log statements to Apple System Logger, so they show up on Console.app 40 | [DDLog addLogger:[DDTTYLogger sharedInstance]]; // sends log statements to Xcode console - if available 41 | 42 | DDLogInfo(@"CocoaLumberjack's Loggers have been configured when application did finish launching."); 43 | 44 | return XAMessageForward(application:(UIApplication *)application 45 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions); 46 | } 47 | 48 | @end 49 | #undef AtAspectOfClass 50 | 51 | // ----------------------------------------------------------------------------- 52 | 53 | 54 | #define AtAspectOfClass UIViewController 55 | @classPatchField(UIViewController) 56 | 57 | @synthesizeNucleusPatch(Default, -, void, viewDidLoad); 58 | @synthesizeNucleusPatch(Default, -, void, viewDidAppear:(BOOL)animated); 59 | 60 | AspectPatch(-, void, viewDidLoad){ 61 | 62 | DDLogInfo(@"[CocoaLumberjack Log]: %@'s view did load.", NSStringFromClass([self class])); 63 | 64 | return XAMessageForward(viewDidLoad); 65 | } 66 | 67 | AspectPatch(-, void, viewDidAppear:(BOOL)animated){ 68 | 69 | DDLogInfo(@"[CocoaLumberjack Log]: %@'s view did appear.", NSStringFromClass([self class])); 70 | 71 | return XAMessageForward(viewDidAppear:(BOOL)animated); 72 | } 73 | 74 | @end 75 | #undef AtAspectOfClass 76 | 77 | 78 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDev/Aspects/Aspect-ObjectAllocation.m: -------------------------------------------------------------------------------- 1 | // 2 | // Aspect-ObjectAllocation.m 3 | // XAspectDev 4 | // 5 | // Created by Xaree on 11/13/14. 6 | // Copyright (c) 2015 Xaree Lee. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #define AtAspect ObjectLifetime // A name for your aspect field 12 | 13 | // Create an aspect patch field for the class you want to add the aspect patches to. 14 | #define AtAspectOfClass NSObject 15 | @classPatchField(NSObject) 16 | 17 | /* 18 | Uncomment this patch will print a message for every object initialization. 19 | */ 20 | //AspectPatch(-, instancetype, init) 21 | //{ 22 | // // Add your custom implementation here. 23 | // NSLog(@"[Init]: %@", NSStringFromClass([self class])); 24 | // 25 | // // Forward the message to the origin implementation. 26 | // return XAMessageForward(init); 27 | //} 28 | 29 | 30 | @end 31 | 32 | 33 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDev/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDev/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "ipad", 20 | "size" : "29x29", 21 | "scale" : "1x" 22 | }, 23 | { 24 | "idiom" : "ipad", 25 | "size" : "29x29", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "ipad", 30 | "size" : "40x40", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "40x40", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "76x76", 41 | "scale" : "1x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "76x76", 46 | "scale" : "2x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } -------------------------------------------------------------------------------- /XAspectDev/XAspectDev/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "orientation" : "portrait", 20 | "idiom" : "ipad", 21 | "extent" : "full-screen", 22 | "minimum-system-version" : "7.0", 23 | "scale" : "1x" 24 | }, 25 | { 26 | "orientation" : "landscape", 27 | "idiom" : "ipad", 28 | "extent" : "full-screen", 29 | "minimum-system-version" : "7.0", 30 | "scale" : "1x" 31 | }, 32 | { 33 | "orientation" : "portrait", 34 | "idiom" : "ipad", 35 | "extent" : "full-screen", 36 | "minimum-system-version" : "7.0", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "orientation" : "landscape", 41 | "idiom" : "ipad", 42 | "extent" : "full-screen", 43 | "minimum-system-version" : "7.0", 44 | "scale" : "2x" 45 | } 46 | ], 47 | "info" : { 48 | "version" : 1, 49 | "author" : "xcode" 50 | } 51 | } -------------------------------------------------------------------------------- /XAspectDev/XAspectDev/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.xaree.lee.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDev/SharedClassBetweenTargets.h: -------------------------------------------------------------------------------- 1 | // 2 | // SharedClassBetweenTargets.h 3 | // XAspectDev 4 | // 5 | // Created by Xaree on 11/30/14. 6 | // Copyright (c) 2015 Xaree Lee. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SharedClassBetweenTargets : NSObject 12 | + (NSInteger)valueForSharedClassBetweenTargets; 13 | @end 14 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDev/SharedClassBetweenTargets.m: -------------------------------------------------------------------------------- 1 | // 2 | // SharedClassBetweenTargets.m 3 | // XAspectDev 4 | // 5 | // Created by Xaree on 11/30/14. 6 | // Copyright (c) 2015 Xaree Lee. All rights reserved. 7 | // 8 | 9 | #import "SharedClassBetweenTargets.h" 10 | #import 11 | #import 12 | 13 | @implementation SharedClassBetweenTargets 14 | //+ (void)load 15 | //{ 16 | // Class metaclass = objc_getMetaClass("SharedClassBetweenTargets"); 17 | // Method method = class_getInstanceMethod(metaclass, @selector(valueForSharedClassBetweenTargets)); 18 | // NSLog(@"SharedClassBetweenTargets did load. Class: <%p>. Method: <%p>", metaclass, method_getImplementation(method)); 19 | //} 20 | + (NSInteger)valueForSharedClassBetweenTargets{ 21 | Class metaclass = objc_getMetaClass("SharedClassBetweenTargets"); 22 | Method method = class_getInstanceMethod(metaclass, @selector(valueForSharedClassBetweenTargets)); 23 | NSLog(@"Invoke origin. Class: <%p>. Method: <%p>", metaclass, method_getImplementation(method)); 24 | return 100; 25 | } 26 | @end 27 | 28 | 29 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDev/XAViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XAViewController.h 3 | // XAspectDev 4 | // 5 | // Created by Xaree on 12/1/14. 6 | // Copyright (c) 2015 Xaree Lee. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XAViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDev/XAViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // XAViewController.m 3 | // XAspectDev 4 | // 5 | // Created by Xaree on 12/1/14. 6 | // Copyright (c) 2015 Xaree Lee. All rights reserved. 7 | // 8 | 9 | #import "XAViewController.h" 10 | 11 | 12 | @implementation XAViewController 13 | 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDev/XAspect-TargetTestFromProduct.m: -------------------------------------------------------------------------------- 1 | // 2 | // TargetTestFromProduct.m 3 | // XAspectDev 4 | // 5 | // Created by Xaree on 11/30/14. 6 | // Copyright (c) 2015 Xaree Lee. All rights reserved. 7 | // 8 | 9 | #import "SharedClassBetweenTargets.h" 10 | #import 11 | #define AtAspect TargetTestFromProduct // A name for your aspect field 12 | 13 | 14 | #define AtAspectOfClass SharedClassBetweenTargets 15 | @classPatchField(SharedClassBetweenTargets) 16 | 17 | AspectPatch(+, NSInteger, valueForSharedClassBetweenTargets) 18 | { 19 | return XAMessageForward(valueForSharedClassBetweenTargets) + 20; 20 | } 21 | 22 | @end 23 | #undef AtAspectOfClass 24 | 25 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDev/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // XAspectDev 4 | // 5 | // Created by Xaree on 2014/8/29. 6 | // Copyright (c) 2014年 Xaree Lee. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | printf("\n*** Create the application (UIApplicationMain())! ***\n\n"); 15 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDevTests/CExtensionTest.m: -------------------------------------------------------------------------------- 1 | // 2 | // CExtensionTest.m 3 | // XAspectDev 4 | // 5 | // Created by Xaree on 11/30/14. 6 | // Copyright (c) 2015 Xaree Lee. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | #import "FunctionForTesting.h" 13 | 14 | @interface CExtensionTest : XCTestCase 15 | 16 | @end 17 | 18 | @implementation CExtensionTest 19 | 20 | - (void)setUp { 21 | [super setUp]; 22 | // Put setup code here. This method is called before the invocation of each test method in the class. 23 | } 24 | 25 | - (void)tearDown { 26 | // Put teardown code here. This method is called after the invocation of each test method in the class. 27 | [super tearDown]; 28 | } 29 | 30 | - (void)testPrefix 31 | { 32 | XCTAssert(xace_isPrefixedCString("ABCDEFG", "A")); 33 | XCTAssert(xace_isPrefixedCString("ABCDEFG", "AB")); 34 | XCTAssert(xace_isPrefixedCString("ABCDEFG", "ABC")); 35 | XCTAssert(xace_isPrefixedCString("ABCDEFG", "ABCD")); 36 | XCTAssert(xace_isPrefixedCString("ABCDEFG", "ABCDE")); 37 | XCTAssert(xace_isPrefixedCString("ABCDEFG", "ABCDEF")); 38 | XCTAssert(xace_isPrefixedCString("ABCDEFG", "ABCDEFG")); 39 | 40 | XCTAssertFalse(xace_isPrefixedCString("ABCDEFG", "ABCDEFGH")); 41 | XCTAssertFalse(xace_isPrefixedCString("ABCDEFG", "abc")); 42 | 43 | XCTAssert(xace_isPrefixedCString("ABCDEFG", "")); 44 | XCTAssertFalse(xace_isPrefixedCString("ABCDEFG", NULL)); 45 | XCTAssertFalse(xace_isPrefixedCString(NULL, "ABC")); 46 | XCTAssertFalse(xace_isPrefixedCString(NULL, NULL)); 47 | } 48 | 49 | - (void)testSuffix 50 | { 51 | XCTAssert(xace_isSuffixedCString("ABCDEFG", "G")); 52 | XCTAssert(xace_isSuffixedCString("ABCDEFG", "FG")); 53 | XCTAssert(xace_isSuffixedCString("ABCDEFG", "EFG")); 54 | XCTAssert(xace_isSuffixedCString("ABCDEFG", "DEFG")); 55 | XCTAssert(xace_isSuffixedCString("ABCDEFG", "CDEFG")); 56 | XCTAssert(xace_isSuffixedCString("ABCDEFG", "BCDEFG")); 57 | XCTAssert(xace_isSuffixedCString("ABCDEFG", "ABCDEFG")); 58 | 59 | XCTAssertFalse(xace_isSuffixedCString("ABCDEFG", "OABCDEFG")); 60 | XCTAssertFalse(xace_isSuffixedCString("ABCDEFG", "efg")); 61 | 62 | XCTAssert(xace_isSuffixedCString("ABCDEFG", "")); 63 | XCTAssertFalse(xace_isSuffixedCString("ABCDEFG", NULL)); 64 | XCTAssertFalse(xace_isSuffixedCString(NULL, "EFG")); 65 | XCTAssertFalse(xace_isSuffixedCString(NULL, NULL)); 66 | } 67 | 68 | - (void)testSubstring 69 | { 70 | { 71 | const char *substring __attribute__((cleanup(free_const_char))) = xace_createSubstring("ABCDEFG",0,3); 72 | XCTAssertCString(substring, "ABC"); 73 | } 74 | { 75 | const char *substring __attribute__((cleanup(free_const_char))) = xace_createSubstring("ABCDEFG",0,3); 76 | XCTAssertCStringNotEqual(substring, "abc"); 77 | } 78 | { 79 | const char *substring __attribute__((cleanup(free_const_char))) = xace_createSubstring("ABCDEFG",3,4); 80 | XCTAssertCString(substring, "DEFG"); 81 | } 82 | { 83 | const char *substring __attribute__((cleanup(free_const_char))) = xace_createSubstring("ABCDEFG",0,7); 84 | XCTAssertCString(substring, "ABCDEFG"); 85 | } 86 | { 87 | // !: return the tail when the passed length is 0. 88 | const char *substring __attribute__((cleanup(free_const_char))) = xace_createSubstring("ABCDEFG",0,0); 89 | XCTAssertCString(substring, "ABCDEFG"); 90 | } 91 | } 92 | 93 | - (void)testStringConcat 94 | { 95 | { 96 | const char *substring __attribute__((cleanup(free_const_char))) = xace_concat(2, "ABC", "DEFG"); 97 | XCTAssertCString(substring, "ABCDEFG"); 98 | } 99 | { 100 | const char *substring __attribute__((cleanup(free_const_char))) = xace_concat(2, "def", "abc"); 101 | XCTAssertCString(substring, "defabc"); 102 | } 103 | { 104 | const char *substring __attribute__((cleanup(free_const_char))) = xace_concat(3, "ABC", "DEFG", "HIJK"); 105 | XCTAssertCString(substring, "ABCDEFGHIJK"); 106 | } 107 | } 108 | 109 | 110 | @end 111 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDevTests/CustomizedDefaultPatchTest.m: -------------------------------------------------------------------------------- 1 | // 2 | // CustomizedDefaultPatchTest.m 3 | // XAspectDev 4 | // 5 | // Created by Xaree on 12/5/14. 6 | // Copyright (c) 2015 Xaree Lee. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | 13 | 14 | // ============================================================================= 15 | #pragma mark - Prepare Materials to Test 16 | // ============================================================================= 17 | @protocol CustomizedDefaultPatch 18 | @optional 19 | + (NSInteger)valueForTest1; 20 | + (NSInteger)valueForTest2; 21 | + (NSInteger)valueForTestCustomizedDefaultPatch; 22 | + (NSInteger)valueForTestCustomizedDefaultPatch2; 23 | 24 | + (NSInteger)valueForTestPriorityAndLoadingSequence1; 25 | + (NSInteger)valueForTestPriorityAndLoadingSequence2; 26 | + (NSInteger)valueForTestPriorityAndLoadingSequence3; 27 | @end 28 | // We don't implement the protocol. Only leave the interface. 29 | @interface CustomizedDefaultPatch : NSObject 30 | @end 31 | 32 | @implementation CustomizedDefaultPatch 33 | @end 34 | 35 | // ----------------------------------------------------------------------------- 36 | #define AtAspect CustomizedDefaultPatchTest 37 | #define AtAspectOfClass CustomizedDefaultPatch 38 | @classPatchField(CustomizedDefaultPatch) 39 | 40 | // Which will return a 0. 41 | @synthesizeNucleusPatch(Default, +, NSInteger, valueForTest2); 42 | 43 | // Test the competition from `@synthesizeNucleusPatch` 44 | @synthesizeNucleusPatch(Default, +, NSInteger, valueForTestCustomizedDefaultPatch); 45 | @tryCustomizeDefaultPatch(5, +, NSInteger, valueForTestCustomizedDefaultPatch){ 46 | return 5; 47 | } 48 | @tryCustomizeDefaultPatch(5, +, NSInteger, valueForTestCustomizedDefaultPatch2){ 49 | return 90; 50 | } 51 | 52 | // We don't synthesize any nucleus for customized default patches. 53 | 54 | @tryCustomizeDefaultPatch(500, +, NSInteger, valueForTestPriorityAndLoadingSequence1){ // The highest priority 55 | return 77; 56 | } 57 | @tryCustomizeDefaultPatch(50, +, NSInteger, valueForTestPriorityAndLoadingSequence1){ 58 | return 88; 59 | } 60 | @tryCustomizeDefaultPatch(5, +, NSInteger, valueForTestPriorityAndLoadingSequence1){ 61 | return 99; 62 | } 63 | 64 | @tryCustomizeDefaultPatch(50, +, NSInteger, valueForTestPriorityAndLoadingSequence2){ 65 | return 77; 66 | } 67 | @tryCustomizeDefaultPatch(500, +, NSInteger, valueForTestPriorityAndLoadingSequence2){ // The highest priority 68 | return 88; 69 | } 70 | @tryCustomizeDefaultPatch(5, +, NSInteger, valueForTestPriorityAndLoadingSequence2){ 71 | return 99; 72 | } 73 | 74 | @tryCustomizeDefaultPatch(50, +, NSInteger, valueForTestPriorityAndLoadingSequence3){ 75 | return 77; 76 | } 77 | @tryCustomizeDefaultPatch(5, +, NSInteger, valueForTestPriorityAndLoadingSequence3){ 78 | return 88; 79 | } 80 | @tryCustomizeDefaultPatch(500, +, NSInteger, valueForTestPriorityAndLoadingSequence3){ // The highest priority 81 | return 99; 82 | } 83 | 84 | 85 | 86 | 87 | @end 88 | 89 | // ----------------------------------------------------------------------------- 90 | 91 | @interface CustomizedDefaultPatchTest : XCTestCase 92 | 93 | @end 94 | 95 | @implementation CustomizedDefaultPatchTest 96 | 97 | - (void)setUp { 98 | [super setUp]; 99 | // Put setup code here. This method is called before the invocation of each test method in the class. 100 | } 101 | 102 | - (void)tearDown { 103 | // Put teardown code here. This method is called after the invocation of each test method in the class. 104 | [super tearDown]; 105 | } 106 | 107 | - (void)testSynthesizeNucleus 108 | { 109 | // Test @synthesizeNucleusPatch() 110 | XCTAssertThrows([CustomizedDefaultPatch valueForTest1], 111 | @"We don't either implement or synthesize the implementation of `valueForTest1`. It should throw an exception."); 112 | 113 | XCTAssertEqual([CustomizedDefaultPatch valueForTest2], 0, 114 | @"We synthesize an default implementation which returns a null value for the return type via `@synthesizeNucleusPatch()`. It value should be 0."); 115 | } 116 | 117 | - (void)testCustomizeDefaultPatch 118 | { 119 | // With `@synthesizeNucleusPatch()` competition 120 | XCTAssertEqual([CustomizedDefaultPatch valueForTestCustomizedDefaultPatch], 5, 121 | @"We synthesize an customized default implementation. The value shouldn't be 0. It should be 5."); 122 | 123 | // Without `@synthesizeNucleusPatch()` competition 124 | XCTAssertEqual([CustomizedDefaultPatch valueForTestCustomizedDefaultPatch2], 90, 125 | @"We synthesize an customized default implementation without `@synthesizeNucleusPatch()`. The value shouldn't be 0. It should be 90."); 126 | } 127 | 128 | - (void)testCustomizeDefaultPriorities 129 | { 130 | // The loading/implementation sequence should not influence the results of priority competition. 131 | XCTAssertEqual([CustomizedDefaultPatch valueForTestPriorityAndLoadingSequence1], 77); 132 | XCTAssertEqual([CustomizedDefaultPatch valueForTestPriorityAndLoadingSequence2], 88); 133 | XCTAssertEqual([CustomizedDefaultPatch valueForTestPriorityAndLoadingSequence3], 99); 134 | } 135 | 136 | 137 | @end 138 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDevTests/CustomizedSupercalllerPatchTest.m: -------------------------------------------------------------------------------- 1 | // 2 | // CustomizedSupercalllerPatchTest.m 3 | // XAspectDev 4 | // 5 | // Created by Xaree on 12/8/14. 6 | // Copyright (c) 2015 Xaree Lee. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | 13 | 14 | #import "Tier1.h" 15 | #import "Tier2.h" 16 | #import "Tier3.h" 17 | #import "Tier4.h" 18 | #import "Tier5.h" 19 | 20 | 21 | @interface Tier1 (CustomizedSupercalllerPatchTest) 22 | + (NSInteger)valueForSupercallerForwardMacro1; 23 | + (NSInteger)valueForSupercallerPriority; 24 | + (NSInteger)valueForSupercallerSequence1; 25 | + (NSInteger)valueForSupercallerSequence2; 26 | + (NSInteger)valueForSupercallerSequence3; 27 | @end 28 | @implementation Tier1 (CustomizedSupercalllerPatchTest) 29 | + (NSInteger)valueForSupercallerForwardMacro1{ 30 | return 52; 31 | } 32 | + (NSInteger)valueForSupercallerPriority{ 33 | return 73; 34 | } 35 | + (NSInteger)valueForSupercallerSequence1{ 36 | return 98; 37 | } 38 | + (NSInteger)valueForSupercallerSequence2{ 39 | return 2001; 40 | } 41 | + (NSInteger)valueForSupercallerSequence3{ 42 | return 7003; 43 | } 44 | @end 45 | 46 | #define AtAspect CustomizedSupercalllerPatchTest 47 | 48 | @interface Tier2 (CustomizedSupercalllerPatchTest) 49 | + (NSInteger)invokeXAMessageForwardSuper; 50 | + (NSInteger)invokeXAMessageForwardSuperDirectly; 51 | @end 52 | 53 | 54 | #define AtAspectOfClass Tier2 55 | @classPatchField(Tier2) 56 | 57 | @synthesizeNucleusPatch(SuperCaller, +, NSInteger, valueForSupercallerForwardMacro1); 58 | @synthesizeNucleusPatch(SuperCaller, +, NSInteger, valueForSupercallerPriority); 59 | @synthesizeNucleusPatch(SuperCaller, +, NSInteger, valueForSupercallerSequence1); 60 | @synthesizeNucleusPatch(SuperCaller, +, NSInteger, valueForSupercallerSequence2); 61 | @synthesizeNucleusPatch(SuperCaller, +, NSInteger, valueForSupercallerSequence3); 62 | 63 | // To test `XAMessageForwardSuper` and `XAMessageForwardSuperDirectly`. 64 | + (NSInteger)invokeXAMessageForwardSuper{ 65 | return XAMessageForwardSuper(valueForSupercallerForwardMacro1); 66 | } 67 | + (NSInteger)invokeXAMessageForwardSuperDirectly{ 68 | return XAMessageForwardSuperDirectly(valueForSupercallerForwardMacro1); 69 | } 70 | 71 | // The Customize supercaller with priority 72 | @tryCustomizeSupercallerPatch(63, +, NSInteger, valueForSupercallerPriority){ 73 | return XAMessageForwardSuper(valueForSupercallerPriority) + 49; 74 | } 75 | 76 | // Test priority and sequence 77 | @tryCustomizeSupercallerPatch(3, +, NSInteger, valueForSupercallerSequence1){ 78 | return XAMessageForwardSuper(valueForSupercallerSequence1) + 3; 79 | } 80 | @tryCustomizeSupercallerPatch(33, +, NSInteger, valueForSupercallerSequence1){ 81 | return XAMessageForwardSuper(valueForSupercallerSequence1) + 33; 82 | } 83 | @tryCustomizeSupercallerPatch(333, +, NSInteger, valueForSupercallerSequence1){ // Highest priority 84 | return XAMessageForwardSuper(valueForSupercallerSequence1) + 333; 85 | } 86 | 87 | @tryCustomizeSupercallerPatch(333, +, NSInteger, valueForSupercallerSequence2){ // Highest priority 88 | return XAMessageForwardSuper(valueForSupercallerSequence2) + 3; 89 | } 90 | @tryCustomizeSupercallerPatch(3, +, NSInteger, valueForSupercallerSequence2){ 91 | return XAMessageForwardSuper(valueForSupercallerSequence2) + 33; 92 | } 93 | @tryCustomizeSupercallerPatch(33, +, NSInteger, valueForSupercallerSequence2){ 94 | return XAMessageForwardSuper(valueForSupercallerSequence2) + 333; 95 | } 96 | 97 | @tryCustomizeSupercallerPatch(3, +, NSInteger, valueForSupercallerSequence3){ 98 | return XAMessageForwardSuper(valueForSupercallerSequence3) + 3; 99 | } 100 | @tryCustomizeSupercallerPatch(333, +, NSInteger, valueForSupercallerSequence3){ // Highest priority 101 | return XAMessageForwardSuper(valueForSupercallerSequence3) + 33; 102 | } 103 | @tryCustomizeSupercallerPatch(33, +, NSInteger, valueForSupercallerSequence3){ 104 | return XAMessageForwardSuper(valueForSupercallerSequence3) + 333; 105 | } 106 | 107 | @end 108 | 109 | 110 | @interface CustomizedSupercalllerPatchTest : XCTestCase 111 | 112 | @end 113 | 114 | @implementation CustomizedSupercalllerPatchTest 115 | 116 | - (void)setUp { 117 | [super setUp]; 118 | // Put setup code here. This method is called before the invocation of each test method in the class. 119 | } 120 | 121 | - (void)tearDown { 122 | // Put teardown code here. This method is called after the invocation of each test method in the class. 123 | [super tearDown]; 124 | } 125 | 126 | - (void)testXAMessageForwardSuperMacro{ 127 | // Test XAMessageForwardSuper 128 | 129 | // We inject safe category patch, and invoke `XAMessageForwardSuper` inside. 130 | XCTAssertEqual([Tier2 invokeXAMessageForwardSuper], 52, 131 | "The macro `XAMessageForwardSuper()` should work."); 132 | XCTAssertEqual([Tier2 invokeXAMessageForwardSuperDirectly], 52, 133 | "The macro `invokeXAMessageForwardSuperDirectly()` should work."); 134 | } 135 | 136 | - (void)testTryCustomizeSupercallerPatchMacro 137 | { 138 | // The customize supercaller should overwrite the supercaller from 139 | // `@synthesizeNucleusPatch()`. 140 | XCTAssertEqual([Tier2 valueForSupercallerPriority], 122, 141 | "The macro `@tryCustomizeSupercallerPatch()` should work. The priority is higher than"); 142 | } 143 | 144 | - (void)testTryCustomizeSupercallerPatchPriority 145 | { 146 | // The loading/implementation sequence should not influence the results of priority competition. 147 | XCTAssertEqual([Tier2 valueForSupercallerSequence1], 431, 148 | "The priority in `@tryCustomizeSupercallerPatch()` should work and no matter what the sequence is."); 149 | XCTAssertEqual([Tier2 valueForSupercallerSequence2], 2004, 150 | "The priority in `@tryCustomizeSupercallerPatch()` should work and no matter what the sequence is."); 151 | XCTAssertEqual([Tier2 valueForSupercallerSequence3], 7036, 152 | "The priority in `@tryCustomizeSupercallerPatch()` should work and no matter what the sequence is."); 153 | } 154 | 155 | @end 156 | 157 | 158 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDevTests/DuplicatedAspectPatchesTest.m: -------------------------------------------------------------------------------- 1 | // 2 | // DuplicatedAspectPatchesTest.m 3 | // XAspectDev 4 | // 5 | // Created by Xaree on 12/15/14. 6 | // Copyright (c) 2015 Xaree Lee. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | 13 | @interface DuplicatedAspectPatchesTest : XCTestCase 14 | 15 | @end 16 | 17 | @implementation DuplicatedAspectPatchesTest 18 | 19 | - (void)setUp { 20 | [super setUp]; 21 | // Put setup code here. This method is called before the invocation of each test method in the class. 22 | } 23 | 24 | - (void)tearDown { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testWarnings 30 | { 31 | XCTAssertEqual(XAspectWarningCounts, 4, 32 | @"The count should be equal to the number of aspect patches in Aspect-Foundation_UnicodifyingDescriptionsOfObjects.m due to shared implementation."); 33 | } 34 | 35 | - (void)testDuplicatedAspectPatches { 36 | // This is an example of a functional test case. 37 | NSArray *array = @[@"如果你不愛我", 38 | @"我會讓你走", 39 | @"如果你真心愛我", 40 | @"我會讓你擁有全世界", 41 | @{@"真的嗎?":@"真的"} 42 | ]; 43 | 44 | NSString *descriptionOfArray = @"[\n\t\"如果你不愛我\",\n\t\"我會讓你走\",\n\t\"如果你真心愛我\",\n\t\"我會讓你擁有全世界\",\n\t{\n\t\t\"真的嗎?\" : \"真的\"\n\t}\n]" ; 45 | 46 | // Foundation_UnicodifyingDescriptionsOfObjects should generate duplicated 47 | // aspect patches for the same target 48 | XCTAssert([[array description] isEqualToString:descriptionOfArray], 49 | @"The string should be equal via aspect 'Foundation_UnicodifyingDescriptionsOfObjects'."); 50 | } 51 | 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDevTests/FunctionForTesting.h: -------------------------------------------------------------------------------- 1 | // 2 | // FunctionForTesting.h 3 | // XAspectDev 4 | // 5 | // Created by Xaree on 9/24/14. 6 | // Copyright (c) 2015 Xaree Lee. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | IMP classImp(Class cls, SEL sel); 13 | IMP instanceImp(Class cls, SEL sel); 14 | 15 | /* 16 | We test macro expansion results here. 17 | */ 18 | #define XCTAssertMacro(macroA, expandedResultsString, ...) \ 19 | XCTAssertCString(metamacro_stringify(macroA), expandedResultsString, ## __VA_ARGS__) 20 | #define XCTAssertCString(strA, strB, ...) \ 21 | XCTAssert(strcmp(strA, strB) == 0, ## __VA_ARGS__) 22 | #define XCTAssertCStringNotEqual(strA, strB, ...) \ 23 | XCTAssert(strcmp(strA, strB) != 0, ## __VA_ARGS__) 24 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDevTests/FunctionForTesting.m: -------------------------------------------------------------------------------- 1 | // 2 | // FunctionForTesting.m 3 | // XAspectDev 4 | // 5 | // Created by Xaree on 9/24/14. 6 | // Copyright (c) 2015 Xaree Lee. All rights reserved. 7 | // 8 | 9 | #import "FunctionForTesting.h" 10 | 11 | 12 | IMP classImp(Class cls, SEL sel) { 13 | return method_getImplementation(class_getClassMethod(cls, sel)); 14 | } 15 | IMP instanceImp(Class cls, SEL sel) { 16 | return method_getImplementation(class_getInstanceMethod(cls, sel)); 17 | } 18 | 19 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDevTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.xaree.lee.$(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 | 24 | 25 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDevTests/MethodPrefixTest.m: -------------------------------------------------------------------------------- 1 | // 2 | // MethodPrefixTest.m 3 | // XAspectDev 4 | // 5 | // Created by Xaree on 12/9/14. 6 | // Copyright (c) 2015 Xaree Lee. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | #import "FunctionForTesting.h" 13 | 14 | @interface MethodPrefixTest : XCTestCase 15 | 16 | @end 17 | 18 | @implementation MethodPrefixTest 19 | 20 | - (void)setUp { 21 | [super setUp]; 22 | // Put setup code here. This method is called before the invocation of each test method in the class. 23 | } 24 | 25 | - (void)tearDown { 26 | // Put teardown code here. This method is called after the invocation of each test method in the class. 27 | [super tearDown]; 28 | } 29 | 30 | // ----------------------------------------------------------------------------- 31 | #pragma mark - Macro Prefix Test 32 | // ----------------------------------------------------------------------------- 33 | - (void)testPriorityPrefixedMethod 34 | { 35 | // The priority prefix will be used in customized default patched and 36 | // customized supercaller patches. 37 | XCTAssertMacro(_XAspectPriorityMethodPrefix, 38 | "_Priority_"); 39 | 40 | XCTAssertMacro(_XAspectCustomizedMethodJoiner, 41 | "_ForCustomization__"); 42 | 43 | XCTAssertMacro(_PriorityPrefixMethodBody(7, init), 44 | "_Priority_7_ForCustomization__init"); 45 | } 46 | 47 | // You can replace the method name or selctor name for testing the prefixed name. 48 | - (void)testDefaultPrefixedMethod 49 | { 50 | // Default method prefix. 51 | XCTAssertMacro(_XADefaultPrefix, 52 | "_XAspectDefault_"); 53 | 54 | // Default prefixed method. 55 | // Because the default patch only exists in the aspect class, the selector 56 | // will not be exposed in the target class. So the selector name doesn't 57 | // need to be unique in the class hierarchy. 58 | XCTAssertMacro(_XADefaultPrefixMethod(init), 59 | "_XAspectDefault_init"); 60 | } 61 | 62 | - (void)testCustomizedDefaultPrefixedMethod 63 | { 64 | // Customized default method with priority. 65 | XCTAssertMacro(_customizedDefaultPrefixMethodBody(7, init), 66 | "_XAspectDefault__Priority_7_ForCustomization__init"); 67 | } 68 | 69 | - (void)testSuperCallerPrefixedMethod 70 | { 71 | // Test super-caller method prefix 72 | XCTAssertMacro(_XACallSuperKeyword, 73 | "_XAspectCallSuperImp_"); 74 | 75 | // Test super-caller method name. 76 | // The selector name should be unique in the class hierarchy due to it is 77 | // implemented in the target class and may be conflicted to other 78 | // implementation. 79 | XCTAssertMacro(_XACallSuperMethod(NSObject, init), 80 | "NSObject_XAspectCallSuperImp_init"); 81 | } 82 | 83 | - (void)testCustomizedSupercallerPrefixedMethod 84 | { 85 | // Customized supercaller method with priority. 86 | #define AtAspectOfClass NSObject 87 | XCTAssertMacro(_customizedSupercallerPrefixMethodBody(7, init), 88 | "NSObject_XAspectCallSuperImp__Priority_7_ForCustomization__init"); 89 | #undef AtAspect 90 | } 91 | 92 | - (void)testAspectPrefixedMethod 93 | { 94 | #define AtAspect HelloWorld 95 | // Test synthesized aspect method prefix for a class 96 | XCTAssertMacro(_XAAspectMethodPrefix(NSObject), 97 | "_AtAspect_HelloWorld_OfClass_NSObject__"); 98 | 99 | // Test the aspect prefiexed method name 100 | XCTAssertMacro(_XAAspectPrefixedMethodBody(NSObject, init), 101 | "_AtAspect_HelloWorld_OfClass_NSObject__init"); 102 | #undef AtAspect 103 | } 104 | 105 | @end 106 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDevTests/MultiTargetTest.m: -------------------------------------------------------------------------------- 1 | // 2 | // MultiTargetTest.m 3 | // XAspectDev 4 | // 5 | // Created by Xaree on 11/30/14. 6 | // Copyright (c) 2015 Xaree Lee. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "SharedClassBetweenTargets.h" 12 | #import 13 | #import 14 | 15 | 16 | #define AtAspect TargetTestFromTest // A name for your aspect field 17 | 18 | @interface SharedClassBetweenTargets(TargetTestFromTest) 19 | + (NSInteger) _AtAspect_TargetTestFromTest_OfClass_SharedClassBetweenTargets__valueForSharedClassBetweenTargets; 20 | + (NSInteger) _AtAspect_TargetTestFromProduct_OfClass_SharedClassBetweenTargets__valueForSharedClassBetweenTargets; 21 | @end 22 | 23 | 24 | #define AtAspectOfClass SharedClassBetweenTargets 25 | @classPatchField(SharedClassBetweenTargets) 26 | 27 | AspectPatch(+, NSInteger, valueForSharedClassBetweenTargets) { 28 | return XAMessageForward(valueForSharedClassBetweenTargets) + 3; 29 | } 30 | @end 31 | 32 | 33 | @interface MultiTargetTest : XCTestCase 34 | 35 | @end 36 | 37 | @implementation MultiTargetTest 38 | 39 | - (void)setUp { 40 | [super setUp]; 41 | // Put setup code here. This method is called before the invocation of each test method in the class. 42 | } 43 | 44 | - (void)tearDown { 45 | // Put teardown code here. This method is called after the invocation of each test method in the class. 46 | [super tearDown]; 47 | } 48 | 49 | - (void)testMultipleTargetsWeaving { 50 | // We haven't succeeded to pass multiple target loading test yet. 51 | 52 | 53 | const char *className = NSStringFromClass([SharedClassBetweenTargets class]).UTF8String; 54 | Class cls = objc_getClass(className); 55 | Class metaclass = objc_getMetaClass(className); 56 | printMethodsForClass(metaclass); 57 | NSLog(@"class <%p/%p>", cls, metaclass); 58 | 59 | NSLog(@"Test value (current selector): %ld <%p>", 60 | [SharedClassBetweenTargets valueForSharedClassBetweenTargets], 61 | method_getImplementation(class_getInstanceMethod(metaclass, @selector(valueForSharedClassBetweenTargets)))); 62 | NSLog(@"Test value (test aspect selector): %ld <%p>", 63 | [SharedClassBetweenTargets _AtAspect_TargetTestFromTest_OfClass_SharedClassBetweenTargets__valueForSharedClassBetweenTargets], 64 | method_getImplementation(class_getInstanceMethod(metaclass, @selector(_AtAspect_TargetTestFromTest_OfClass_SharedClassBetweenTargets__valueForSharedClassBetweenTargets)))); 65 | NSLog(@"Test value (product aspect selector): %ld <%p>", 66 | [SharedClassBetweenTargets _AtAspect_TargetTestFromProduct_OfClass_SharedClassBetweenTargets__valueForSharedClassBetweenTargets], 67 | method_getImplementation(class_getInstanceMethod(metaclass, @selector(_AtAspect_TargetTestFromProduct_OfClass_SharedClassBetweenTargets__valueForSharedClassBetweenTargets)))); 68 | 69 | XCTAssertEqual([SharedClassBetweenTargets valueForSharedClassBetweenTargets], 123); 70 | XCTAssertEqual([SharedClassBetweenTargets _AtAspect_TargetTestFromTest_OfClass_SharedClassBetweenTargets__valueForSharedClassBetweenTargets], 100); 71 | XCTAssertEqual([SharedClassBetweenTargets _AtAspect_TargetTestFromProduct_OfClass_SharedClassBetweenTargets__valueForSharedClassBetweenTargets], 103); 72 | } 73 | 74 | 75 | @end 76 | #undef AtAspectOfClass 77 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDevTests/ObjCRuntimeTest.m: -------------------------------------------------------------------------------- 1 | // 2 | // ObjCRuntimeTest.m 3 | // XAspectDev 4 | // 5 | // Created by Xaree on 11/29/14. 6 | // Copyright (c) 2015 Xaree Lee. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | #import "FunctionForTesting.h" 13 | 14 | #import "Tier1.h" 15 | #import "Tier2.h" 16 | #import "Tier3.h" 17 | #import "Tier4.h" 18 | #import "Tier5.h" 19 | 20 | 21 | @protocol XAspectImplementationType 22 | @optional 23 | + (NSInteger)implementation_1; // We don't implement this method. 24 | + (NSInteger)implementation_2; // We implement this method only in Tier 1. 25 | + (NSInteger)implementation_3; // We implement this method only in Tier 2. 26 | + (NSInteger)implementation_4; // We implement this method in both Tier 1 and Tier 2. 27 | @end 28 | 29 | @interface Tier1 (ObjCRuntimeTest) 30 | @end 31 | @implementation Tier1 (ObjCRuntimeTest) 32 | + (NSInteger)implementation_2{ return 2; } 33 | + (NSInteger)implementation_4{ return 4; } 34 | @end 35 | @implementation Tier2 (ObjCRuntimeTest) 36 | + (NSInteger)implementation_3{ return 30; } 37 | + (NSInteger)implementation_4{ return [super implementation_4] + 40; } 38 | @end 39 | 40 | 41 | @interface ObjCRuntimeTest : XCTestCase 42 | 43 | @end 44 | 45 | @implementation ObjCRuntimeTest 46 | 47 | - (void)setUp { 48 | [super setUp]; 49 | // Put setup code here. This method is called before the invocation of each test method in the class. 50 | } 51 | 52 | - (void)tearDown { 53 | // Put teardown code here. This method is called after the invocation of each test method in the class. 54 | [super tearDown]; 55 | } 56 | 57 | - (void)testImplementationType 58 | { 59 | // We test `originImplementationType()` function here. 60 | Class metaclassOfTier2 = objc_getMetaClass("Tier2"); 61 | XCTAssertEqual(originImplementationType(metaclassOfTier2, @selector(implementation_1)), 62 | XAOriginImpTypeNotExists); 63 | 64 | XCTAssertEqual(originImplementationType(metaclassOfTier2, @selector(implementation_2)), 65 | XAOriginImpTypeExistsInSuperclass); 66 | 67 | XCTAssertEqual(originImplementationType(metaclassOfTier2, @selector(implementation_3)), 68 | XAOriginImpTypeExists); 69 | 70 | XCTAssertEqual(originImplementationType(metaclassOfTier2, @selector(implementation_3)), 71 | XAOriginImpTypeExists); 72 | } 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDevTests/SafeCategoryTest.m: -------------------------------------------------------------------------------- 1 | // 2 | // SafeCategoryTest.m 3 | // XAspectDev 4 | // 5 | // Created by Xaree on 11/28/14. 6 | // Copyright (c) 2015 Xaree Lee. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | #import 13 | #import "FunctionForTesting.h" 14 | 15 | #import "Tier1.h" 16 | #import "Tier2.h" 17 | #import "Tier3.h" 18 | #import "Tier4.h" 19 | #import "Tier5.h" 20 | 21 | 22 | #define AtAspect SafeCategoryTest 23 | 24 | @interface Tier1 (SafeCategoryTest) 25 | + (NSInteger)testSafeCategoryInjection; 26 | @end 27 | 28 | #define AtAspectOfClass Tier1 29 | @classPatchField(Tier1) 30 | + (NSInteger)testSafeCategoryInjection{ 31 | return 9527; 32 | } 33 | @end 34 | 35 | 36 | @interface SafeCategoryTest : XCTestCase 37 | 38 | @end 39 | 40 | @implementation SafeCategoryTest 41 | 42 | - (void)setUp { 43 | [super setUp]; 44 | // Put setup code here. This method is called before the invocation of each test method in the class. 45 | } 46 | 47 | - (void)tearDown { 48 | // Put teardown code here. This method is called after the invocation of each test method in the class. 49 | [super tearDown]; 50 | } 51 | 52 | - (void)testSafeCategoryInjection 53 | { 54 | XCTAssertEqual([Tier1 testSafeCategoryInjection], 9527); 55 | } 56 | 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDevTests/SimpleMacroExpansionTest.m: -------------------------------------------------------------------------------- 1 | // 2 | // SimpleMacroExpansionTest.m 3 | // XAspectDev 4 | // 5 | // Created by Xaree on 11/25/14. 6 | // Copyright (c) 2015 Xaree Lee. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | #import 13 | #import "FunctionForTesting.h" 14 | 15 | 16 | @interface SimpleMacroExpansionTest : XCTestCase 17 | 18 | @end 19 | 20 | @implementation SimpleMacroExpansionTest 21 | 22 | - (void)setUp { 23 | [super setUp]; 24 | // Put setup code here. This method is called before the invocation of each test method in the class. 25 | } 26 | 27 | - (void)tearDown { 28 | // Put teardown code here. This method is called after the invocation of each test method in the class. 29 | [super tearDown]; 30 | } 31 | 32 | 33 | // ----------------------------------------------------------------------------- 34 | #pragma mark -Aspect Keyword Test 35 | // ----------------------------------------------------------------------------- 36 | - (void)testAspectClassName 37 | { 38 | XCTAssertMacro(_XAspect_Class_For_Aspect(NSObject, TestAspect), 39 | "_AtAspect_TestAspect_OfClass_NSObject_"); 40 | } 41 | 42 | // ----------------------------------------------------------------------------- 43 | #pragma mark -Default aspect return Test 44 | // ----------------------------------------------------------------------------- 45 | - (void)testDefaultImplementationForReturnType 46 | { 47 | // Return type: id 48 | XCTAssertMacro(_XANullReturnValueImplementation(id), 49 | "{ id retVal; __builtin___memset_chk (&(retVal), 0, sizeof(id), __builtin_object_size (&(retVal), 0)); return retVal; }"); 50 | 51 | // Return type: instancetype (We should convert the type instancetype to id) 52 | XCTAssertMacro(_XANullReturnValueImplementation(instancetype), 53 | metamacro_stringify(_XANullReturnValueImplementation(id))); 54 | 55 | // Return type: structure (CGRect) 56 | XCTAssertMacro(_XANullReturnValueImplementation(CGRect), 57 | "{ CGRect retVal; __builtin___memset_chk (&(retVal), 0, sizeof(CGRect), __builtin_object_size (&(retVal), 0)); return retVal; }"); 58 | 59 | // Return type: pointer (ObjC object) 60 | XCTAssertMacro(_XANullReturnValueImplementation(NSString *), 61 | "{ NSString * retVal; __builtin___memset_chk (&(retVal), 0, sizeof(NSString *), __builtin_object_size (&(retVal), 0)); return retVal; }"); 62 | 63 | // Return type: pointer of pointer 64 | XCTAssertMacro(_XANullReturnValueImplementation(NSError **), 65 | "{ NSError ** retVal; __builtin___memset_chk (&(retVal), 0, sizeof(NSError **), __builtin_object_size (&(retVal), 0)); return retVal; }"); 66 | 67 | // Return type: void (**just return**) 68 | XCTAssertMacro(_XANullReturnValueImplementation(void), 69 | "{return;}"); 70 | } 71 | 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDevTests/Tier1.h: -------------------------------------------------------------------------------- 1 | // 2 | // Tier1.h 3 | // XAspectDev 4 | // 5 | // Created by Xaree on 9/24/14. 6 | // Copyright (c) 2015 Xaree Lee. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Tier1 : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDevTests/Tier1.m: -------------------------------------------------------------------------------- 1 | // 2 | // Tier1.m 3 | // XAspectDev 4 | // 5 | // Created by Xaree on 9/24/14. 6 | // Copyright (c) 2015 Xaree Lee. All rights reserved. 7 | // 8 | 9 | #import "Tier1.h" 10 | 11 | @implementation Tier1 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDevTests/Tier2.h: -------------------------------------------------------------------------------- 1 | // 2 | // Tier2.h 3 | // XAspectDev 4 | // 5 | // Created by Xaree on 9/24/14. 6 | // Copyright (c) 2015 Xaree Lee. All rights reserved. 7 | // 8 | 9 | #import "Tier1.h" 10 | 11 | @interface Tier2 : Tier1 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDevTests/Tier2.m: -------------------------------------------------------------------------------- 1 | // 2 | // Tier2.m 3 | // XAspectDev 4 | // 5 | // Created by Xaree on 9/24/14. 6 | // Copyright (c) 2015 Xaree Lee. All rights reserved. 7 | // 8 | 9 | #import "Tier2.h" 10 | 11 | @implementation Tier2 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDevTests/Tier3.h: -------------------------------------------------------------------------------- 1 | // 2 | // Tier3.h 3 | // XAspectDev 4 | // 5 | // Created by Xaree on 9/24/14. 6 | // Copyright (c) 2015 Xaree Lee. All rights reserved. 7 | // 8 | 9 | #import "Tier2.h" 10 | 11 | @interface Tier3 : Tier2 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDevTests/Tier3.m: -------------------------------------------------------------------------------- 1 | // 2 | // Tier3.m 3 | // XAspectDev 4 | // 5 | // Created by Xaree on 9/24/14. 6 | // Copyright (c) 2015 Xaree Lee. All rights reserved. 7 | // 8 | 9 | #import "Tier3.h" 10 | 11 | @implementation Tier3 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDevTests/Tier4.h: -------------------------------------------------------------------------------- 1 | // 2 | // Tier4.h 3 | // XAspectDev 4 | // 5 | // Created by Xaree on 9/24/14. 6 | // Copyright (c) 2015 Xaree Lee. All rights reserved. 7 | // 8 | 9 | #import "Tier3.h" 10 | 11 | @interface Tier4 : Tier3 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDevTests/Tier4.m: -------------------------------------------------------------------------------- 1 | // 2 | // Tier4.m 3 | // XAspectDev 4 | // 5 | // Created by Xaree on 9/24/14. 6 | // Copyright (c) 2015 Xaree Lee. All rights reserved. 7 | // 8 | 9 | #import "Tier4.h" 10 | 11 | @implementation Tier4 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDevTests/Tier5.h: -------------------------------------------------------------------------------- 1 | // 2 | // Tier5.h 3 | // XAspectDev 4 | // 5 | // Created by Xaree on 9/24/14. 6 | // Copyright (c) 2015 Xaree Lee. All rights reserved. 7 | // 8 | 9 | #import "Tier4.h" 10 | 11 | @interface Tier5 : Tier4 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDevTests/Tier5.m: -------------------------------------------------------------------------------- 1 | // 2 | // Tier5.m 3 | // XAspectDev 4 | // 5 | // Created by Xaree on 9/24/14. 6 | // Copyright (c) 2015 Xaree Lee. All rights reserved. 7 | // 8 | 9 | #import "Tier5.h" 10 | 11 | @implementation Tier5 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /XAspectDev/XAspectDevTests/UserDefinedMacroKeywordTest.m: -------------------------------------------------------------------------------- 1 | // 2 | // UserDefinedMacroKeywordTest.m 3 | // XAspectDev 4 | // 5 | // Created by Xaree on 12/4/14. 6 | // Copyright (c) 2015 Xaree Lee. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | 13 | 14 | // ============================================================================= 15 | #pragma mark - Prepare Materials to Test 16 | // ============================================================================= 17 | @interface XAAspectKeywordTestClass : NSObject 18 | @end 19 | @implementation XAAspectKeywordTestClass 20 | @end 21 | 22 | 23 | #undef NSAssertMacroKeywordEqual 24 | #define NSAssertMacroKeywordEqual(Keyword1, Keyword2, message, ...) // Don't make the assertion work in this test file. 25 | 26 | 27 | // ----------------------------------------------------------------------------- 28 | // Change `_isDefinedAtAspectDetected` to `YES` if `AtAspect` is defined. 29 | #undef AtAspect 30 | #define AtAspect AnyThing // Defined 31 | 32 | BOOL _isDefinedAtAspectDetected = NO; 33 | #undef _XAAspectNamespaceCheckerDefault 34 | #define _XAAspectNamespaceCheckerDefault (_isDefinedAtAspectDetected = YES) 35 | 36 | #define AtAspectOfClass XAAspectKeywordTestClass 37 | @classPatchField(XAAspectKeywordTestClass) 38 | @end 39 | // ----------------------------------------------------------------------------- 40 | // Change `isBlankAtAspectDetected` to `YES` if a 'blank' error is detected. 41 | #undef AtAspect 42 | #define AtAspect // Blank 43 | 44 | BOOL _isBlankAtAspectDetected = NO; 45 | #undef _XAAspectNamespaceChecker_aspect_ 46 | #define _XAAspectNamespaceChecker_aspect_ metamacro_evaluate_push(_isBlankAtAspectDetected = YES) 47 | 48 | #undef AtAspectOfClass 49 | #define AtAspectOfClass XAAspectKeywordTestClass 50 | @classPatchField(XAAspectKeywordTestClass) 51 | @end 52 | #undef AtAspectOfClass 53 | // ----------------------------------------------------------------------------- 54 | // Change `_isUndefinedAtAspectDetected` to `YES` if an 'undefined' error is detected. 55 | #undef AtAspect // Undefined 56 | 57 | BOOL _isUndefinedAtAspectDetected = NO; 58 | #undef _XAAspectNamespaceChecker_aspect_AtAspect 59 | #define _XAAspectNamespaceChecker_aspect_AtAspect metamacro_evaluate_push(_isUndefinedAtAspectDetected = YES) 60 | 61 | #undef AtAspectOfClass 62 | #define AtAspectOfClass XAAspectKeywordTestClass 63 | @classPatchField(XAAspectKeywordTestClass) 64 | @end 65 | #undef AtAspectOfClass 66 | // ============================================================================= 67 | // Change `_isDefinedAtAspectOfClassDetected` to `YES` if `AtAspectOfClass` is defined. 68 | #undef AtAspect 69 | #define AtAspect DetectAtAspectOfClassKeywordTest 70 | #undef AtAspectOfClass 71 | #undef _XAAspectOfClassNamespaceCheckerDefault 72 | BOOL _isDefinedAtAspectOfClassDetected = NO; 73 | #define _XAAspectOfClassNamespaceCheckerDefault (_isDefinedAtAspectOfClassDetected = YES) 74 | 75 | #define AtAspectOfClass XAAspectKeywordTestClass // Defined 76 | @classPatchField(XAAspectKeywordTestClass) 77 | @end 78 | // ----------------------------------------------------------------------------- 79 | // Change `_isBlankAtAspectOfClassDetected` to `YES` if a 'blank' error is detected. 80 | #undef AtAspect 81 | #define AtAspect UndefinedAtAspectOfClassKeywordTest 82 | 83 | BOOL _isBlankAtAspectOfClassDetected = NO; 84 | #undef _XAAspectOfClassNamespaceChecker_patch_ 85 | #define _XAAspectOfClassNamespaceChecker_patch_ metamacro_evaluate_push(_isBlankAtAspectOfClassDetected = YES) 86 | 87 | #undef AtAspectOfClass 88 | #define AtAspectOfClass // Blank 89 | @classPatchField(XAAspectKeywordTestClass) 90 | @end 91 | // ----------------------------------------------------------------------------- 92 | // Change `_isUndefinedAtAspectOfClassDetected` to `YES` if an 'undefined' error is detected. 93 | #undef AtAspect 94 | #define AtAspect BlankAtAspectOfClassKeywordTest 95 | 96 | BOOL _isUndefinedAtAspectOfClassDetected = NO; 97 | #undef _XAAspectOfClassNamespaceChecker_patch_AtAspectOfClass 98 | #define _XAAspectOfClassNamespaceChecker_patch_AtAspectOfClass metamacro_evaluate_push(_isUndefinedAtAspectOfClassDetected = YES) 99 | 100 | #undef AtAspectOfClass // Undefined 101 | @classPatchField(XAAspectKeywordTestClass) 102 | @end 103 | // ----------------------------------------------------------------------------- 104 | 105 | 106 | // ============================================================================= 107 | #pragma mark - Test Case 108 | // ============================================================================= 109 | 110 | @interface UserDefinedMacroKeywordTest : XCTestCase 111 | 112 | @end 113 | 114 | @implementation UserDefinedMacroKeywordTest 115 | 116 | - (void)setUp { 117 | [super setUp]; 118 | // Put setup code here. This method is called before the invocation of each test method in the class. 119 | } 120 | 121 | - (void)tearDown { 122 | // Put teardown code here. This method is called after the invocation of each test method in the class. 123 | [super tearDown]; 124 | } 125 | 126 | - (void)testIsDefinedAtAspectDetected { 127 | XCTAssert(_isDefinedAtAspectDetected, 128 | "The `@classPatchField()` should detect the defined `AtAspect`."); 129 | } 130 | 131 | - (void)testIsBlankAtAspectDetected { 132 | XCTAssert(_isBlankAtAspectDetected, 133 | "The `@classPatchField()` should detect the blank `AtAspect`."); 134 | } 135 | 136 | - (void)testIsUndefinedAtAspectDetected { 137 | XCTAssert(_isUndefinedAtAspectDetected, 138 | "The `@classPatchField()` should detect the undefined `AtAspect`."); 139 | } 140 | 141 | - (void)testIsDefinedAtAspectOfClassDetected { 142 | XCTAssert(_isDefinedAtAspectOfClassDetected, 143 | "The `@classPatchField()` should detect the defined `AtAspectOfClass`."); 144 | } 145 | 146 | - (void)testIsBlankAtAspectOfClassDetected { 147 | XCTAssert(_isBlankAtAspectOfClassDetected, 148 | "The `@classPatchField()` should detect the blank `AtAspectOfClass`."); 149 | } 150 | 151 | - (void)testIsUndefinedAtAspectOfClassDetected { 152 | XCTAssert(_isUndefinedAtAspectOfClassDetected, 153 | "The `@classPatchField()` should detect the undefined `AtAspectOfClass`."); 154 | } 155 | 156 | 157 | 158 | @end 159 | --------------------------------------------------------------------------------