xcodeprojfiler 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ce25545584fc5478850efb0bf6aacfaa3b00e13ab9253b29e1e6ca09d1197111
4
- data.tar.gz: 3d4c9c0f2860e69e7d74cd84611144a7d060cad9673db93a80eb8fa249399a55
3
+ metadata.gz: 8d9aa4582c4898878c2520753e684851fecacc4639e075ea98d470ce580ca31a
4
+ data.tar.gz: c738d05ef9b78ff699a8e5cd6107a7a00a0936e77c22851fc1bfc45cbccf36bb
5
5
  SHA512:
6
- metadata.gz: 017e15f0998db65d44d5a0915c8f47cf9322bb18f740469211712e484231d98d98263b1f026b1d0f0934eaef56cd168bcc238c84574a2eff313908201fe7752a
7
- data.tar.gz: 5c85e430d897ac2d62f8f4cb2ddcc8ef75515781b316d720eda1887cbe131c5e9a3e8c696496437bc511797327be015df6f363365e4d865ef0cbe475e4a0b283
6
+ metadata.gz: c755f6f2dc5ebb34f493a6a2183e9c8103d827e298a8820b78006c19d2a22cd71a6ec54a2d1715153a7d7d734aada9230fafd87bcc183f2f23406820d15ecc9e
7
+ data.tar.gz: af8bb84e862035c3e7ff137958737f2c93675a863cd2d081aebf4b26963a58611bf363bbb3cc9eee309d0462669c02e1a37172db21352de64d3562acb04501a1
@@ -1,3 +1,17 @@
1
+ ## 0.3.0
2
+
3
+ - support to show and delete the library type(`.framework`/`.a`) and bundle type(`.bundle`) files which are not included in xcworkspace
4
+
5
+
6
+
7
+ ## 0.2.0
8
+
9
+ - support to show and delete the files which are not included in xcworkspace
10
+
11
+ - support to tell xcodeprojfiler to ignore the files which you want with customized regex
12
+
13
+
14
+
1
15
  ## 0.1.0
2
16
 
3
17
  - support to show the files which are not included in xcworkspace
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- xcodeprojfiler (0.2.0)
4
+ xcodeprojfiler (0.3.0)
5
5
  bundler (~> 2.0, >= 2.0.2)
6
6
  thor (~> 1.0, >= 1.0.1)
7
7
  xcodeproj (~> 1.0, >= 1.9.0)
data/README.md CHANGED
@@ -5,7 +5,7 @@ Xcodeprojfiler is a CLI tooL which can help iOS developer to get the info of fil
5
5
  For example, Xcodeprojfiler can scan the current xcode project dir and find out the files which are not included in xcworkspace.
6
6
 
7
7
 
8
- ## Installation
8
+ ## Install & Update
9
9
 
