Skip to content

Commit d9d8ac3

Browse files
committed
update readme for warning inhibition tool
1 parent a07c686 commit d9d8ac3

File tree

1 file changed

+34
-8
lines changed

1 file changed

+34
-8
lines changed

README.md

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# cocoapods-developing-folder
22

3-
A cocoapods plugin that:
4-
- preserves the folder structure in `development pods`
5-
- provides a new keyword `folder` to import all local pods in a specific folder and its subfolders
3+
A cocoapods plugin provide a branch of tools for who heavily use development pods in project:
4+
5+
- Availability to preserves the folder structure in `development pods`
6+
- Provides a new keyword `folder` to import all local pods in a specific folder and its subfolders
7+
- Function to inhibit warnings for specific pods with a block.
68

79

810
## Installation
@@ -11,7 +13,7 @@ A cocoapods plugin that:
1113

1214
## Usage
1315

14-
#### preserves the folder structure
16+
#### 🔸 Preserves the folder structure
1517

1618
Add the following to your podfile
1719

@@ -25,7 +27,7 @@ If you don't want to create groups for top level folders (Local pods are usually
2527
use_folders :skip_top_level_group => ["modules"]
2628
```
2729

28-
#### import all local pods in specific folder
30+
#### 🔸 Import all local pods in specific folder
2931

3032
Use `folder` just like `pod` keyword. (In fact, they are just ruby functions)
3133

@@ -43,12 +45,36 @@ end
4345
It will import all local pods in that folder and its subfolders recrusively, equivalent of:
4446

4547
```
46-
pod "AAA", :path => "modules/AAA"
47-
pod "BBB", :path => "modules/BBB"
48-
pod "CCC", :path => "modules/some/path/to/CCC"
48+
pod "Ayanami", :path => "modules/Ayanami"
49+
pod "Asuka", :path => "modules/Asuka"
50+
pod "Shinji", :path => "modules/some/path/to/Shinji"
4951
#...
5052
```
5153

54+
#### 🔸 Inhibit warnings for specific pods
55+
56+
Add the following to your podfile
57+
58+
```ruby
59+
plugin 'cocoapods-developing-folder'
60+
61+
inhibit_warnings_with_condition do |pod_name, pod_target|
62+
# your condition written in ruby, like:
63+
# `not pod_name.start_with? "LE"` or
64+
# `['Asuka', 'Ayanami', 'Shinji'].include? pod_name`
65+
end
66+
```
67+
`pod_target` is a instance of `Pod::PodTarget` [class](https://github.com/CocoaPods/CocoaPods/blob/93011ece10dd76b8d783bc80db742dfd03f7cbac/lib/cocoapods/target/pod_target.rb), containing many more info than the name. You can use it to set up complex rules.
68+
69+
This function will override the warning inhibition settings by the original methods, like: `inhibit_all_warnings!`, `pod 'Ayanami', :inhibit_warnings => true`
70+
71+
This function is usually used for disabling warning inhibition for development pods and enabling for the others. When you try to implement this with offical methods, cocoapods may warn you at `pod install`:
72+
73+
> The pod #{pod_name} is linked to different targets which contain different settings to inhibit warnings. CocoaPods does not currently support different settings and will fall back to your preference set in the root target definition.
74+
75+
This function solve the problem.
76+
77+
5278
# License
5379

5480
MIT

0 commit comments

Comments
 (0)