cocoapods-flutter-dt 0.2.6 → 0.4.1
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 +4 -4
- data/README.md +2 -2
- data/cocoapods-flutter.gemspec +5 -3
- data/lib/cocoapods-flutter/command/flutter/archive.rb +32 -28
- data/lib/cocoapods-flutter/command/flutter/dsym.rb +43 -0
- data/lib/cocoapods-flutter/command/flutter.rb +1 -0
- data/lib/cocoapods-flutter/gem_version.rb +1 -1
- data/lib/cocoapods-flutter/native/archive/archive.rb +140 -54
- data/lib/cocoapods-flutter/native/archive/remote.rb +42 -0
- data/lib/cocoapods-flutter/native/podfile.rb +1 -0
- data/lib/cocoapods-flutter/native.rb +1 -0
- metadata +39 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70acc69141278cc52466ce8627ea2ed9647d456f62e31660cc8ce133eadf8480
|
4
|
+
data.tar.gz: 77c5a34281bd9ec62c1ac0a5393df90f6d264619358e7ec6157500135a5b232d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '07395563b55e1ed0d9a630764257dcd72676a67bb6260ee7365eb20d3f3358ca294d2b7218a0725f5eb0fdb2802b91eb3d994e51d75818799292613f94d3452e'
|
7
|
+
data.tar.gz: c25ec94332249ac292e20f122fc0210faae4cfce96661e9b1b0f9e9f37eedbf94875c8e4827fcdfadb39d795c65fa64a340f936cc820ff4c3aceee67770bf4ec
|
data/README.md
CHANGED
@@ -35,13 +35,13 @@ Here is simple [binary server](https://github.com/NicolasKim/binary_server.git)
|
|
35
35
|
|
36
36
|
```shell script
|
37
37
|
$ cd flutter project
|
38
|
-
$ pod flutter
|
38
|
+
$ pod flutter foryou package_name 0.0.1 --repo=cocoapods --wrapper=flutterw --sources=https://github.com/private_spec_repo.git,https://github.com/Cocoapods/Specs.git
|
39
39
|
```
|
40
40
|
|
41
41
|
|
42
42
|
There is more options
|
43
43
|
```shell script
|
44
|
-
$ pod flutter
|
44
|
+
$ pod flutter foryou --help
|
45
45
|
--repo podspec repo
|
46
46
|
--sources podspec sources
|
47
47
|
--upgrade pub upgrade
|
data/cocoapods-flutter.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = CocoapodsFlutter::VERSION
|
9
9
|
spec.authors = ['Dreamtracer']
|
10
10
|
spec.email = ['jinqiucheng1006@live.cn']
|
11
|
-
spec.description = %q{Flutter
|
12
|
-
spec.summary = %q{Simple way to
|
11
|
+
spec.description = %q{Flutter foryou tool}
|
12
|
+
spec.summary = %q{Simple way to foryou and use}
|
13
13
|
spec.homepage = 'https://github.com/NicolasKim/cocoapods-flutter-dt.git'
|
14
14
|
spec.license = 'MIT'
|
15
15
|
|
@@ -19,10 +19,12 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
21
|
spec.add_dependency 'parallel'
|
22
|
-
spec.add_dependency '
|
22
|
+
spec.add_dependency 'plist'
|
23
|
+
spec.add_dependency 'cocoapods', '~> 1.13.0'
|
23
24
|
spec.add_dependency 'rubyzip', '>= 1.0.0'
|
24
25
|
spec.add_dependency 'rest-client'
|
25
26
|
spec.add_dependency 'molinillo'
|
27
|
+
spec.add_dependency 'yaml'
|
26
28
|
spec.add_development_dependency 'bundler', '~> 1.3'
|
27
29
|
spec.add_development_dependency 'rake'
|
28
30
|
end
|
@@ -4,7 +4,7 @@ module Pod
|
|
4
4
|
class Command
|
5
5
|
class Flutter < Command
|
6
6
|
class Archive < Flutter
|
7
|
-
self.summary = '
|
7
|
+
self.summary = 'foryou flutter'
|
8
8
|
self.description = <<-DESC
|
9
9
|
发布二进制组件 / 源码组件
|
10
10
|
DESC
|
@@ -23,36 +23,40 @@ module Pod
|
|
23
23
|
['--buildrun', 'run build-runner'],
|
24
24
|
['--debug', 'debug mode'],
|
25
25
|
['--release', 'release mode'],
|
26
|
+
['--major', 'major version'],
|
27
|
+
['--minor', 'minor version'],
|
28
|
+
['--patch', 'patch version'],
|
26
29
|
].concat(Pod::Command::Repo::Push.options).concat(super).uniq
|
27
30
|
end
|
28
31
|
|
29
32
|
def initialize(argv)
|
30
33
|
@module_name = argv.shift_argument
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
34
|
+
@version = [argv.option('major'), argv.option('minor'), argv.option('patch')].join "."
|
35
|
+
# tmp_version = argv.shift_argument
|
36
|
+
# #如果满足
|
37
|
+
# if tmp_version =~ /([0-9]+\.)+[0-9]+/
|
38
|
+
# @version = tmp_version
|
39
|
+
# else
|
40
|
+
# tmp_str = tmp_version.dup
|
41
|
+
# last_v = "0"
|
42
|
+
# mid_v = "0"
|
43
|
+
# main_v = "0"
|
44
|
+
# unless tmp_str.empty?
|
45
|
+
# last_v = tmp_str.slice!(tmp_str.length - 1, 1)
|
46
|
+
# end
|
47
|
+
# unless tmp_str.empty?
|
48
|
+
# mid_v = tmp_str.slice!(tmp_str.length - 1, 1)
|
49
|
+
# end
|
50
|
+
# unless tmp_str.empty?
|
51
|
+
# main_v = tmp_str
|
52
|
+
# end
|
53
|
+
#
|
54
|
+
# versions = Array.new
|
55
|
+
# versions << main_v
|
56
|
+
# versions << mid_v
|
57
|
+
# versions << last_v
|
58
|
+
# @version = versions.join "."
|
59
|
+
# end
|
56
60
|
|
57
61
|
|
58
62
|
@build_modes = []
|
@@ -60,7 +64,7 @@ module Pod
|
|
60
64
|
@sources = argv.option('sources', 'https://github.com/CocoaPods/Specs.git').split(',')
|
61
65
|
@flutter_wrapper = argv.option('wrapper', 'flutter')
|
62
66
|
@pub_upgrade = argv.flag?('upgrade', true)
|
63
|
-
@flutter_version = argv.option('flutterversion'
|
67
|
+
@flutter_version = argv.option('flutterversion')
|
64
68
|
@build_run = argv.flag?('buildrun', true)
|
65
69
|
@working_dir = Dir.pwd
|
66
70
|
|
@@ -81,7 +85,7 @@ module Pod
|
|
81
85
|
|
82
86
|
def default_fluttter_version
|
83
87
|
flutter_version = ''
|
84
|
-
stdin, stdout_stderr, wait_thr = Open3.popen2e(@flutter_wrapper, '--version');
|
88
|
+
stdin, stdout_stderr, wait_thr = Open3.popen2e('fvm', @flutter_wrapper, '--version');
|
85
89
|
stdout_stderr.each_line do |line|
|
86
90
|
if line.start_with?('Flutter ')
|
87
91
|
flutter_version = line.split(' • ').first.split(' ').last
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'cocoapods-flutter/native/archive/archive'
|
2
|
+
|
3
|
+
module Pod
|
4
|
+
class Command
|
5
|
+
class Flutter < Command
|
6
|
+
class DSYM < Flutter
|
7
|
+
self.summary = 'foryou flutter'
|
8
|
+
self.description = <<-DESC
|
9
|
+
Upload dSYM file to server
|
10
|
+
DESC
|
11
|
+
|
12
|
+
self.arguments = [
|
13
|
+
# CLAide::Argument.new([''], false)
|
14
|
+
]
|
15
|
+
|
16
|
+
def self.options
|
17
|
+
[
|
18
|
+
['--version', 'FlutterSDK version'],
|
19
|
+
['--hash', 'FlutterEngine hash see Flutter.frameworks info.plist FlutterEngine value'],
|
20
|
+
['--dsym', 'zip file path, you should download dSYM manually from "https://storage.cloud.google.com/flutter_infra_release/flutter/{engine hash}/ios-release/Flutter.dSYM.zip"']
|
21
|
+
]#.concat(Pod::Command::Repo::Push.options).concat(super).uniq
|
22
|
+
end
|
23
|
+
|
24
|
+
def initialize(argv)
|
25
|
+
|
26
|
+
@flutter_version = argv.option('version', '1.22.6')
|
27
|
+
@hash = argv.option('hash')
|
28
|
+
@dsym = argv.option('dsym')
|
29
|
+
@working_dir = Dir.pwd
|
30
|
+
|
31
|
+
super
|
32
|
+
end
|
33
|
+
|
34
|
+
def run
|
35
|
+
remote = Remote.new()
|
36
|
+
remote.upload_flutter_sdk_dsym @flutter_version, @hash, @dsym
|
37
|
+
Pod::UserInterface.info "Upload success"
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -4,6 +4,8 @@ require 'zip'
|
|
4
4
|
require 'cocoapods-flutter/native/archive/zip_tool'
|
5
5
|
require 'cocoapods-flutter/native/archive/remote'
|
6
6
|
require 'molinillo'
|
7
|
+
require 'plist'
|
8
|
+
require 'yaml'
|
7
9
|
|
8
10
|
class Archiver
|
9
11
|
|
@@ -47,6 +49,14 @@ class Archiver
|
|
47
49
|
end
|
48
50
|
|
49
51
|
def archive
|
52
|
+
# open('http://127.0.0.1:8080/frameworks/download/Flutter/1.22.6/release/file.zip') do |u|
|
53
|
+
# File.open('/Users/dreamtracer/Desktop/flutter.zip', "w+") do |file|
|
54
|
+
# file.write u.read.force_encoding("UTF-8")
|
55
|
+
# end
|
56
|
+
# end
|
57
|
+
|
58
|
+
#使用fvm切换flutter 版本
|
59
|
+
flutter_sdk_version_switch @flutter_version
|
50
60
|
|
51
61
|
@pub_upgrade ? pub_upgrade : pub_get
|
52
62
|
if local_podfile_exists?
|
@@ -58,12 +68,13 @@ class Archiver
|
|
58
68
|
if @build_run
|
59
69
|
excute_build_run
|
60
70
|
end
|
71
|
+
|
61
72
|
build_framework
|
62
73
|
@plugins = fetch_plugins
|
63
74
|
|
64
75
|
if @build_modes.include?('debug')
|
65
76
|
# Debug瘦身
|
66
|
-
thin_arm64 "#{@product_dir}Debug/App.framework/App"
|
77
|
+
#thin_arm64 "#{@product_dir}Debug/App.framework/App"
|
67
78
|
debug
|
68
79
|
end
|
69
80
|
|
@@ -74,41 +85,21 @@ class Archiver
|
|
74
85
|
Pod::UserInterface.message "All is ready to use!, now you can use 'flutter_pod '#{@module_name}', '#{@version}', :mode=>'debug/release' to use the pod"
|
75
86
|
end
|
76
87
|
|
77
|
-
|
78
|
-
@pub_upgrade ? pub_upgrade : pub_get
|
79
|
-
setup_pod_sources
|
80
|
-
if @build_run
|
81
|
-
excute_build_run
|
82
|
-
end
|
83
|
-
|
84
|
-
build_app mode
|
88
|
+
private
|
85
89
|
|
86
|
-
|
87
|
-
flutter_spec_file = flutter_spec_dir + '/Flutter.podspec.json'
|
88
|
-
flutter_spec = Pod::Spec.from_file @working_dir + '/.ios/Flutter/engine/Flutter.podspec'
|
89
|
-
flutter_spec.vendored_frameworks = ['Flutter.framework', 'App.framework']
|
90
|
-
plugin_registrant_spec_file = @working_dir + '/.ios/Flutter/FlutterPluginRegistrant/FlutterPluginRegistrant.podspec'
|
90
|
+
def flutter_sdk_version_switch(version)
|
91
91
|
|
92
|
-
|
93
|
-
|
94
|
-
|
92
|
+
commands = [
|
93
|
+
'fvm',
|
94
|
+
'use',
|
95
|
+
version
|
96
|
+
]
|
95
97
|
|
96
|
-
|
97
|
-
|
98
|
+
if CommandRunner.run(*commands) == false
|
99
|
+
# raise "Error running #{commands.join ' '} "
|
98
100
|
end
|
99
|
-
|
100
|
-
FileUtils.cp_r @working_dir + '/.ios/Flutter/engine/Flutter.framework', flutter_spec_dir
|
101
|
-
FileUtils.cp_r @working_dir + '/.ios/Flutter/App.framework', flutter_spec_dir
|
102
|
-
|
103
|
-
plugins = fetch_plugins
|
104
|
-
plugins.append Plugins.new('Flutter',flutter_spec_file,flutter_spec)
|
105
|
-
plugins.append Plugins.new('FlutterPluginRegistrant',plugin_registrant_spec_file, Pod::Spec.from_file(plugin_registrant_spec_file))
|
106
|
-
|
107
|
-
plugins
|
108
101
|
end
|
109
102
|
|
110
|
-
private
|
111
|
-
|
112
103
|
def thin_arm64(path)
|
113
104
|
# thin arm64
|
114
105
|
thin_commands = [
|
@@ -138,13 +129,13 @@ class Archiver
|
|
138
129
|
end
|
139
130
|
|
140
131
|
def pub_upgrade
|
141
|
-
if CommandRunner.run(@flutter_wrapper, 'pub', 'upgrade') == false
|
132
|
+
if CommandRunner.run('fvm', @flutter_wrapper, 'pub', 'upgrade') == false
|
142
133
|
raise "Pub upgrade fail"
|
143
134
|
end
|
144
135
|
end
|
145
136
|
|
146
137
|
def pub_get
|
147
|
-
if CommandRunner.run(@flutter_wrapper, 'pub', 'get') == false
|
138
|
+
if CommandRunner.run('fvm', @flutter_wrapper, 'pub', 'get') == false
|
148
139
|
raise "Pub get fail"
|
149
140
|
end
|
150
141
|
end
|
@@ -213,7 +204,7 @@ class Archiver
|
|
213
204
|
end
|
214
205
|
|
215
206
|
def excute_build_run
|
216
|
-
if CommandRunner.run(@flutter_wrapper, 'packages','pub','run','build_runner','build','--delete-conflicting-outputs') == false
|
207
|
+
if CommandRunner.run('fvm', @flutter_wrapper, 'packages','pub','run','build_runner','build','--delete-conflicting-outputs') == false
|
217
208
|
raise "Error running #{@flutter_wrapper} packages pub run build_runner build --delete-conflicting-outputs"
|
218
209
|
end
|
219
210
|
end
|
@@ -221,6 +212,7 @@ class Archiver
|
|
221
212
|
def build_framework
|
222
213
|
|
223
214
|
commands = [
|
215
|
+
'fvm',
|
224
216
|
@flutter_wrapper,
|
225
217
|
'build',
|
226
218
|
'ios-framework',
|
@@ -243,16 +235,17 @@ class Archiver
|
|
243
235
|
|
244
236
|
end
|
245
237
|
|
246
|
-
def build_app(mode)
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
end
|
238
|
+
# def build_app(mode)
|
239
|
+
# if CommandRunner.run('fvm', @flutter_wrapper, 'build','ios',"--#{mode}" ,"--no-codesign") == false
|
240
|
+
# # FileUtils.remove_dir product_dir, true
|
241
|
+
# raise "Error running #{@flutter_wrapper} build ios --#{mode} --no-codesign"
|
242
|
+
# end
|
243
|
+
# end
|
252
244
|
|
253
245
|
def fetch_plugins
|
254
246
|
results = []
|
255
247
|
flutter_plugins_list = @working_dir + '/.flutter-plugins'
|
248
|
+
|
256
249
|
lines = IO.readlines(flutter_plugins_list)
|
257
250
|
lines.each do |line|
|
258
251
|
unless line =~ /^#/
|
@@ -260,8 +253,38 @@ class Archiver
|
|
260
253
|
key = key_val[0]
|
261
254
|
value = key_val[1]
|
262
255
|
value = value.gsub /\n/, ''
|
263
|
-
|
264
|
-
|
256
|
+
yaml_content = YAML.load_file value + 'pubspec.yaml'
|
257
|
+
f_h = yaml_content['flutter']
|
258
|
+
if f_h != nil then
|
259
|
+
p_h = f_h['plugin']
|
260
|
+
if p_h != nil then
|
261
|
+
pl_h = p_h['platforms']
|
262
|
+
if pl_h != nil then
|
263
|
+
if pl_h['ios'] != nil
|
264
|
+
path = "#{value}ios/#{key}.podspec"
|
265
|
+
if File.exist? path
|
266
|
+
results.append Plugins.new(key, path, Pod::Specification.from_file(path))
|
267
|
+
end
|
268
|
+
end
|
269
|
+
else
|
270
|
+
path = "#{value}ios/#{key}.podspec"
|
271
|
+
if File.exist? path
|
272
|
+
results.append Plugins.new(key, path, Pod::Specification.from_file(path))
|
273
|
+
end
|
274
|
+
end
|
275
|
+
else
|
276
|
+
path = "#{value}ios/#{key}.podspec"
|
277
|
+
if File.exist? path
|
278
|
+
results.append Plugins.new(key, path, Pod::Specification.from_file(path))
|
279
|
+
end
|
280
|
+
end
|
281
|
+
else
|
282
|
+
path = "#{value}ios/#{key}.podspec"
|
283
|
+
if File.exist? path
|
284
|
+
results.append Plugins.new(key, path, Pod::Specification.from_file(path))
|
285
|
+
end
|
286
|
+
end
|
287
|
+
|
265
288
|
end
|
266
289
|
end
|
267
290
|
results
|
@@ -288,24 +311,87 @@ class Archiver
|
|
288
311
|
zipfile.get_output_stream("info.json") { |f| f.write json }
|
289
312
|
zipfile.add 'pubspec.lock', "#{@working_dir}/pubspec.lock"
|
290
313
|
zipfile.get_output_stream("download_sdk.rb") { |f| f.write sdk_download }
|
291
|
-
zipfile.add_dir "App.
|
292
|
-
zipfile.add_dir "FlutterPluginRegistrant.
|
314
|
+
zipfile.add_dir "App.xcframework", "#{product_dir}/App.xcframework"
|
315
|
+
zipfile.add_dir "FlutterPluginRegistrant.xcframework","#{product_dir}/FlutterPluginRegistrant.xcframework"
|
293
316
|
plugins.each do |plugin|
|
294
|
-
file = File.join(product_dir, "#{plugin.spec.name}.
|
317
|
+
file = File.join(product_dir, "#{plugin.spec.name}.xcframework")
|
295
318
|
if Dir.exist? file
|
296
|
-
zipfile.add_dir("#{plugin.spec.name}.
|
319
|
+
zipfile.add_dir("#{plugin.spec.name}.xcframework", file)
|
297
320
|
end
|
298
321
|
end
|
299
322
|
end
|
300
323
|
|
301
324
|
sdk_file = zip_file_dir + "/Flutter.zip"
|
325
|
+
home_dir = Dir.home
|
326
|
+
cache_dir = home_dir + "/.cocoapods/.cache"
|
327
|
+
flutter_sdk_dsym_dir = cache_dir + "/flutter_sdk_dsym"
|
328
|
+
#创建dsym缓存文件
|
329
|
+
if Dir.exist?(flutter_sdk_dsym_dir) == false
|
330
|
+
Dir.mkdir flutter_sdk_dsym_dir
|
331
|
+
end
|
332
|
+
|
302
333
|
Zip::File.open sdk_file, Zip::File::CREATE do |zipfile|
|
303
|
-
file = File.join(product_dir, "Flutter.
|
304
|
-
zipfile.add_dir "Flutter.
|
334
|
+
file = File.join(product_dir, "Flutter.xcframework")
|
335
|
+
zipfile.add_dir "Flutter/Flutter.xcframework", file
|
336
|
+
#读取Flutter.framework中的info.plist文件中的FlutterEngine的值
|
337
|
+
info_plist_path = info_plist_from_xcframework file, 1
|
338
|
+
# info_plist_path = File.join(file, "Info.plist")
|
339
|
+
info_plist = Plist.parse_xml(info_plist_path)
|
340
|
+
engine_hash = info_plist["FlutterEngine"]
|
341
|
+
dsym_dir = File.join(flutter_sdk_dsym_dir, engine_hash)
|
342
|
+
dsym_zip_file_path = File.join(dsym_dir, 'Flutter.framework.dSYM.zip')
|
343
|
+
dsym_file_path = File.join(dsym_dir, 'Flutter.framework.dSYM')
|
344
|
+
#检查dsym文件缓存
|
345
|
+
Pod::UserInterface.info "Checking Flutter.framework.dSYM at #{dsym_dir}"
|
346
|
+
if Dir.exist?(dsym_dir) == false
|
347
|
+
Pod::UserInterface.info "Flutter.framework.dSYM not found at #{dsym_dir}"
|
348
|
+
Dir.mkdir(dsym_dir) unless Dir.exist?(dsym_dir)
|
349
|
+
#下载dsym
|
350
|
+
remote = Remote.new()
|
351
|
+
remote.download_flutter_sdk_dsym @flutter_version, engine_hash, dsym_zip_file_path
|
352
|
+
Pod::UserInterface.info "Flutter.framework.dSYM download success"
|
353
|
+
Dir.mkdir(dsym_file_path) unless File.exist?(dsym_file_path)
|
354
|
+
|
355
|
+
Pod::UserInterface.info "Start unzip #{dsym_zip_file_path}"
|
356
|
+
Zip::File.open(dsym_zip_file_path) do |zif_file|
|
357
|
+
zif_file.each do |entry|
|
358
|
+
# 通过下句打印可知,entyr是Zip::ZipEntry的对象
|
359
|
+
# puts entry.class
|
360
|
+
# 利用File.join构建文件存放的路径,路径为存放目录加上压缩文件的相对路径
|
361
|
+
entry.extract(File.join(dsym_dir, entry::name))
|
362
|
+
end
|
363
|
+
end
|
364
|
+
#重命名:如果文件名为Flutter.dSYM,则将Flutter.dSYM重命名为Flutter.framework.dSYM,因为cocoapods只识别Flutter.framework.dSYM
|
365
|
+
File.rename( File.join( dsym_dir, 'Flutter.dSYM'), dsym_file_path ) if File.exist? File.join( dsym_dir, 'Flutter.dSYM')
|
366
|
+
|
367
|
+
Pod::UserInterface.info "Unzip #{dsym_zip_file_path} success"
|
368
|
+
|
369
|
+
end
|
370
|
+
|
371
|
+
#向zip中添加dsym文件
|
372
|
+
Pod::UserInterface.info "Add Flutter.framework.dSYM to #{sdk_file}"
|
373
|
+
zipfile.add_dir "Flutter/Flutter.framework.dSYM", dsym_file_path
|
305
374
|
end
|
306
375
|
[zip_file, sdk_file]
|
307
376
|
end
|
308
377
|
|
378
|
+
#depth 1为第一层
|
379
|
+
def info_plist_from_xcframework(path, depth)
|
380
|
+
children = Dir.children path
|
381
|
+
for child in children
|
382
|
+
child_path = File.join path, child
|
383
|
+
if File.directory? child_path then
|
384
|
+
r = info_plist_from_xcframework child_path, depth + 1
|
385
|
+
if r != nil
|
386
|
+
return r
|
387
|
+
end
|
388
|
+
elsif depth > 1 && child == 'Info.plist' then
|
389
|
+
return child_path
|
390
|
+
end
|
391
|
+
end
|
392
|
+
return nil
|
393
|
+
end
|
394
|
+
|
309
395
|
def sdk_download
|
310
396
|
|
311
397
|
ruby_code = <<-CODE
|
@@ -338,8 +424,8 @@ if Dir.exist?(sdk_dir) == false
|
|
338
424
|
Dir.mkdir sdk_dir
|
339
425
|
download sdk_url, sdk_file
|
340
426
|
end
|
341
|
-
if
|
342
|
-
`rm -rf Flutter
|
427
|
+
if Dir.exist? "Flutter"
|
428
|
+
`rm -rf Flutter`
|
343
429
|
end
|
344
430
|
`unzip \#{sdk_file} -d \#{Dir.pwd}`
|
345
431
|
CODE
|
@@ -349,6 +435,7 @@ end
|
|
349
435
|
end
|
350
436
|
|
351
437
|
def upload_files(app_file, flutter_sdk, mode)
|
438
|
+
|
352
439
|
Pod::UserInterface.info 'Start upload resources'
|
353
440
|
remote = Remote.new()
|
354
441
|
Pod::UserInterface.info "Checking #{@module_name}_#{@version}_#{mode.downcase}..."
|
@@ -370,7 +457,6 @@ end
|
|
370
457
|
if result
|
371
458
|
Pod::UserInterface.info "Flutter_#{@flutter_version}_#{mode.downcase} was found, skip upload"
|
372
459
|
end
|
373
|
-
|
374
460
|
end
|
375
461
|
|
376
462
|
def ignore_dependency?(name)
|
@@ -390,7 +476,7 @@ end
|
|
390
476
|
|
391
477
|
dependency_graph = Molinillo::DependencyGraph.new
|
392
478
|
@plugins.each do |plugin|
|
393
|
-
plugin.spec.all_dependencies.each do |dep|
|
479
|
+
plugin.spec.all_dependencies('ios').each do |dep|
|
394
480
|
unless ignore_dependency? dep.name
|
395
481
|
dependency_graph.add_vertex(dep.name, dep, true)
|
396
482
|
end
|
@@ -414,9 +500,9 @@ end
|
|
414
500
|
s.prepare_command = "ruby download_sdk.rb #{sdk_download_url}"
|
415
501
|
s.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64 x86_64' }
|
416
502
|
s.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64 x86_64' }
|
417
|
-
vendored_frameworks = ["App.
|
503
|
+
vendored_frameworks = ["App.xcframework", "Flutter/Flutter.xcframework", "FlutterPluginRegistrant.xcframework"]
|
418
504
|
@plugins.each do |plugin|
|
419
|
-
vendored_frameworks.append "#{plugin.name}.
|
505
|
+
vendored_frameworks.append "#{plugin.name}.xcframework"
|
420
506
|
end
|
421
507
|
s.vendored_frameworks = vendored_frameworks
|
422
508
|
|
@@ -430,7 +516,7 @@ end
|
|
430
516
|
File.open spec_file, "w+" do |file|
|
431
517
|
file.write spec.to_pretty_json
|
432
518
|
end
|
433
|
-
|
519
|
+
Pod::UserInterface.info "podspec file path #{spec_file}"
|
434
520
|
Dir.chdir temp_dir do |dir|
|
435
521
|
Pod::Command::Repo::Push.run([@pod_repo, '--skip-import-validation', '--verbose', '--allow-warnings', "--sources=#{@sources.join(',')}"])
|
436
522
|
File.delete spec_file
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'rest-client'
|
2
|
+
require 'open-uri'
|
2
3
|
|
3
4
|
class Remote
|
4
5
|
|
@@ -7,6 +8,7 @@ class Remote
|
|
7
8
|
raise StandardError, "Need 'FLUTTER_BINARY_SERVER_BASEURL' in env"
|
8
9
|
end
|
9
10
|
@base_url = ENV['FLUTTER_BINARY_SERVER_BASEURL']
|
11
|
+
@coverage_base_url = ENV['COVERAGE_SERVER_BASEURL']
|
10
12
|
end
|
11
13
|
|
12
14
|
def exist?(name, version, tag)
|
@@ -42,4 +44,44 @@ class Remote
|
|
42
44
|
@base_url + json["data"]['download_url']
|
43
45
|
end
|
44
46
|
|
47
|
+
def download_flutter_sdk_dsym(version, hash, des_path)
|
48
|
+
uri = URI.join @base_url, "/dsyms/download/flutter/#{version}/#{hash}/file.zip"
|
49
|
+
Pod::UserInterface.info "Start download Flutter.framework.dSYM from #{uri.to_s}"
|
50
|
+
data = RestClient::Request.execute(:method => :get, :url => uri.to_s, :timeout => 3600, :raw_response => true)
|
51
|
+
file = File.new(des_path, 'w+')
|
52
|
+
file.write data
|
53
|
+
file.close
|
54
|
+
end
|
55
|
+
|
56
|
+
def upload_flutter_sdk_dsym(version, hash, file_path)
|
57
|
+
uri = URI.join @base_url, "/dsyms"
|
58
|
+
Pod::UserInterface.info "Start upload '#{file_path}' to #{uri.to_s}"
|
59
|
+
req = RestClient::Request.new(
|
60
|
+
:method => :post,
|
61
|
+
:url => uri.to_s,
|
62
|
+
:timeout => 3600,
|
63
|
+
:payload => {
|
64
|
+
:multipart => true,
|
65
|
+
:file => File.new(file_path, 'rb'),
|
66
|
+
:name => 'flutter',
|
67
|
+
:version => version,
|
68
|
+
:tag => hash
|
69
|
+
}
|
70
|
+
)
|
71
|
+
req.execute
|
72
|
+
end
|
73
|
+
|
74
|
+
def config_coverage(bundle_id, version, git_commit_hash, index_db_path, git_repo, build_base_dir)
|
75
|
+
uri = URI.join @coverage_base_url, "/coverage/flutter/report/config"
|
76
|
+
Pod::UserInterface.info "Uploading coverage config info to #{uri.to_s}"
|
77
|
+
resp = RestClient.post(uri.to_s, {
|
78
|
+
index_db: File.new(index_db_path, 'rb'),
|
79
|
+
git_commit_hash: git_commit_hash,
|
80
|
+
git_repo: git_repo,
|
81
|
+
build_base_dir: build_base_dir,
|
82
|
+
bundle_id: bundle_id,
|
83
|
+
version: version
|
84
|
+
})
|
85
|
+
end
|
86
|
+
|
45
87
|
end
|
@@ -5,4 +5,5 @@ require 'cocoapods-flutter/native/specification/consumer'
|
|
5
5
|
require 'cocoapods-flutter/native/podfile'
|
6
6
|
require 'cocoapods-flutter/native/pod_source_preparer'
|
7
7
|
require 'cocoapods-flutter/native/archive/archive'
|
8
|
+
require 'cocoapods-flutter/native/archive/remote'
|
8
9
|
require 'cocoapods-flutter/native/archive/command_runner'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-flutter-dt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "\bDreamtracer"
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|
@@ -24,20 +24,34 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: plist
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: cocoapods
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
45
|
- - "~>"
|
32
46
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
47
|
+
version: 1.13.0
|
34
48
|
type: :runtime
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
52
|
- - "~>"
|
39
53
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
54
|
+
version: 1.13.0
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: rubyzip
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,6 +94,20 @@ dependencies:
|
|
80
94
|
- - ">="
|
81
95
|
- !ruby/object:Gem::Version
|
82
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: yaml
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
83
111
|
- !ruby/object:Gem::Dependency
|
84
112
|
name: bundler
|
85
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,7 +136,7 @@ dependencies:
|
|
108
136
|
- - ">="
|
109
137
|
- !ruby/object:Gem::Version
|
110
138
|
version: '0'
|
111
|
-
description: Flutter
|
139
|
+
description: Flutter foryou tool
|
112
140
|
email:
|
113
141
|
- jinqiucheng1006@live.cn
|
114
142
|
executables: []
|
@@ -125,6 +153,7 @@ files:
|
|
125
153
|
- lib/cocoapods-flutter/command.rb
|
126
154
|
- lib/cocoapods-flutter/command/flutter.rb
|
127
155
|
- lib/cocoapods-flutter/command/flutter/archive.rb
|
156
|
+
- lib/cocoapods-flutter/command/flutter/dsym.rb
|
128
157
|
- lib/cocoapods-flutter/gem_version.rb
|
129
158
|
- lib/cocoapods-flutter/native.rb
|
130
159
|
- lib/cocoapods-flutter/native/archive/archive.rb
|
@@ -146,7 +175,7 @@ homepage: https://github.com/NicolasKim/cocoapods-flutter-dt.git
|
|
146
175
|
licenses:
|
147
176
|
- MIT
|
148
177
|
metadata: {}
|
149
|
-
post_install_message:
|
178
|
+
post_install_message:
|
150
179
|
rdoc_options: []
|
151
180
|
require_paths:
|
152
181
|
- lib
|
@@ -161,10 +190,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
161
190
|
- !ruby/object:Gem::Version
|
162
191
|
version: '0'
|
163
192
|
requirements: []
|
164
|
-
rubygems_version: 3.0.
|
165
|
-
signing_key:
|
193
|
+
rubygems_version: 3.0.3.1
|
194
|
+
signing_key:
|
166
195
|
specification_version: 4
|
167
|
-
summary: Simple way to
|
196
|
+
summary: Simple way to foryou and use
|
168
197
|
test_files:
|
169
198
|
- spec/command/flutter_spec.rb
|
170
199
|
- spec/spec_helper.rb
|