|
1 |
| - |
| 1 | + |
2 | 2 |
|
3 | 3 | [](https://circleci.com/gh/intercom/cocoapods-mangle)
|
4 | 4 |
|
@@ -79,6 +79,14 @@ MANGLED_SPECS_CHECKSUM = 18f61e6e6172fb87ddc7341f3537f30f8c7a3edc
|
79 | 79 |
|
80 | 80 | This is included in `GCC_PREPROCESSOR_DEFINITIONS` of the `xcconfig` file for every target. All of these symbols will be mangled on subsequent builds.
|
81 | 81 |
|
| 82 | +The symbols that will be mangled are: |
| 83 | + |
| 84 | +- Objective C classes. e.g. `AFNetworkReachabilityManager` becomes `MyFramework_AFNetworkReachabilityManager`. |
| 85 | +- C and Objective C constants. `AFNetworkingReachabilityDidChangeNotification` becomes `MyFramework_AFNetworkingReachabilityDidChangeNotification`. |
| 86 | +- Objective C category selectors. The first component of the selector is mangled. e.g. `-[NSString xxx_abc:def]` becomes `-[NSString MyFramework_xxx_abc:def]`. |
| 87 | + |
| 88 | +The plugin has only been fully tested with Objective C dependencies. There is no reason why this could not also work for Swift. |
| 89 | + |
82 | 90 | ## Usage
|
83 | 91 |
|
84 | 92 | cocoapods-mangle can be used by adding it to your `Podfile` like this:
|
@@ -108,6 +116,11 @@ plugin 'cocoapods-mangle', targets: ['MyTarget'],
|
108 | 116 | ## Caveats
|
109 | 117 |
|
110 | 118 | - cocoapods-mangle will only work for source dependencies. Pre-compiled frameworks cannot be mangled.
|
111 |
| -- `pod install` will be slower when you change a dependency, particularly if your app/SDK depends on many pods. |
112 | 119 | - Currently only supports iOS. It should be very straightforward to extend support to macOS, tvOS or watchOS.
|
113 |
| -- Category mangling may fail if the dependency does not correctly prefix its category selectors (see http://nshipster.com/namespacing/#method-prefixes). |
| 120 | +- Category mangling may cause issues if the dependency does not correctly prefix its category selectors (see http://nshipster.com/namespacing/#method-prefixes). |
| 121 | + |
| 122 | +## Related links |
| 123 | + |
| 124 | +- [CocoaPods Packager](https://github.com/cocoapods/cocoapods-packager) has similar mangling functionality for packaging `.podspec` files. |
| 125 | +- http://blog.sigmapoint.pl/avoiding-dependency-collisions-in-ios-static-library-managed-by-cocoapods/ |
| 126 | +- http://pdx.esri.com/blog/namespacing-dependencies/ |
0 commit comments