10
10
  ```shell
11
11
  sudo gem install xcodeprojfiler
@@ -1,5 +1,6 @@
1
1
  require 'xcodeproj'
2
2
  require 'yaml'
3
+ require 'xcodeprojfiler/string_extensions'
3
4
 
4
5
  module Xcodeprojfiler
5
6
 
@@ -9,6 +10,31 @@ module Xcodeprojfiler
9
10
  puts(version_desc)
10
11
  end
11
12
 
13
+ def self.show_common_tips_before_scan
14
+ puts("")
15
+ puts("PS: If the xcode project is very large, Xcodeprojfiler needs more than 5min to scan")
16
+ puts("")
17
+ ignore_file_tips = <<-MESSAGE
18
+ PS: Xcodeprojfiler do ignore the following files:
19
+
20
+ - fastlane/*
21
+ - Pods/*
22
+ - Podfile
23
+ - Gemfile
24
+ - .git/*
25
+ - *.xctemplate
26
+ - *.lock
27
+ - *.py
28
+ - *.rb
29
+ - *.sh
30
+ - *.log
31
+ - *.config
32
+ - *.properties
33
+
34
+ MESSAGE
35
+ puts("#{ignore_file_tips}")
36
+ end
37
+
12
38
  # find_xclued_files -> xcluded_file_result_tuple
13
39
  #
14
40
  # 扫描当前目录,返回包含和不包含在xcworkspace的文件数组
@@ -27,13 +53,13 @@ module Xcodeprojfiler
27
53
  # xcworkspace_file = "/Users/yorkfish/Workspace/Demo-Projects/TestGitFilter-OC/TestGitFilter-OC.xcworkspace"
28
54
 
29
55
  if xcworkspace_file == nil
30
- puts("Xcodeprojfiler Error: not exited xcworkspace file: #{xcworkspace_file}")
56
+ puts("")
57
+ puts("[!] No xcworkspace file found in the current working directory".red)
31
58
  return [included_file_array, excluded_file_array]
32
59
  end
33
60
 
34
- puts("scan the current directory now ...")
35
61
  puts("")
36
- puts("PS: if the xcode project is very larger, Xcodeprojfiler needs more than 10min to scan")
62
+ puts("scan the current working directory now ...")
37
63
 
38
64
  xcworkspace = Xcodeproj::Workspace.new_from_xcworkspace(xcworkspace_file)
39
65
  xcworkspace_file_references = xcworkspace.file_references
@@ -51,30 +77,6 @@ module Xcodeprojfiler
51
77
  end
52
78
  end
53
79
 
54
- puts("")
55
- ignore_file_tips = <<-MESSAGE
56
- PS: Xcodeprojfiler will ignore the following files:
57
-
58
- - fastlane/*
59
- - Pods/*
60
- - Podfile
61
- - Gemfile
62
- - .git/*
63
- - *.xcassets
64
- - *.xctemplate
65
- - *.framework
66
- - *.bundle
67
- - *.lock
68
- - *.py
69
- - *.rb
70
- - *.sh
71
- - *.log
72
- - *.config
73
- - *.properties
74
-
75
- MESSAGE
76
- puts("#{ignore_file_tips}")
77
-
78
80
  all_files = Dir.glob(["#{root_dir}/**/*.*"])
79
81
  excluded_file_regex_array = [
80
82
  "#{root_dir}/**/*.xcodeproj/**/*",
@@ -88,7 +90,7 @@ PS: Xcodeprojfiler will ignore the following files:
88
90
  "#{root_dir}/**/Pods/**/*",
89
91
  "#{root_dir}/**/Podfile",
90
92
  "#{root_dir}/**/Gemfile",
91
- "#{root_dir}/**/*{.xcworkspace,.xcodeproj,.lproj,.xcassets,.xctemplate,.framework,.bundle,.lock,.rb,.py,.sh,.log,.config,.properties}"
93
+ "#{root_dir}/**/*{.git,.xcworkspace,.xcodeproj,.lproj,.xctemplate,.lock,.rb,.py,.sh,.log,.config,.properties}"
92
94
  ]
93
95
  all_files = all_files - Dir.glob(excluded_file_regex_array)
94
96
  if ignored_regex_array.empty? == false
@@ -100,7 +102,7 @@ PS: Xcodeprojfiler will ignore the following files:
100
102
  excluded_file_array = all_files - included_file_array
101
103
 
102
104
  puts("")
103
- puts("scan the current directory done !!!")
105
+ puts("scan the current working directory done !!!")
104
106
 
105
107
  return [included_file_array, excluded_file_array]
106
108
  end
@@ -139,13 +141,15 @@ PS: Xcodeprojfiler will ignore the following files:
139
141
  end
140
142
 
141
143
  def self.show_excluded_files(shouldDelete, ignored_regex_array)
144
+ self.show_common_tips_before_scan
142
145
  xcluded_file_result_tuple = self.find_xclued_files(ignored_regex_array)
143
146
  excluded_file_array = xcluded_file_result_tuple[1]
144
147
 
145
148
  if shouldDelete
146
149
  puts("")
147
150
  puts("delete the excluded files now ...")
148
- FileUtils.rm_f(excluded_file_array)
151
+ FileUtils.rm_rf(excluded_file_array)
152
+ puts("")
149
153
  puts("delete the excluded files done !!!")
150
154
  end
151
155
 
@@ -153,8 +157,7 @@ PS: Xcodeprojfiler will ignore the following files:
153
157
  end
154
158
 
155
159
  def self.show_excluded_code_files(shouldDelete, ignored_regex_array)
156
- xcluded_file_result_tuple = self.find_xclued_files(ignored_regex_array)
157
- excluded_file_array = xcluded_file_result_tuple[1]
160
+ self.show_common_tips_before_scan
158
161
 
159
162
  code_file_types = [
160
163
  ".h",
@@ -163,10 +166,21 @@ PS: Xcodeprojfiler will ignore the following files:
163
166
  ".m",
164
167
  ".mm",
165
168
  ".swift",
169
+ ".a",
170
+ ".framework",
166
171
  ".xib",
167
- ".storyboard"
172
+ ".storyboard",
168
173
  ]
169
174
 
175
+ puts("")
176
+ puts("PS: Xcodeprojfiler will show and delete(if you choose) the following code files:")
177
+ puts("")
178
+ code_file_types.each do |code_file_type|
179
+ puts(" - *#{code_file_type}")
180
+ end
181
+
182
+ xcluded_file_result_tuple = self.find_xclued_files(ignored_regex_array)
183
+ excluded_file_array = xcluded_file_result_tuple[1]
170
184
  excluded_code_file_array = excluded_file_array.select do |file|
171
185
  file_extname = File.extname(file)
172
186
  if code_file_types.include?(file_extname)
@@ -177,7 +191,8 @@ PS: Xcodeprojfiler will ignore the following files:
177
191
  if shouldDelete
178
192
  puts("")
179
193
  puts("delete the excluded files now ...")
180
- FileUtils.rm_f(excluded_code_file_array)
194
+ FileUtils.rm_rf(excluded_code_file_array)
195
+ puts("")
181
196
  puts("delete the excluded files done !!!")
182
197
  end
183
198
 
@@ -1,3 +1,3 @@
1
1
  module Xcodeprojfiler
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcodeprojfiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - York
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-10 00:00:00.000000000 Z
11
+ date: 2020-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler