pod-builder 1.0.0 ā 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/pod_builder +8 -1
- data/lib/pod_builder/command/update_lldbinit.rb +23 -10
- data/lib/pod_builder/version.rb +1 -1
- 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: 75c011fa869888a095f17bcabcc5f6130cf19d43be6d67794c75ff4232cb5740
|
4
|
+
data.tar.gz: 53d8c8304e9d1ee6e192fa6df5149260b12c302fea43075b0bd84ee35a5ed95a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9d50554ec87bb186b8e79af81b03fd10c555550db5005f9e9a5b5793562276f6ee9a6c11ecac06698aa2b35585114b385ba5fdb08d22d4742a81040e9c7a9de
|
7
|
+
data.tar.gz: 97c02d867c3ac4e007b6a21671c22a68e6ddbbfd863e4a6950ca3813a237b26b059b0cd6fe63e50914ba96e6c4280064e23b4ea49a24cc2265bebe687b8944a2
|
data/exe/pod_builder
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
+
require 'pod_builder/version'
|
4
|
+
|
5
|
+
show_version = ARGV.include?("version") && ARGV.count == 1
|
6
|
+
if show_version
|
7
|
+
puts PodBuilder::VERSION
|
8
|
+
exit(0)
|
9
|
+
end
|
10
|
+
|
3
11
|
if ENV['DEBUGGING']
|
4
12
|
puts "Running in debug, injecting $LOAD_PATH"
|
5
13
|
libdir = File.expand_path("#{File.dirname(__FILE__)}/../lib")
|
@@ -8,7 +16,6 @@ end
|
|
8
16
|
|
9
17
|
require 'optparse'
|
10
18
|
require 'pod_builder/core'
|
11
|
-
require 'pod_builder/version'
|
12
19
|
require 'pod_builder/command'
|
13
20
|
|
14
21
|
OPTIONS = {}
|
@@ -1,11 +1,11 @@
|
|
1
1
|
require 'pod_builder/core'
|
2
|
+
require 'digest'
|
2
3
|
|
3
4
|
module PodBuilder
|
4
5
|
module Command
|
5
6
|
class UpdateLldbInit
|
6
7
|
def self.call(options)
|
7
8
|
Configuration.check_inited
|
8
|
-
PodBuilder::prepare_basepath
|
9
9
|
|
10
10
|
argument_pods = ARGV.dup
|
11
11
|
|
@@ -15,8 +15,17 @@ module PodBuilder
|
|
15
15
|
unless argument_pods.count == 1
|
16
16
|
raise "\n\nSpecify a single PATH to the folder containing the prebuilt framework's source code\n\n".red
|
17
17
|
end
|
18
|
-
|
18
|
+
|
19
19
|
base_path = PodBuilder::basepath("")
|
20
|
+
|
21
|
+
lldbinit_path = File.expand_path('~/.lldbinit-Xcode')
|
22
|
+
lldbinit_content = File.exists?(lldbinit_path) ? File.read(lldbinit_path) : ""
|
23
|
+
restore_hash = podfile_restore_hash()
|
24
|
+
if lldbinit_content.include?("<pb_md5:#{base_path}:#{restore_hash}")
|
25
|
+
puts "\n\nš already in sync!\n".green
|
26
|
+
return 0
|
27
|
+
end
|
28
|
+
|
20
29
|
path = argument_pods[0]
|
21
30
|
|
22
31
|
is_absolute = ["~", "/"].include?(path[0])
|
@@ -78,12 +87,8 @@ module PodBuilder
|
|
78
87
|
|
79
88
|
replace_paths.uniq!
|
80
89
|
|
81
|
-
source_map_lines = replace_paths.flat_map { |t| ["# <pb>", "settings append target.source-map '#{t.split(",").first}' '#{t.split(",").last}'"] }
|
82
|
-
|
83
|
-
# first occurrance should be a set
|
84
|
-
source_map_lines[1] = source_map_lines[1].gsub("settings append target.source-map", "settings set target.source-map")
|
85
|
-
end
|
86
|
-
rewrite_lldinit(source_map_lines)
|
90
|
+
source_map_lines = replace_paths.flat_map { |t| ["# <pb:#{base_path}>", "settings append target.source-map '#{t.split(",").first}' '#{t.split(",").last}'"] }
|
91
|
+
rewrite_lldinit(source_map_lines, base_path)
|
87
92
|
|
88
93
|
puts "\n\nš done!\n".green
|
89
94
|
return 0
|
@@ -105,7 +110,11 @@ module PodBuilder
|
|
105
110
|
end
|
106
111
|
end
|
107
112
|
|
108
|
-
def self.
|
113
|
+
def self.podfile_restore_hash()
|
114
|
+
Digest::MD5.hexdigest(File.read(PodBuilder::basepath("Podfile.restore")))
|
115
|
+
end
|
116
|
+
|
117
|
+
def self.rewrite_lldinit(source_map_lines, base_path)
|
109
118
|
puts "Writing ~/.lldbinit-Xcode".yellow
|
110
119
|
|
111
120
|
lldbinit_path = File.expand_path('~/.lldbinit-Xcode')
|
@@ -114,7 +123,7 @@ module PodBuilder
|
|
114
123
|
lldbinit_lines = []
|
115
124
|
skipNext = false
|
116
125
|
File.read(lldbinit_path).each_line do |line|
|
117
|
-
if line.include?("# <pb>")
|
126
|
+
if line.include?("# <pb:#{base_path}>")
|
118
127
|
skipNext = true
|
119
128
|
next
|
120
129
|
elsif skipNext
|
@@ -128,6 +137,10 @@ module PodBuilder
|
|
128
137
|
end
|
129
138
|
end
|
130
139
|
|
140
|
+
restore_hash = podfile_restore_hash()
|
141
|
+
source_map_lines.insert(0, "<pb_md5:#{base_path}:#{restore_hash}>")
|
142
|
+
source_map_lines.insert(0, "<pb:#{base_path}>")
|
143
|
+
|
131
144
|
lldbinit_lines += source_map_lines
|
132
145
|
|
133
146
|
File.write(lldbinit_path, lldbinit_lines.join("\n"))
|
data/lib/pod_builder/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pod-builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomas Camin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|