cocoapods-flutter-dt 0.2.6 → 0.2.7
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 +3 -2
- data/lib/cocoapods-flutter/command/flutter/archive.rb +1 -1
- 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 +57 -7
- data/lib/cocoapods-flutter/native/archive/remote.rb +28 -0
- data/lib/cocoapods-flutter/native/podfile.rb +1 -0
- data/lib/cocoapods-flutter/native.rb +1 -0
- metadata +19 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51c1e6b26f94766910cca087a1697b87106b48e2cc13474960262b6a90c1112e
|
4
|
+
data.tar.gz: 82b73cbf5750b86d629d881b049db9969662f1715f0581ac4c4c6ca81676620e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 431372086b26158d86be83052d27fa5d1caee2844e00b056662645a17cfc7f66a0fc2b7f207cd01b165a2295ca5ab3911e340d28d974126e447013e248514aeb
|
7
|
+
data.tar.gz: cf5b96dad0f26cd345dfe6a05eaf1db9bebb72d2853d54d2deef3bf49e1a28d141de2618a27420285713e4980d9c045df190e9ab485f429d6c74d40949c35aab
|
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,6 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
21
|
spec.add_dependency 'parallel'
|
22
|
+
spec.add_dependency 'plist'
|
22
23
|
spec.add_dependency 'cocoapods', '~> 1.11.2'
|
23
24
|
spec.add_dependency 'rubyzip', '>= 1.0.0'
|
24
25
|
spec.add_dependency 'rest-client'
|
@@ -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,7 @@ 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'
|
7
8
|
|
8
9
|
class Archiver
|
9
10
|
|
@@ -47,6 +48,11 @@ class Archiver
|
|
47
48
|
end
|
48
49
|
|
49
50
|
def archive
|
51
|
+
# open('http://127.0.0.1:8080/frameworks/download/Flutter/1.22.6/release/file.zip') do |u|
|
52
|
+
# File.open('/Users/dreamtracer/Desktop/flutter.zip', "w+") do |file|
|
53
|
+
# file.write u.read.force_encoding("UTF-8")
|
54
|
+
# end
|
55
|
+
# end
|
50
56
|
|
51
57
|
@pub_upgrade ? pub_upgrade : pub_get
|
52
58
|
if local_podfile_exists?
|
@@ -299,9 +305,54 @@ class Archiver
|
|
299
305
|
end
|
300
306
|
|
301
307
|
sdk_file = zip_file_dir + "/Flutter.zip"
|
308
|
+
home_dir = Dir.home
|
309
|
+
cache_dir = home_dir + "/.cocoapods/.cache"
|
310
|
+
flutter_sdk_dsym_dir = cache_dir + "/flutter_sdk_dsym"
|
311
|
+
#创建dsym缓存文件
|
312
|
+
if Dir.exist?(flutter_sdk_dsym_dir) == false
|
313
|
+
Dir.mkdir flutter_sdk_dsym_dir
|
314
|
+
end
|
315
|
+
|
302
316
|
Zip::File.open sdk_file, Zip::File::CREATE do |zipfile|
|
303
317
|
file = File.join(product_dir, "Flutter.framework")
|
304
|
-
zipfile.add_dir "Flutter.framework", file
|
318
|
+
zipfile.add_dir "Flutter/Flutter.framework", file
|
319
|
+
#读取Flutter.framework中的info.plist文件中的FlutterEngine的值
|
320
|
+
info_plist_path = File.join(file, "Info.plist")
|
321
|
+
info_plist = Plist.parse_xml(info_plist_path)
|
322
|
+
engine_hash = info_plist["FlutterEngine"]
|
323
|
+
dsym_dir = File.join(flutter_sdk_dsym_dir, engine_hash)
|
324
|
+
dsym_zip_file_path = File.join(dsym_dir, 'Flutter.framework.dSYM.zip')
|
325
|
+
dsym_file_path = File.join(dsym_dir, 'Flutter.framework.dSYM')
|
326
|
+
#检查dsym文件缓存
|
327
|
+
Pod::UserInterface.info "Checking Flutter.framework.dSYM at #{dsym_dir}"
|
328
|
+
if Dir.exist?(dsym_dir) == false
|
329
|
+
Pod::UserInterface.info "Flutter.framework.dSYM not found at #{dsym_dir}"
|
330
|
+
Dir.mkdir(dsym_dir) unless Dir.exist?(dsym_dir)
|
331
|
+
#下载dsym
|
332
|
+
remote = Remote.new()
|
333
|
+
remote.download_flutter_sdk_dsym @flutter_version, engine_hash, dsym_zip_file_path
|
334
|
+
Pod::UserInterface.info "Flutter.framework.dSYM download success"
|
335
|
+
Dir.mkdir(dsym_file_path) unless File.exist?(dsym_file_path)
|
336
|
+
|
337
|
+
Pod::UserInterface.info "Start unzip #{dsym_zip_file_path}"
|
338
|
+
Zip::File.open(dsym_zip_file_path) do |zif_file|
|
339
|
+
zif_file.each do |entry|
|
340
|
+
# 通过下句打印可知,entyr是Zip::ZipEntry的对象
|
341
|
+
# puts entry.class
|
342
|
+
# 利用File.join构建文件存放的路径,路径为存放目录加上压缩文件的相对路径
|
343
|
+
entry.extract(File.join(dsym_dir, entry::name))
|
344
|
+
end
|
345
|
+
end
|
346
|
+
#重命名:如果文件名为Flutter.dSYM,则将Flutter.dSYM重命名为Flutter.framework.dSYM,因为cocoapods只识别Flutter.framework.dSYM
|
347
|
+
File.rename( File.join( dsym_dir, 'Flutter.dSYM'), dsym_file_path ) if File.exist? File.join( dsym_dir, 'Flutter.dSYM')
|
348
|
+
|
349
|
+
Pod::UserInterface.info "Unzip #{dsym_zip_file_path} success"
|
350
|
+
|
351
|
+
end
|
352
|
+
|
353
|
+
#向zip中添加dsym文件
|
354
|
+
Pod::UserInterface.info "Add Flutter.framework.dSYM to #{sdk_file}"
|
355
|
+
zipfile.add_dir "Flutter/Flutter.framework.dSYM", dsym_file_path
|
305
356
|
end
|
306
357
|
[zip_file, sdk_file]
|
307
358
|
end
|
@@ -322,7 +373,7 @@ end
|
|
322
373
|
def download(url, dest)
|
323
374
|
open(url) do |u|
|
324
375
|
File.open(dest, "w+") do |file|
|
325
|
-
file.write u.read
|
376
|
+
file.write u.read.force_encoding("UTF-8")
|
326
377
|
end
|
327
378
|
end
|
328
379
|
end
|
@@ -338,8 +389,8 @@ if Dir.exist?(sdk_dir) == false
|
|
338
389
|
Dir.mkdir sdk_dir
|
339
390
|
download sdk_url, sdk_file
|
340
391
|
end
|
341
|
-
if
|
342
|
-
`rm -rf Flutter
|
392
|
+
if Dir.exist? "Flutter"
|
393
|
+
`rm -rf Flutter`
|
343
394
|
end
|
344
395
|
`unzip \#{sdk_file} -d \#{Dir.pwd}`
|
345
396
|
CODE
|
@@ -370,7 +421,6 @@ end
|
|
370
421
|
if result
|
371
422
|
Pod::UserInterface.info "Flutter_#{@flutter_version}_#{mode.downcase} was found, skip upload"
|
372
423
|
end
|
373
|
-
|
374
424
|
end
|
375
425
|
|
376
426
|
def ignore_dependency?(name)
|
@@ -414,7 +464,7 @@ end
|
|
414
464
|
s.prepare_command = "ruby download_sdk.rb #{sdk_download_url}"
|
415
465
|
s.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64 x86_64' }
|
416
466
|
s.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64 x86_64' }
|
417
|
-
vendored_frameworks = ["App.framework", "Flutter.framework", "FlutterPluginRegistrant.framework"]
|
467
|
+
vendored_frameworks = ["App.framework", "Flutter/Flutter.framework", "FlutterPluginRegistrant.framework"]
|
418
468
|
@plugins.each do |plugin|
|
419
469
|
vendored_frameworks.append "#{plugin.name}.framework"
|
420
470
|
end
|
@@ -430,7 +480,7 @@ end
|
|
430
480
|
File.open spec_file, "w+" do |file|
|
431
481
|
file.write spec.to_pretty_json
|
432
482
|
end
|
433
|
-
|
483
|
+
Pod::UserInterface.info "podspec file path #{spec_file}"
|
434
484
|
Dir.chdir temp_dir do |dir|
|
435
485
|
Pod::Command::Repo::Push.run([@pod_repo, '--skip-import-validation', '--verbose', '--allow-warnings', "--sources=#{@sources.join(',')}"])
|
436
486
|
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
|
|
@@ -42,4 +43,31 @@ class Remote
|
|
42
43
|
@base_url + json["data"]['download_url']
|
43
44
|
end
|
44
45
|
|
46
|
+
def download_flutter_sdk_dsym(version, hash, des_path)
|
47
|
+
uri = URI.join @base_url, "/dsyms/download/flutter/#{version}/#{hash}/file.zip"
|
48
|
+
Pod::UserInterface.info "Start download Flutter.framework.dSYM from #{uri.to_s}"
|
49
|
+
data = RestClient::Request.execute(:method => :get, :url => uri.to_s, :timeout => 3600, :raw_response => true)
|
50
|
+
file = File.new(des_path, 'w+')
|
51
|
+
file.write data
|
52
|
+
file.close
|
53
|
+
end
|
54
|
+
|
55
|
+
def upload_flutter_sdk_dsym(version, hash, file_path)
|
56
|
+
uri = URI.join @base_url, "/dsyms"
|
57
|
+
Pod::UserInterface.info "Start upload '#{file_path}' to #{uri.to_s}"
|
58
|
+
req = RestClient::Request.new(
|
59
|
+
:method => :post,
|
60
|
+
:url => uri.to_s,
|
61
|
+
:timeout => 3600,
|
62
|
+
:payload => {
|
63
|
+
:multipart => true,
|
64
|
+
:file => File.new(file_path, 'rb'),
|
65
|
+
:name => 'flutter',
|
66
|
+
:version => version,
|
67
|
+
:tag => hash
|
68
|
+
}
|
69
|
+
)
|
70
|
+
req.execute
|
71
|
+
end
|
72
|
+
|
45
73
|
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.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "\bDreamtracer"
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|
@@ -24,6 +24,20 @@ 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
|
@@ -108,7 +122,7 @@ dependencies:
|
|
108
122
|
- - ">="
|
109
123
|
- !ruby/object:Gem::Version
|
110
124
|
version: '0'
|
111
|
-
description: Flutter
|
125
|
+
description: Flutter foryou tool
|
112
126
|
email:
|
113
127
|
- jinqiucheng1006@live.cn
|
114
128
|
executables: []
|
@@ -125,6 +139,7 @@ files:
|
|
125
139
|
- lib/cocoapods-flutter/command.rb
|
126
140
|
- lib/cocoapods-flutter/command/flutter.rb
|
127
141
|
- lib/cocoapods-flutter/command/flutter/archive.rb
|
142
|
+
- lib/cocoapods-flutter/command/flutter/dsym.rb
|
128
143
|
- lib/cocoapods-flutter/gem_version.rb
|
129
144
|
- lib/cocoapods-flutter/native.rb
|
130
145
|
- lib/cocoapods-flutter/native/archive/archive.rb
|
@@ -164,7 +179,7 @@ requirements: []
|
|
164
179
|
rubygems_version: 3.0.6
|
165
180
|
signing_key:
|
166
181
|
specification_version: 4
|
167
|
-
summary: Simple way to
|
182
|
+
summary: Simple way to foryou and use
|
168
183
|
test_files:
|
169
184
|
- spec/command/flutter_spec.rb
|
170
185
|
- spec/spec_helper.rb
|