cocoapods-binary 0.1.2 → 0.2
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 +5 -5
- data/lib/cocoapods-binary/Integration.rb +32 -24
- data/lib/cocoapods-binary/Main.rb +58 -58
- data/lib/cocoapods-binary/Prebuild.rb +45 -47
- data/lib/cocoapods-binary/feature_switches.rb +6 -2
- data/lib/cocoapods-binary/gem_version.rb +1 -1
- data/lib/cocoapods-binary/prebuild_sandbox.rb +1 -1
- data/lib/cocoapods-binary/tool/tool.rb +24 -0
- data/lib/cocoapods_plugin.rb +0 -7
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 16f6d7d397c71e854a7e9d6639fa6ca5db285be1baf54e9af54231badc8f53a9
|
4
|
+
data.tar.gz: a2a2e8bd6c1010f2ef7c2d03ae46d24ba76d1347b30b586d44ddcf5aaba1ac13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3db502e1c9655092e9f2b38a129d27ead17e48d2bd9bc9cb1d143de5b85d606d49d3d8783b2147851da2d17dab66b69508cedd8acee2ef61a136b4074c946970
|
7
|
+
data.tar.gz: 21a1c41d15eb85daf2ecd05cce73b990f73f2b0119c4021bcd9b4e7875362d7af8a9804642a11aa5667acf18c8c378b7f02e793ff9799d93a460d64647878bb5
|
@@ -2,6 +2,12 @@ require_relative 'podfile_options'
|
|
2
2
|
require_relative 'feature_switches'
|
3
3
|
require_relative 'prebuild_sandbox'
|
4
4
|
|
5
|
+
# NOTE:
|
6
|
+
# This file will only be loaded on normal pod install step
|
7
|
+
# so there's no need to check is_prebuild_stage
|
8
|
+
|
9
|
+
|
10
|
+
|
5
11
|
# Provide a special "download" process for prebuilded pods.
|
6
12
|
#
|
7
13
|
# As the frameworks is already exsited in local folder. We
|
@@ -41,12 +47,20 @@ module Pod
|
|
41
47
|
def remove_target_files_if_needed
|
42
48
|
|
43
49
|
changes = Pod::Prebuild.framework_changes
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
50
|
+
updated_names = []
|
51
|
+
if changes == nil
|
52
|
+
puts "aaaaa"
|
53
|
+
updated_names = PrebuildSandbox.from_standard_sandbox(self.sandbox).exsited_framework_names
|
54
|
+
else
|
55
|
+
puts "bbbbb"
|
56
|
+
puts changes
|
57
|
+
added = changes[:added] || []
|
58
|
+
changed = changes[:changed] || []
|
59
|
+
deleted = changes[:removed] || []
|
60
|
+
updated_names = added + changed + deleted
|
61
|
+
end
|
48
62
|
|
49
|
-
|
63
|
+
updated_names.each do |name|
|
50
64
|
root_name = Specification.root_name(name)
|
51
65
|
next if self.sandbox.local?(root_name)
|
52
66
|
|
@@ -62,21 +76,19 @@ module Pod
|
|
62
76
|
old_method2 = instance_method(:resolve_dependencies)
|
63
77
|
define_method(:resolve_dependencies) do
|
64
78
|
|
65
|
-
|
66
|
-
|
67
|
-
else
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
self.
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
spec.attributes_hash["license"] = {}
|
79
|
-
end
|
79
|
+
puts "ddddddddd"
|
80
|
+
|
81
|
+
# Remove the old target files, else it will not notice file changes
|
82
|
+
self.remove_target_files_if_needed
|
83
|
+
old_method2.bind(self).()
|
84
|
+
|
85
|
+
self.analysis_result.specifications.each do |spec|
|
86
|
+
next unless self.prebuild_pod_names.include? spec.name
|
87
|
+
spec.attributes_hash["vendored_frameworks"] = "#{spec.name}.framework"
|
88
|
+
spec.attributes_hash["source_files"] = []
|
89
|
+
|
90
|
+
# to avoid the warning of missing license
|
91
|
+
spec.attributes_hash["license"] = {}
|
80
92
|
end
|
81
93
|
|
82
94
|
end
|
@@ -86,10 +98,6 @@ module Pod
|
|
86
98
|
old_method = instance_method(:install_source_of_pod)
|
87
99
|
define_method(:install_source_of_pod) do |pod_name|
|
88
100
|
|
89
|
-
if Pod.is_prebuild_stage
|
90
|
-
return old_method.bind(self).(pod_name)
|
91
|
-
end
|
92
|
-
|
93
101
|
# copy from original
|
94
102
|
pod_installer = create_pod_installer(pod_name)
|
95
103
|
# \copy from original
|
@@ -1,10 +1,15 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
|
-
require_relative '
|
4
|
-
require_relative 'prebuild_sandbox'
|
3
|
+
require_relative 'podfile_options'
|
5
4
|
|
6
5
|
Pod::HooksManager.register('cocoapods-binary', :pre_install) do |installer_context|
|
7
6
|
|
7
|
+
require_relative 'feature_switches'
|
8
|
+
if Pod.is_prebuild_stage
|
9
|
+
next
|
10
|
+
end
|
11
|
+
|
12
|
+
# [Check Environment]
|
8
13
|
# check user_framework is on
|
9
14
|
podfile = installer_context.podfile
|
10
15
|
podfile.target_definition_list.each do |target_definition|
|
@@ -14,61 +19,56 @@ Pod::HooksManager.register('cocoapods-binary', :pre_install) do |installer_conte
|
|
14
19
|
exit
|
15
20
|
end
|
16
21
|
end
|
17
|
-
|
18
|
-
|
19
|
-
#
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
22
|
+
|
23
|
+
|
24
|
+
# -- step 1: prebuild framework ---
|
25
|
+
# Execute a sperated pod install, to generate targets for building framework,
|
26
|
+
# then compile them to framework files.
|
27
|
+
require_relative 'prebuild_sandbox'
|
28
|
+
require_relative 'Prebuild'
|
29
|
+
|
30
|
+
Pod::UI.puts "🚀 Prebuild frameworks"
|
31
|
+
|
32
|
+
|
33
|
+
# control features
|
34
|
+
Pod.is_prebuild_stage = true
|
35
|
+
Pod::Podfile::DSL.enable_prebuild_patch true # enable sikpping for prebuild targets
|
36
|
+
Pod::Installer.force_disable_integration true # don't integrate targets
|
37
|
+
Pod::Config.force_disable_write_lockfile true # disbale write lock file for perbuild podfile
|
38
|
+
Pod::Installer.disable_install_complete_message true # disable install complete message
|
39
|
+
|
40
|
+
# make another custom sandbox
|
41
|
+
standard_sandbox = installer_context.sandbox
|
42
|
+
prebuild_sandbox = Pod::PrebuildSandbox.from_standard_sandbox(standard_sandbox)
|
43
|
+
|
44
|
+
# get the podfile for prebuild
|
45
|
+
prebuild_podfile = Pod::Podfile.from_ruby(podfile.defined_in_file)
|
46
|
+
|
47
|
+
# install
|
48
|
+
binary_installer = Pod::Installer.new(prebuild_sandbox, prebuild_podfile , nil)
|
49
|
+
|
50
|
+
if binary_installer.have_exact_prebuild_cache?
|
51
|
+
binary_installer.install_when_cache_hit!
|
52
|
+
else
|
53
|
+
binary_installer.repo_update = false
|
54
|
+
binary_installer.update = false
|
55
|
+
binary_installer.install!
|
24
56
|
end
|
57
|
+
|
58
|
+
|
59
|
+
# reset the environment
|
60
|
+
Pod.is_prebuild_stage = false
|
61
|
+
Pod::Installer.force_disable_integration false
|
62
|
+
Pod::Podfile::DSL.enable_prebuild_patch false
|
63
|
+
Pod::Config.force_disable_write_lockfile false
|
64
|
+
Pod::Installer.disable_install_complete_message false
|
65
|
+
|
66
|
+
|
67
|
+
# -- step 2: prebuild framework ---
|
68
|
+
# install
|
69
|
+
Pod::UI.puts "\n"
|
70
|
+
Pod::UI.puts "🤖 Pod Install"
|
71
|
+
require_relative 'Integration'
|
72
|
+
# go on the normal install step ...
|
73
|
+
end
|
25
74
|
|
26
|
-
class Command
|
27
|
-
class Install
|
28
|
-
|
29
|
-
|
30
|
-
# --- patch ---
|
31
|
-
old_method = instance_method(:run)
|
32
|
-
|
33
|
-
define_method(:run) do
|
34
|
-
|
35
|
-
# -- step 1: prebuild framework ---
|
36
|
-
|
37
|
-
# control features
|
38
|
-
Pod.is_prebuild_stage = true
|
39
|
-
Pod::Podfile::DSL.enable_prebuild_patch true # enable sikpping for prebuild targets
|
40
|
-
Pod::Installer.force_disable_integration true # don't integrate targets
|
41
|
-
Pod::Config.force_disable_write_lockfile true # disbale write lock file for perbuild podfile
|
42
|
-
Pod::Installer.disable_install_complete_message true # disable install complete message
|
43
|
-
|
44
|
-
# make another custom sandbox
|
45
|
-
standard_sandbox = self.config.sandbox
|
46
|
-
prebuild_sandbox = Pod::PrebuildSandbox.from_standard_sandbox(standard_sandbox)
|
47
|
-
self.config.sandbox = prebuild_sandbox
|
48
|
-
|
49
|
-
# install
|
50
|
-
Pod::UI.puts "✔️ Prebuild frameworks"
|
51
|
-
old_method.bind(self).()
|
52
|
-
|
53
|
-
|
54
|
-
# -- step 2: prebuild framework ---
|
55
|
-
|
56
|
-
# reset the environment
|
57
|
-
self.config.podfile = nil
|
58
|
-
self.config.lockfile = nil
|
59
|
-
self.config.sandbox = standard_sandbox
|
60
|
-
Pod.is_prebuild_stage = false
|
61
|
-
Pod::Installer.force_disable_integration false
|
62
|
-
Pod::Podfile::DSL.enable_prebuild_patch false
|
63
|
-
Pod::Config.force_disable_write_lockfile false
|
64
|
-
Pod::Installer.disable_install_complete_message false
|
65
|
-
|
66
|
-
# install
|
67
|
-
Pod::UI.puts "\n"
|
68
|
-
Pod::UI.puts "✔️ Pod Install"
|
69
|
-
old_method.bind(self).()
|
70
|
-
end
|
71
|
-
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
@@ -6,16 +6,58 @@ module Pod
|
|
6
6
|
end
|
7
7
|
end
|
8
8
|
|
9
|
+
|
9
10
|
# patch prebuild ability
|
10
11
|
module Pod
|
12
|
+
class Installer
|
11
13
|
|
12
|
-
|
14
|
+
def local_manifest
|
15
|
+
if not @local_manifest_inited
|
16
|
+
@local_manifest_inited = true
|
17
|
+
raise "This method should be call before generate project" unless self.analysis_result == nil
|
18
|
+
@local_manifest = self.sandbox.manifest
|
19
|
+
end
|
20
|
+
@local_manifest
|
21
|
+
end
|
13
22
|
|
14
|
-
class Installer
|
15
23
|
|
24
|
+
# check if need to prebuild
|
25
|
+
def have_exact_prebuild_cache?
|
26
|
+
# check if need build frameworks
|
27
|
+
return false if local_manifest == nil
|
28
|
+
|
29
|
+
changes = local_manifest.detect_changes_with_podfile(podfile)
|
30
|
+
puts changes
|
31
|
+
Pod::Prebuild.framework_changes = changes # save the chagnes info for later stage
|
32
|
+
added = changes[:added] || []
|
33
|
+
changed = changes[:changed] || []
|
34
|
+
unchanged = changes[:unchanged] || []
|
35
|
+
deleted = changes[:removed] || []
|
36
|
+
|
37
|
+
unchange_framework_names = added + unchanged
|
38
|
+
exsited_framework_names = sandbox.exsited_framework_names
|
39
|
+
missing = unchanged.select do |pod_name|
|
40
|
+
not exsited_framework_names.include?(pod_name)
|
41
|
+
end
|
42
|
+
|
43
|
+
needed = (added + changed + deleted + missing)
|
44
|
+
return needed.empty?
|
45
|
+
end
|
46
|
+
|
47
|
+
|
48
|
+
# The install method when have completed cache
|
49
|
+
def install_when_cache_hit!
|
50
|
+
# just print log
|
51
|
+
self.sandbox.exsited_framework_names.each do |name|
|
52
|
+
UI.puts "Using #{name}"
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
|
57
|
+
# Build the needed framework files
|
16
58
|
def prebuild_frameworks
|
17
59
|
|
18
|
-
local_manifest =
|
60
|
+
local_manifest = self.local_manifest
|
19
61
|
sandbox_path = sandbox.root
|
20
62
|
existed_framework_folder = sandbox.generate_framework_path
|
21
63
|
|
@@ -70,51 +112,7 @@ module Pod
|
|
70
112
|
|
71
113
|
end
|
72
114
|
|
73
|
-
# check if need to prebuild
|
74
|
-
old_method = instance_method(:install!)
|
75
|
-
define_method(:install!) do
|
76
|
-
return old_method.bind(self).() unless Pod.is_prebuild_stage
|
77
|
-
|
78
|
-
# check if need build frameworks
|
79
|
-
local_manifest = self.sandbox.manifest
|
80
|
-
Pod::Prebuild.framework_changes = nil
|
81
|
-
return old_method.bind(self).() if local_manifest == nil
|
82
|
-
|
83
|
-
changes = local_manifest.detect_changes_with_podfile(podfile)
|
84
|
-
added = changes[:added] || []
|
85
|
-
changed = changes[:changed] || []
|
86
|
-
unchanged = changes[:unchanged] || []
|
87
|
-
deleted = changes[:removed] || []
|
88
|
-
Pod::Prebuild.framework_changes = changes # save the chagnes info for later stage
|
89
|
-
|
90
|
-
unchange_framework_names = added + unchanged
|
91
|
-
exsited_framework_names = sandbox.exsited_framework_names
|
92
|
-
missing = unchanged.select do |pod_name|
|
93
|
-
not exsited_framework_names.include?(pod_name)
|
94
|
-
end
|
95
|
-
|
96
|
-
if (added + changed + missing).empty?
|
97
|
-
deleted.each do |framework_name|
|
98
|
-
path = sandbox.framework_path_for_pod_name framework_name
|
99
|
-
if path.exist?
|
100
|
-
path.rmtree
|
101
|
-
UI.puts "Delete #{framework_name}"
|
102
|
-
end
|
103
|
-
end
|
104
115
|
|
105
|
-
# don't do the install
|
106
|
-
exsited_framework_names.each do |name|
|
107
|
-
UI.puts "Using #{name}"
|
108
|
-
end
|
109
|
-
return
|
110
|
-
end
|
111
|
-
|
112
|
-
# normal install
|
113
|
-
# Save manifest before generate a new one
|
114
|
-
Pod.old_manifest_lock_file = local_manifest
|
115
|
-
old_method.bind(self).()
|
116
|
-
end
|
117
|
-
|
118
116
|
# patch the post install hook
|
119
117
|
old_method2 = instance_method(:run_plugins_post_install_hooks)
|
120
118
|
define_method(:run_plugins_post_install_hooks) do
|
@@ -1,3 +1,6 @@
|
|
1
|
+
require_relative 'tool/tool'
|
2
|
+
require_relative 'prebuild_sandbox'
|
3
|
+
|
1
4
|
module Pod
|
2
5
|
|
3
6
|
# a flag that indicate stages
|
@@ -67,7 +70,7 @@ module Pod
|
|
67
70
|
# option to disable write lockfiles
|
68
71
|
class Config
|
69
72
|
|
70
|
-
@@force_disable_write_lockfile
|
73
|
+
@@force_disable_write_lockfile = false
|
71
74
|
def self.force_disable_write_lockfile(value)
|
72
75
|
@@force_disable_write_lockfile = value
|
73
76
|
end
|
@@ -75,7 +78,8 @@ module Pod
|
|
75
78
|
old_method = instance_method(:lockfile_path)
|
76
79
|
define_method(:lockfile_path) do
|
77
80
|
if @@force_disable_write_lockfile
|
78
|
-
|
81
|
+
# As config is a singleton, sandbox_root refer to the standard sandbox.
|
82
|
+
return PrebuildSandbox.from_standard_sanbox_path(sandbox_root).root + 'Manifest.lock.tmp'
|
79
83
|
else
|
80
84
|
return old_method.bind(self).()
|
81
85
|
end
|
@@ -20,7 +20,7 @@ module Pod
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def exsited_framework_names
|
23
|
-
[] unless generate_framework_path.exist?
|
23
|
+
return [] unless generate_framework_path.exist?
|
24
24
|
generate_framework_path.children.map do |framework_name|
|
25
25
|
extension = File.extname(framework_name)
|
26
26
|
if extension == ".framework"
|
@@ -9,4 +9,28 @@
|
|
9
9
|
#
|
10
10
|
def class_attr_accessor(symbol)
|
11
11
|
self.class.send(:attr_accessor, symbol)
|
12
|
+
end
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
class Object
|
17
|
+
def deep_clone
|
18
|
+
return @deep_cloning_obj if @deep_cloning
|
19
|
+
@deep_cloning_obj = clone
|
20
|
+
@deep_cloning_obj.instance_variables.each do |var|
|
21
|
+
val = @deep_cloning_obj.instance_variable_get(var)
|
22
|
+
begin
|
23
|
+
@deep_cloning = true
|
24
|
+
val = val.deep_clone
|
25
|
+
rescue TypeError
|
26
|
+
next
|
27
|
+
ensure
|
28
|
+
@deep_cloning = false
|
29
|
+
end
|
30
|
+
@deep_cloning_obj.instance_variable_set(var, val)
|
31
|
+
end
|
32
|
+
deep_cloning_obj = @deep_cloning_obj
|
33
|
+
@deep_cloning_obj = nil
|
34
|
+
deep_cloning_obj
|
35
|
+
end
|
12
36
|
end
|
data/lib/cocoapods_plugin.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-binary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- leavez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cocoapods
|
@@ -117,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
117
117
|
version: '0'
|
118
118
|
requirements: []
|
119
119
|
rubyforge_project:
|
120
|
-
rubygems_version: 2.4
|
120
|
+
rubygems_version: 2.7.4
|
121
121
|
signing_key:
|
122
122
|
specification_version: 4
|
123
123
|
summary: A longer description of cocoapods-binary.
|