cocoapods-alexandria 0.1.2 → 0.1.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78e151c7ffabfa1fbd96664cb624d48be0f71951cfaed1f9fec9e100cc89cf1d
|
4
|
+
data.tar.gz: 8d587ba944d86a928421700b9a46f4aabebd1282ea44db6fc8bdc41628dd59df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6dc83e067aabe9c0e890f1ad579e7abcd546c234fe2dbd692e9614a238f38809181ea47d892f65e567f6cbdaf50b2eba9e93feb61749d7ad02bb83d29c3af76
|
7
|
+
data.tar.gz: e035c88b38adbb67c12c42b753cdf7de4670842d342f26c7eb87e405a085ff54e8c849b35b65f469aac347fb02003610cec93f3234d28fff9a8990544e72e559
|
@@ -24,13 +24,7 @@ module PodAlexandria
|
|
24
24
|
target_name,
|
25
25
|
{
|
26
26
|
'configFiles' => configurations,
|
27
|
-
'dependencies' => get_dependencies_from_xcconfig(xcconfig).map
|
28
|
-
if dependency.exists?
|
29
|
-
{ 'framework' => dependency.path, 'embed' => dependency.is_dynamic? }
|
30
|
-
else
|
31
|
-
{ 'sdk' => dependency.sdk }
|
32
|
-
end
|
33
|
-
}
|
27
|
+
'dependencies' => get_dependencies_from_xcconfig(xcconfig).map(&:xcodegen_info)
|
34
28
|
}
|
35
29
|
]
|
36
30
|
end
|
@@ -43,7 +37,8 @@ module PodAlexandria
|
|
43
37
|
def self.get_dependencies_from_xcconfig(file)
|
44
38
|
File.readlines(file).select { |line| line.start_with?('OTHER_LDFLAGS') }.first
|
45
39
|
&.split('=')&.at(1)&.tr('"', '') # get value (and remove quotes)
|
46
|
-
&.gsub('-framework', '')&.gsub('-
|
40
|
+
&.gsub('-framework ', '-f')&.gsub('-weak_framework ', '-wf') # replace framework with fake linker flag
|
41
|
+
&.gsub('-ObjC', '') # remove unneeded flags
|
47
42
|
&.split&.drop(1) # remove inherited
|
48
43
|
&.map { |d| Dependency.new(d) } || []
|
49
44
|
end
|
@@ -1,11 +1,30 @@
|
|
1
1
|
module PodAlexandria
|
2
2
|
class Dependency
|
3
|
-
attr_reader :
|
3
|
+
attr_reader :flag
|
4
|
+
attr_reader :module_name
|
4
5
|
|
5
6
|
def initialize(value)
|
6
|
-
@
|
7
|
+
@flag = value.start_with?('-wf') ? 'wf' : value[1]
|
8
|
+
@module_name = value.delete_prefix('-l').delete_prefix('-f').delete_prefix('-wf')
|
7
9
|
end
|
8
10
|
|
11
|
+
def xcodegen_info
|
12
|
+
if exists?
|
13
|
+
{
|
14
|
+
'framework' => path,
|
15
|
+
'embed' => is_dynamic?,
|
16
|
+
'weak' => is_weak?
|
17
|
+
}
|
18
|
+
else
|
19
|
+
{
|
20
|
+
'sdk' => sdk,
|
21
|
+
'weak' => is_weak?
|
22
|
+
}
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
9
28
|
def path
|
10
29
|
binary = Dir["Rome/*.{framework,xcframework}/**/#{binary_name}"].first
|
11
30
|
binary&.split(File::SEPARATOR)&.first(2)&.join(File::SEPARATOR)
|
@@ -15,7 +34,7 @@ module PodAlexandria
|
|
15
34
|
if is_library?
|
16
35
|
"lib#{module_name}.tbd"
|
17
36
|
else
|
18
|
-
"#{
|
37
|
+
"#{module_name}.framework"
|
19
38
|
end
|
20
39
|
end
|
21
40
|
|
@@ -26,17 +45,19 @@ module PodAlexandria
|
|
26
45
|
def is_dynamic?
|
27
46
|
if path.end_with? 'xcframework'
|
28
47
|
any_arch = Dir["#{path}/*/*.framework"].first
|
29
|
-
binary = "#{any_arch}/#{
|
48
|
+
binary = "#{any_arch}/#{module_name}"
|
30
49
|
else
|
31
|
-
binary = "#{path}/#{
|
50
|
+
binary = "#{path}/#{module_name}"
|
32
51
|
end
|
33
52
|
!%x(file #{binary} | grep dynamic).to_s.strip.empty?
|
34
53
|
end
|
35
54
|
|
36
|
-
private
|
37
|
-
|
38
55
|
def is_library?
|
39
|
-
|
56
|
+
flag == 'l'
|
57
|
+
end
|
58
|
+
|
59
|
+
def is_weak?
|
60
|
+
flag == 'wf'
|
40
61
|
end
|
41
62
|
|
42
63
|
def binary_name
|
@@ -46,9 +67,5 @@ module PodAlexandria
|
|
46
67
|
module_name
|
47
68
|
end
|
48
69
|
end
|
49
|
-
|
50
|
-
def module_name
|
51
|
-
value.delete_prefix('-l')
|
52
|
-
end
|
53
70
|
end
|
54
71
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-alexandria
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Jennes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cocoapods
|