objc-dependency-tree-generator 0.0.7 → 0.0.8
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 +4 -4
- data/lib/objc_dependency_tree_generator.rb +11 -11
- data/lib/objc_dependency_tree_generator_helper.rb +17 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f25d0837a55076f1417a75d31b2518d3fab24de
|
4
|
+
data.tar.gz: 281ce782fe39c47f2ed422e16e67dff1041213af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 279e924ec194e80d52ac6e9f0e2d1b806e698b2ac0813d38d621df435f31d865e53cf1c04a557f3184479b44e5e2a859d0a66ee6cf25e02553ab58adf9654471
|
7
|
+
data.tar.gz: 7e076f230ea879f53bf6003841723ed9a49c84554d151c5616ee420cad0e692c3165a2ef8bdbca7567113d8324e87e053fd1736f4852412691cfb2e62bf131d5
|
@@ -13,7 +13,7 @@ class ObjCDependencyTreeGenerator
|
|
13
13
|
@options[:derived_data_project_pattern] = '*-*' unless @options[:derived_data_project_pattern]
|
14
14
|
|
15
15
|
@exclusion_prefixes = @options[:exclusion_prefixes] ? @options[:exclusion_prefixes] : 'NS|UI|CA|CG|CI|CF'
|
16
|
-
@
|
16
|
+
@object_files_directories = @options[:search_directories]
|
17
17
|
end
|
18
18
|
|
19
19
|
def self.parse_command_line_options
|
@@ -28,7 +28,7 @@ class ObjCDependencyTreeGenerator
|
|
28
28
|
parser = OptionParser.new do |o|
|
29
29
|
o.separator 'General options:'
|
30
30
|
o.on('-p PATH', '--path' ,'Path to directory where are your .o files were placed by the compiler', Array) { |directory|
|
31
|
-
options[:
|
31
|
+
options[:search_directories] = Array(options[:search_directories]) | Array(directory)
|
32
32
|
}
|
33
33
|
o.on('-D DERIVED_DATA', 'Path to directory where DerivedData is') { |derived_data|
|
34
34
|
options[:derived_data_paths] = [derived_data]
|
@@ -37,8 +37,8 @@ class ObjCDependencyTreeGenerator
|
|
37
37
|
o.on('-s PROJECT_NAME', 'Search project .o files by specified project name') { |project_name|
|
38
38
|
options[:project_name] = project_name
|
39
39
|
}
|
40
|
-
o.on('-t TARGET_NAME', 'Target of project') { |target_name|
|
41
|
-
options[:
|
40
|
+
o.on('-t TARGET_NAME', '--target' 'Target of project', Array) { |target_name|
|
41
|
+
options[:target_names] = Array(options[:target_names]) | Array(target_name)
|
42
42
|
}
|
43
43
|
o.on('-e PREFIXES', "Prefixes of classes those will be exсluded from visualization. \n\t\t\t\t\tNS|UI\n\t\t\t\t\tUI|CA|MF") { |exclusion_prefixes|
|
44
44
|
options[:exclusion_prefixes] = exclusion_prefixes
|
@@ -69,16 +69,16 @@ class ObjCDependencyTreeGenerator
|
|
69
69
|
return {}
|
70
70
|
end
|
71
71
|
|
72
|
-
unless @
|
73
|
-
@
|
72
|
+
unless @object_files_directories
|
73
|
+
@object_files_directories =
|
74
74
|
find_project_output_directory(@options[:derived_data_paths],
|
75
75
|
@options[:project_name],
|
76
76
|
@options[:derived_data_project_pattern],
|
77
|
-
@options[:
|
78
|
-
return {} unless @
|
77
|
+
@options[:target_names])
|
78
|
+
return {} unless @object_files_directories
|
79
79
|
end
|
80
80
|
|
81
|
-
unless @
|
81
|
+
unless @object_files_directories
|
82
82
|
puts parser.help
|
83
83
|
exit 1
|
84
84
|
end
|
@@ -93,9 +93,9 @@ class ObjCDependencyTreeGenerator
|
|
93
93
|
}
|
94
94
|
|
95
95
|
if @options[:swift_dependencies]
|
96
|
-
SwiftDependenciesGenerator.new.generate_dependencies(@
|
96
|
+
SwiftDependenciesGenerator.new.generate_dependencies(@object_files_directories, &links_block)
|
97
97
|
else
|
98
|
-
ObjcDependenciesGenerator.new.generate_dependencies(@
|
98
|
+
ObjcDependenciesGenerator.new.generate_dependencies(@object_files_directories, @options[:use_dwarf], &links_block)
|
99
99
|
end
|
100
100
|
|
101
101
|
links
|
@@ -1,4 +1,4 @@
|
|
1
|
-
def find_project_output_directory(derived_data_paths, project_prefix, project_suffix_pattern,
|
1
|
+
def find_project_output_directory(derived_data_paths, project_prefix, project_suffix_pattern, target_names)
|
2
2
|
|
3
3
|
return nil unless derived_data_paths
|
4
4
|
|
@@ -21,13 +21,25 @@ def find_project_output_directory(derived_data_paths, project_prefix, project_su
|
|
21
21
|
|
22
22
|
filtered_by_target_paths = paths
|
23
23
|
|
24
|
-
if
|
25
|
-
filtered_by_target_paths = paths.find_all { |path|
|
24
|
+
if target_names != nil && target_names.length > 0
|
25
|
+
filtered_by_target_paths = paths.find_all { |path|
|
26
|
+
target_names.any? { |target| /#{target}[^\.]*\.build\/Objects-normal/.match path }
|
27
|
+
}
|
26
28
|
$stderr.puts "After target filtration there is #{filtered_by_target_paths.length} directories left"
|
27
29
|
if paths.empty?
|
28
|
-
$stderr.puts "Cannot find projects that starts with '#{project_prefix}'' and has target name that starts with '#{
|
30
|
+
$stderr.puts "Cannot find projects that starts with '#{project_prefix}'' and has target name that starts with '#{target_names}'"
|
29
31
|
exit 1
|
30
32
|
end
|
33
|
+
|
34
|
+
paths_sorted_by_time = filtered_by_target_paths.sort_by { |f| File.ctime(f.chomp) }
|
35
|
+
last_modified_dirs = target_names.map { |target|
|
36
|
+
filtered_by_target = filtered_by_target_paths.find_all { |path| /#{target}[^\.]*\.build\/Objects-normal/.match path }
|
37
|
+
last_modified_dir = filtered_by_target.last.chomp
|
38
|
+
$stderr.puts "Last modifications for #{target} were in\n#{last_modified_dir}\ndirectory at\n#{File.ctime(last_modified_dir)}"
|
39
|
+
last_modified_dir
|
40
|
+
}
|
41
|
+
return last_modified_dirs
|
42
|
+
|
31
43
|
end
|
32
44
|
|
33
45
|
paths_sorted_by_time = filtered_by_target_paths.sort_by { |f| File.ctime(f.chomp) }
|
@@ -35,7 +47,7 @@ def find_project_output_directory(derived_data_paths, project_prefix, project_su
|
|
35
47
|
last_modified_dir = paths_sorted_by_time.last.chomp
|
36
48
|
$stderr.puts "Last modifications were in\n#{last_modified_dir}\ndirectory at\n#{File.ctime(last_modified_dir)}"
|
37
49
|
|
38
|
-
last_modified_dir
|
50
|
+
[last_modified_dir]
|
39
51
|
end
|
40
52
|
|
41
53
|
def is_primitive_swift_type?(dest)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: objc-dependency-tree-generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Taykalo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |
|
14
14
|
Tool that allows to generate Objective-C and Swift dependency tree from object files
|