cocoapods-pod-merge 0.0.3 → 0.0.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-pod-merge/Main.rb +18 -0
- data/lib/cocoapods-pod-merge/gem_version.rb +1 -1
- data/lib/cocoapods_plugin.rb +4 -0
- 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: 8b459bb9880825b248a09ba05792ae6c2610fe1d030542f87c768b6be8a97863
|
4
|
+
data.tar.gz: ed15333591feed5844193f04c6d1e958d20d0585b7a8c1e789f4120797a2f0da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c975c7ff7c90670e90186b8e18d51ee2d13df43dd45a9ff47bfefa090edede0fe9b5a9c19a646fee9614bc92ef8499e19312815542548918188a81912b29ae66
|
7
|
+
data.tar.gz: 9298c5dc639536457934ae3c9cd7db3b65e568e0840bd20047a95885019dbc5dc1e7a1cedbbbeef4b834b7e786ffb19bb28f667ddf7bd097469f7bc08d7746b2
|
@@ -72,6 +72,14 @@ module CocoapodsPodMerge
|
|
72
72
|
add_to_gitignore
|
73
73
|
end
|
74
74
|
|
75
|
+
def add_mergefile_to_project(installer_context)
|
76
|
+
pods_project = Xcodeproj::Project.open(installer_context.pods_project.path)
|
77
|
+
mergefile = pods_project.new_file('../MergeFile')
|
78
|
+
mergefile.explicit_file_type = 'text.script.ruby'
|
79
|
+
mergefile.include_in_index = '1'
|
80
|
+
pods_project.save
|
81
|
+
end
|
82
|
+
|
75
83
|
def add_to_gitignore
|
76
84
|
gitignore_file = '.gitignore'
|
77
85
|
|
@@ -247,6 +255,7 @@ module CocoapodsPodMerge
|
|
247
255
|
Dir.glob('**/*.{h,m,mm,swift}').each do |source_file|
|
248
256
|
contents = File.read(source_file)
|
249
257
|
if has_dependencies
|
258
|
+
# Fix imports of style import xx
|
250
259
|
pods_to_merge.each do |pod|
|
251
260
|
modular_imports = contents.scan(%r{<#{pod}/(.+)>})
|
252
261
|
next unless modular_imports&.last
|
@@ -257,6 +266,15 @@ module CocoapodsPodMerge
|
|
257
266
|
end
|
258
267
|
File.open(source_file, 'w') { |file| file.puts contents_with_imports_fixed }
|
259
268
|
end
|
269
|
+
|
270
|
+
# Fix imports of style import xx
|
271
|
+
pods_to_merge.each do |pod|
|
272
|
+
modular_imports = contents.scan("import #{pod}")
|
273
|
+
next unless modular_imports&.last
|
274
|
+
|
275
|
+
Pod::UI.puts "\t\tExperimental: ".yellow + "Found a module import in #{source_file}, fixing this by removing it".magenta
|
276
|
+
File.open(source_file, 'w') { |file| file.puts contents.gsub("import #{pod}", '') }
|
277
|
+
end
|
260
278
|
else
|
261
279
|
modular_imports = contents.scan(%r{<#{pod}/(.+)>})
|
262
280
|
next unless modular_imports&.last
|
data/lib/cocoapods_plugin.rb
CHANGED
@@ -7,5 +7,9 @@ module CocoapodsPodMerge
|
|
7
7
|
Pod::HooksManager.register('cocoapods-pod-merge', :pre_install) do |installer_context|
|
8
8
|
PodMerger.new.begin(installer_context)
|
9
9
|
end
|
10
|
+
|
11
|
+
Pod::HooksManager.register('cocoapods-pod-merge', :post_install) do |installer_context|
|
12
|
+
PodMerger.new.add_mergefile_to_project(installer_context)
|
13
|
+
end
|
10
14
|
end
|
11
15
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-pod-merge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Siddharth Gupta
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-11-
|
11
|
+
date: 2019-11-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|