cocoapods-alexandria 0.2.2 → 0.2.5
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d3e818c908ebf093b15067e862eb0aa6b0c4a576023b07596014806386d605b
|
4
|
+
data.tar.gz: 064c89f49a1d7ffe73c8e8c2f45df3bd56550fbb594388f26b92e77bedfee02f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5cb6e45538fa2b455bd4772a0a2abeab086624ec7f597c220f19b1590346234e08cfd039c8bb10b12479a46b0c2392efc5a055aa39cf9c6c24ce1311101febc
|
7
|
+
data.tar.gz: b0942db92ebf9f9eac042c07ddf84ee7a7f0548b6720869abe391f973a105d6de2dd6a04560241c945232f7c247ea63d9f2421f3cbe6294edc5860ecbf66f73c
|
@@ -15,15 +15,16 @@ module PodAlexandria
|
|
15
15
|
deployment_target = target.platform_deployment_target
|
16
16
|
target_label = target.cocoapods_target_label
|
17
17
|
|
18
|
-
#
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
18
|
+
# find & build all dependencies
|
19
|
+
project.all_dependencies_for(target).map { |target|
|
20
|
+
# skip if already built (product, or by other target)
|
21
|
+
next if skip_build?(target, sdk)
|
22
|
+
|
23
|
+
# may already be built (by another target)
|
24
|
+
if File.directory?(build_path(target, sdk))
|
25
|
+
build_path(target, sdk)
|
25
26
|
else
|
26
|
-
xcodebuild(
|
27
|
+
xcodebuild(target, sdk, deployment_target)
|
27
28
|
end
|
28
29
|
}.compact
|
29
30
|
end
|
@@ -34,37 +35,73 @@ module PodAlexandria
|
|
34
35
|
{ :ios => 'iphoneos', :osx => 'macosx', :tvos => 'appletvos', :watchos => 'watchos' }
|
35
36
|
end
|
36
37
|
|
37
|
-
def skip_build?(target,
|
38
|
-
File.directory?(destination_path(
|
39
|
-
|
38
|
+
def skip_build?(target, sdk)
|
39
|
+
File.directory?(destination_path(target)) ||
|
40
|
+
File.directory?(build_path(target, sdk))
|
40
41
|
end
|
41
42
|
|
42
|
-
def
|
43
|
-
project.
|
44
|
-
.find { |t| t.name == target_name }
|
45
|
-
.is_a?(Xcodeproj::Project::Object::PBXNativeTarget)
|
46
|
-
end
|
47
|
-
|
48
|
-
def xcodebuild(target, module_name, sdk, deployment_target)
|
49
|
-
args = %W(-project #{sandbox.project_path.realdirpath} -scheme #{target} -configuration #{configuration} -sdk #{sdk})
|
43
|
+
def xcodebuild(target, sdk, deployment_target)
|
44
|
+
args = %W(-project #{sandbox.project_path.realdirpath} -scheme #{target.name} -configuration #{configuration} -sdk #{sdk})
|
50
45
|
args += flags unless flags.nil?
|
51
46
|
|
52
|
-
Pod::UI.puts "Building '#{target}' for #{sdk}..."
|
47
|
+
Pod::UI.puts "Building '#{target.name}' for #{sdk}..."
|
53
48
|
Pod::Executable.execute_command 'xcodebuild', args, true
|
54
49
|
|
55
|
-
build_path(target,
|
50
|
+
build_path(target, sdk)
|
56
51
|
end
|
57
52
|
|
58
53
|
def project
|
59
54
|
@project ||= Xcodeproj::Project.open(sandbox.project_path)
|
60
55
|
end
|
61
56
|
|
62
|
-
def build_path(target,
|
63
|
-
|
57
|
+
def build_path(target, sdk)
|
58
|
+
# Note: using target.product_name is wrong in some cases (Cocoapods project generation bug)
|
59
|
+
# See https://github.com/CocoaPods/CocoaPods/issues/8007
|
60
|
+
"#{build_dir}/#{configuration}-#{sdk}/#{target.name}/#{target.product_reference.name}"
|
61
|
+
end
|
62
|
+
|
63
|
+
def destination_path(target)
|
64
|
+
# Note: using target.product_name is wrong in some cases (Cocoapods project generation bug)
|
65
|
+
# See https://github.com/CocoaPods/CocoaPods/issues/8007
|
66
|
+
"#{destination}/#{target.product_reference.name}"
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
module Xcodeproj
|
72
|
+
class Project
|
73
|
+
module Object
|
74
|
+
class AbstractTarget
|
75
|
+
def is_native?
|
76
|
+
is_a?(Xcodeproj::Project::Object::PBXNativeTarget)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
class PBXNativeTarget
|
81
|
+
def is_bundle?
|
82
|
+
product_type == 'com.apple.product-type.bundle'
|
83
|
+
end
|
84
|
+
|
85
|
+
def all_dependencies
|
86
|
+
dependencies
|
87
|
+
.filter { |d| d.target.is_native? && !d.target.is_bundle? }
|
88
|
+
.map { |d| [d.target] + d.target.all_dependencies }
|
89
|
+
.flatten.uniq
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
def all_dependencies_for(umbrella_target)
|
95
|
+
target(umbrella_target.cocoapods_target_label).all_dependencies
|
64
96
|
end
|
65
97
|
|
66
|
-
def
|
67
|
-
|
98
|
+
def target(target_name)
|
99
|
+
result = targets.find { |t| t.name == target_name }
|
100
|
+
if result.is_native?
|
101
|
+
return result
|
102
|
+
else
|
103
|
+
return nil
|
104
|
+
end
|
68
105
|
end
|
69
106
|
end
|
70
107
|
end
|
@@ -90,12 +90,12 @@ module PodAlexandria
|
|
90
90
|
|
91
91
|
def delete(spec)
|
92
92
|
name = spec_modules[spec] || module_name(spec)
|
93
|
-
paths = Dir["#{destination}/#{name}.{framework,xcframework}"]
|
93
|
+
paths = Dir["#{destination}/#{name}.{a,framework,xcframework}"]
|
94
94
|
|
95
95
|
if !paths.empty?
|
96
|
-
paths.each { |path| FileUtils.
|
96
|
+
paths.each { |path| FileUtils.remove_entry(path, true) }
|
97
97
|
else
|
98
|
-
Pod::UI.warn "🤔 Could not delete #{
|
98
|
+
Pod::UI.warn "🤔 Could not delete cached binary for #{name}, it does not exist! (this is normal for newly added pods)"
|
99
99
|
end
|
100
100
|
end
|
101
101
|
|
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.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Jennes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cocoapods
|