cocoapods-alexandria 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cocoapods-alexandria/gem_version.rb +1 -1
- data/lib/cocoapods-alexandria/rome/compiler.rb +58 -26
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53a4f9bbe821077493e3ed28b9498c8d354568a5d1db2b21325a410f01ac9174
|
4
|
+
data.tar.gz: dc38d21a6c95984c84398423813359c35f9c38c1d10acfff3ec1ec568749f97c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2bd60a0217002b5c9301f3ccc9cc72dffec098f5aacd479a630aa13cdcf531c53126717b3baf745a8690ac9fb6d0d22607bf1a5a2cfbf8586f9ccbf013eb277f
|
7
|
+
data.tar.gz: c99fd46bf20edd1e1c96ebae578d555fe761c2488e04bea00b37bfc595df310f0f200b5b253cc6e4dc1b1a655110dc00611707655fefd01254b97874eef63abf
|
@@ -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,38 +35,69 @@ 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
|
-
|
40
|
-
!is_native_target?(target)
|
38
|
+
def skip_build?(target, sdk)
|
39
|
+
File.directory?(destination_path(target)) ||
|
40
|
+
File.directory?(build_path(target, sdk))
|
41
41
|
end
|
42
42
|
|
43
|
-
def
|
44
|
-
project.
|
45
|
-
.find { |t| t.name == target_name }
|
46
|
-
.is_a?(Xcodeproj::Project::Object::PBXNativeTarget)
|
47
|
-
end
|
48
|
-
|
49
|
-
def xcodebuild(target, module_name, sdk, deployment_target)
|
50
|
-
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})
|
51
45
|
args += flags unless flags.nil?
|
52
46
|
|
53
|
-
Pod::UI.puts "Building '#{target}' for #{sdk}..."
|
47
|
+
Pod::UI.puts "Building '#{target.name}' for #{sdk}..."
|
54
48
|
Pod::Executable.execute_command 'xcodebuild', args, true
|
55
49
|
|
56
|
-
build_path(target,
|
50
|
+
build_path(target, sdk)
|
57
51
|
end
|
58
52
|
|
59
53
|
def project
|
60
54
|
@project ||= Xcodeproj::Project.open(sandbox.project_path)
|
61
55
|
end
|
62
56
|
|
63
|
-
def build_path(target,
|
64
|
-
"#{build_dir}/#{configuration}-#{sdk}/#{target}/#{
|
57
|
+
def build_path(target, sdk)
|
58
|
+
"#{build_dir}/#{configuration}-#{sdk}/#{target.name}/#{target.product_name}.framework"
|
59
|
+
end
|
60
|
+
|
61
|
+
def destination_path(target)
|
62
|
+
"#{destination}/#{target.product_name}.framework"
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
module Xcodeproj
|
68
|
+
class Project
|
69
|
+
module Object
|
70
|
+
class AbstractTarget
|
71
|
+
def is_native?
|
72
|
+
is_a?(Xcodeproj::Project::Object::PBXNativeTarget)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
class PBXNativeTarget
|
77
|
+
def is_bundle?
|
78
|
+
product_type == 'com.apple.product-type.bundle'
|
79
|
+
end
|
80
|
+
|
81
|
+
def all_dependencies
|
82
|
+
dependencies
|
83
|
+
.filter { |d| d.target.is_native? && !d.target.is_bundle? }
|
84
|
+
.map { |d| [d.target] + d.target.all_dependencies }
|
85
|
+
.flatten.uniq
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
def all_dependencies_for(umbrella_target)
|
91
|
+
target(umbrella_target.cocoapods_target_label).all_dependencies
|
65
92
|
end
|
66
93
|
|
67
|
-
def
|
68
|
-
|
94
|
+
def target(target_name)
|
95
|
+
result = targets.find { |t| t.name == target_name }
|
96
|
+
if result.is_native?
|
97
|
+
return result
|
98
|
+
else
|
99
|
+
return nil
|
100
|
+
end
|
69
101
|
end
|
70
102
|
end
|
71
103
|
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.2.
|
4
|
+
version: 0.2.4
|
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-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cocoapods
|