Skip to content

Commit 9c9f298

Browse files
committed
add feature to skip top level group
1 parent 3467888 commit 9c9f298

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

lib/cocoapods-developing-folder/command/folder.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@
22

33
module Pod
44
class Podfile
5-
def use_folders
5+
def use_folders(*skipped_top_level_folder_names)
66
require 'cocoapods-developing-folder/command/preserve_folder.rb'
7+
names_to_skip = []
8+
first = skipped_top_level_folder_names.first
9+
if first.is_a? Hash
10+
names_to_skip = first[:skip_top_level_group]
11+
end
12+
Pod.set_skipped_top_level_folder_names (names_to_skip or [])
713
end
814
end
915
end

lib/cocoapods-developing-folder/command/preserve_folder.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,17 @@ def setIsPodGroup(isRealPod)
1616
end
1717

1818

19+
module Pod
20+
def self.skipped_top_level_folder_names
21+
@skipped_top_level_folder_names
22+
end
23+
def self.set_skipped_top_level_folder_names(names)
24+
@skipped_top_level_folder_names = names
25+
end
26+
end
27+
28+
29+
1930
require 'pathname'
2031

2132
module Pod
@@ -51,6 +62,9 @@ def getGroup(pathArray, rootGroup)
5162
if parentPath == "."
5263
pathArray = []
5364
end
65+
if pathArray.first != nil and Pod.skipped_top_level_folder_names.include? pathArray.first
66+
pathArray = pathArray.drop(1)
67+
end
5468

5569
getGroup(pathArray, development_pods)
5670
end

0 commit comments

Comments
 (0)