fastlane-plugin-itargetchecker 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 361ae55562520ed9382bb3e157fd687b5835cba5540ab9a42f4e0be322e112a7
4
- data.tar.gz: ff20c6932179d4a0b1f397a849f60370f11fdb9df7bae16807917a3389f021d3
3
+ metadata.gz: 79be675d00586c3d8251ea14ea36a3c5a34093d5dd4b374ba0c2d295f792b37f
4
+ data.tar.gz: 63be800d35f1fb08839bc914eb9f871ca396b2cb4ab12b402519a6dd6ef6f2b8
5
5
  SHA512:
6
- metadata.gz: 7d7db6418fe33be8bb6c5780f524d7b94a24d923c708300471d118786123848d5fa775dd0572c9e7f449e70208432fe8b88b38a0c7e4e3f9f48390eb410141ec
7
- data.tar.gz: 24f18915380277b12828935b1c10f928b7716d97c77ff04b21e177476532755bf83c3db0cae49ea1a67d17e629d5dfbe174b71fbb8d422b18a4f2a2495ed2033
6
+ metadata.gz: f8027b28cf4baff207976202c6b407378d2f34134c99a1e7a6dfcd0e78989a3c2004e2b251ce11cbb314173e1364bc060331c901367945dfd168a4a732b7220a
7
+ data.tar.gz: d09547f2f5b96b7a4de478bf0214874c84d2b147c1b78a1bc2591f0dfe9c4a6041bd2245d367882a3fab97836fb390d6541c4add55cf9c432efcd9c806a0d813
data/README.md CHANGED
@@ -34,10 +34,9 @@ You can now use regex in the ignored files strings passed to the plugin. That ca
34
34
  **Quick ussage sample:**
35
35
 
36
36
  ```ruby
37
- itargetchecker(project_path:"../YourProj.xcodeproj",
38
- ignore_files:["SwiftyJSON.framework", "CoreLocation.framework", "Pods-YourProjRelease.release.xcconfig",
39
- "Pods-YourProjRelease.debug.xcconfig", "Pods-YourProj.release.xcconfig", "Pods-YourProj.debug.xcconfig", "Info.plist", "Base", "BRASL.h"],
40
- ignore_targets:["YourProjTests"])
37
+ itargetchecker(project_path:"../your_project.xcodeproj",
38
+ ignore_files:["\w*\.framework\b*", "\w*\.xcconfig\b*", "\w*\.h\b*", "Info.plist"],
39
+ ignore_targets:["your_projectTests"])
41
40
  ```
42
41
 
43
42
  ## Run tests for this plugin (to be continued..)
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'fastlane/plugin/itargetchecker/actions/itargetchecker'
4
+
5
+ # Requests 3 parameters, 1 xcodeproj file path, 2 ignored files (if more than 1, split by #), 3 ignored targets (if more than 1, split by #)
6
+
7
+ ignoreFiles = ""
8
+ ignoreTargets = ""
9
+
10
+ if ARGV[1]
11
+ ignoreFiles = ARGV[1].split("#")
12
+ end
13
+
14
+ if ARGV[2]
15
+ ignoreTargets = ARGV[2].split("#")
16
+ end
17
+
18
+ puts ITargetChecker.checkTarget(project_path:ARGV[0],
19
+ ignore_files:ignoreFiles,
20
+ ignore_targets:ignoreTargets)
21
+
22
+
23
+
@@ -0,0 +1,60 @@
1
+ require 'xcodeproj'
2
+
3
+ class ITargetChecker
4
+ def self.checkTarget(params)
5
+
6
+ project = Xcodeproj::Project.open(params[:project_path])
7
+
8
+ lostFiles = Array.new
9
+ ignoredFiles = params[:ignore_files]
10
+
11
+ # loop through all the project files
12
+ project.files.each do |file|
13
+
14
+ faultyFile = file.name == nil || file.name == ""
15
+ if ignoredFiles
16
+ ignoredFiles.each do |ignoredItem|
17
+ faultyFile = faultyFile || file.name.match(ignoredItem)
18
+ if faultyFile
19
+ next
20
+ end
21
+ end
22
+ end
23
+
24
+ if faultyFile
25
+ next
26
+ end
27
+
28
+ project.targets.each do |target|
29
+
30
+ found = false
31
+
32
+ if params[:ignore_targets]
33
+ if (params[:ignore_targets].include? target.name)
34
+ next
35
+ end
36
+ end
37
+
38
+ target.build_phases.each do |buildPhase|
39
+
40
+ correctTypes = buildPhase.isa == "PBXSourcesBuildPhase" || buildPhase.isa == "PBXResourcesBuildPhase"
41
+ if correctTypes
42
+ # get all files of a target
43
+ buildPhase.files.each do |targetFile|
44
+ if targetFile.display_name == file.name
45
+ found = true
46
+ break
47
+ end
48
+ end
49
+ end
50
+ end
51
+
52
+ if found == false
53
+ lostFiles.push("file: #{file.name} target: #{target}")
54
+ end
55
+ end
56
+ end
57
+
58
+ lostFiles
59
+ end
60
+ end
@@ -1,5 +1,6 @@
1
1
  require 'fastlane/action'
2
2
  require 'xcodeproj'
3
+ require_relative 'itargetchecker'
3
4
  require_relative '../helper/itargetchecker_helper'
4
5
 
5
6
  module Fastlane
@@ -7,69 +8,15 @@ module Fastlane
7
8
  class ItargetcheckerAction < Action
8
9
  def self.run(params)
9
10
 
10
- project = Xcodeproj::Project.open(params[:project_path])
11
-
12
- lostFiles = Array.new
13
- ignoredFiles = params[:ignore_files]
14
-
15
- # loop through all the project files
16
- project.files.each do |file|
17
-
18
- faultyFile = file.name == nil || file.name == ""
19
- if ignoredFiles
20
- ignoredFiles.each do |ignoredItem|
21
- faultyFile = faultyFile || file.name.match(ignoredItem)
22
- if faultyFile
23
- next
24
- end
25
- end
26
- end
27
-
28
- if faultyFile
29
- next
30
- end
31
-
32
- project.targets.each do |target|
33
-
34
- found = false
35
-
36
- if params[:ignore_targets]
37
- if (params[:ignore_targets].include? target.name)
38
- next
39
- end
40
- end
41
-
42
- target.build_phases.each do |buildPhase|
43
-
44
- correctTypes = buildPhase.isa == "PBXSourcesBuildPhase" || buildPhase.isa == "PBXResourcesBuildPhase"
45
- if correctTypes
46
- # get all files of a target
47
- buildPhase.files.each do |targetFile|
48
- if targetFile.display_name == file.name
49
- found = true
50
- break
51
- end
52
- end
53
-
54
- end
55
- end
56
-
57
- if found == false
58
- UI.error "\n Can't find file: #{file.name} in target: #{target}"
59
- lostFiles.push("file: #{file.name} target: #{target}")
60
- end
61
-
62
- end
63
-
64
- end
65
-
66
- if lostFiles.length > 0
11
+ output = ITargetChecker.checkTarget(project_path:params[:project_path], ignore_files:params[:ignore_files], ignore_targets:params[:ignore_targets])
12
+ if output.length > 0
13
+ UI.error output
67
14
  UI.error "Lost files found!"
68
15
  else
69
16
  UI.success "✅ Yupee! ✨ No lost files found! ✨"
70
17
  end
71
18
 
72
- lostFiles
19
+ output
73
20
  end
74
21
 
75
22
  def self.description
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Itargetchecker
3
- VERSION = "0.2.0"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-itargetchecker
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
  - Catalin Prata
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-12 00:00:00.000000000 Z
11
+ date: 2018-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xcodeproj
@@ -152,13 +152,16 @@ dependencies:
152
152
  version: 2.94.0
153
153
  description:
154
154
  email: catalin.prata@fortech.ro
155
- executables: []
155
+ executables:
156
+ - itargetchecker
156
157
  extensions: []
157
158
  extra_rdoc_files: []
158
159
  files:
159
160
  - LICENSE
160
161
  - README.md
162
+ - bin/itargetchecker
161
163
  - lib/fastlane/plugin/itargetchecker.rb
164
+ - lib/fastlane/plugin/itargetchecker/actions/itargetchecker.rb
162
165
  - lib/fastlane/plugin/itargetchecker/actions/itargetchecker_action.rb
163
166
  - lib/fastlane/plugin/itargetchecker/helper/itargetchecker_helper.rb
164
167
  - lib/fastlane/plugin/itargetchecker/version.rb