cocoapods-flutter-dt 0.0.4 → 0.1.0
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 +53 -17
- data/cocoapods-flutter.gemspec +3 -3
- data/lib/cocoapods-flutter/command/flutter/archive.rb +27 -2
- data/lib/cocoapods-flutter/gem_version.rb +1 -1
- data/lib/cocoapods-flutter/native/archive/archive.rb +28 -6
- data/lib/cocoapods-flutter/native/archive/command_runner.rb +9 -3
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1bed8741ae242f98724e034453bd5cace2cff801123f35a2203bcafd5fe68bbc
|
4
|
+
data.tar.gz: f4ea33ea4c4088b71f38139cb699833baf3d9f9e6ef1dba7867ae80d2005bffa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 257362bcedd494984ecaea180b61e74fc0f64a9bdd02179efd6c7bfb9b72d541c46cfa1fa9ff7d2df7c8b0262398be550af6531a67016613368731dad9e849c7
|
7
|
+
data.tar.gz: a64644b829f8d24bdcb73278dbff233cc7064aafc236ecf452f46a53c1d0e116d9b0c430e20d9d5cf714e80a318dfbd5656f7a7755ef0b07b27dc6935ab1c146
|
data/README.md
CHANGED
@@ -1,23 +1,24 @@
|
|
1
1
|
# cocoapods-flutter
|
2
2
|
|
3
|
-
|
3
|
+
Cocoapods plugin for Flutter project integration.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
7
|
**Precondition**
|
8
|
-
|
8
|
+
|
9
|
+
Before you use `cocoapods-flutter`, make sure binary server is ready. I provide you a simple binary server. Click link below and redirect to another repository.
|
9
10
|
|
10
11
|
[BinaryServer](https://github.com/NicolasKim/binary_server.git)
|
11
|
-
|
12
|
+
|
12
13
|
|
13
14
|
**Gem install**
|
14
15
|
|
15
16
|
```
|
16
|
-
$ gem install cocoapods-flutter
|
17
|
+
$ gem install cocoapods-flutter-dt
|
17
18
|
```
|
18
19
|
Or download source code build gem on your own
|
19
20
|
```
|
20
|
-
$ gem install cocoapods-flutter.gem
|
21
|
+
$ gem install cocoapods-flutter-dt.gem
|
21
22
|
```
|
22
23
|
|
23
24
|
**Config environment**
|
@@ -26,28 +27,63 @@ $ export FLUTTER_BINARY_SERVER_BASEURL=https://www.example.com
|
|
26
27
|
```
|
27
28
|
Here is simple [binary server](https://github.com/NicolasKim/binary_server.git)
|
28
29
|
|
30
|
+
|
29
31
|
## Usage
|
32
|
+
|
33
|
+
|
34
|
+
### Archive
|
35
|
+
|
36
|
+
```shell script
|
37
|
+
$ cd flutter project
|
38
|
+
$ pod flutter archive package_name 0.0.1 --repo=cocoapods --wrapper=flutterw --sources=https://github.com/private_spec_repo.git,https://github.com/Cocoapods/Specs.git
|
39
|
+
```
|
40
|
+
|
41
|
+
|
42
|
+
There is more options
|
43
|
+
```shell script
|
44
|
+
$ pod flutter archive --help
|
45
|
+
--repo podspec repo
|
46
|
+
--sources podspec sources
|
47
|
+
--upgrade pub upgrade
|
48
|
+
--wrapper Default is flutter
|
49
|
+
--flutterversion FlutterSDK version
|
50
|
+
--buildrun run build-runner
|
51
|
+
```
|
52
|
+
If you need to customize the .ios/Podfile, you can create a file name of 'local_podfile', the tool will use this file in first priority.
|
53
|
+
|
54
|
+
### Use
|
55
|
+
|
30
56
|
In Podfile
|
57
|
+
```
|
58
|
+
plugin 'cocoapods-flutter-dt'
|
59
|
+
```
|
31
60
|
|
32
61
|
|
62
|
+
#### Case 1
|
63
|
+
Use binary of flutter, In this case, tool will download code from binary server.
|
64
|
+
```ruby
|
65
|
+
flutter_pod 'package_name', '0.0.1', :mode=>'debug/release'
|
66
|
+
```
|
33
67
|
|
34
|
-
|
68
|
+
#### Case 2
|
69
|
+
Use local flutter project, compile dart code every time when you build native code
|
35
70
|
```ruby
|
36
|
-
flutter_pod 'package_name', '0.0.1'
|
71
|
+
flutter_pod 'package_name', '0.0.1',:mode=>'debug/release', :path=>'local path of pubspec file'
|
37
72
|
```
|
38
73
|
|
39
|
-
**package_name**
|
40
|
-
Name of package
|
41
|
-
**:sdk_version**
|
42
|
-
Flutter sdk version,default is 1.12.13
|
43
|
-
**:mode**
|
44
|
-
Download binary package of version of debug/release from binary server. On mode debug, of course you can attach, and on mode release, yeah it is just release.
|
45
74
|
|
46
|
-
|
75
|
+
#### Case 3
|
76
|
+
Pull flutter project from git repository. In this case, the tool will pull the flutter project into native project root directory and create framework when you pod install or update
|
47
77
|
```ruby
|
48
|
-
flutter_pod '
|
78
|
+
flutter_pod 'package_name', '0.0.1', :mode=>'debug/release', :git=>{
|
79
|
+
|
80
|
+
:url=>'http://github.com/flutter/package_name.git',
|
81
|
+
|
82
|
+
:ref=>'master',
|
83
|
+
|
84
|
+
:wrapper => 'flutterw'
|
85
|
+
|
86
|
+
}
|
49
87
|
```
|
50
|
-
**:path**
|
51
|
-
Local path of module
|
52
88
|
|
53
89
|
and `pod install`
|
data/cocoapods-flutter.gemspec
CHANGED
@@ -8,9 +8,9 @@ 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{
|
12
|
-
spec.summary = %q{
|
13
|
-
spec.homepage = 'https://github.com/
|
11
|
+
spec.description = %q{Flutter archive tool}
|
12
|
+
spec.summary = %q{Simple way to archive and use}
|
13
|
+
spec.homepage = 'https://github.com/NicolasKim/cocoapods-flutter-dt.git'
|
14
14
|
spec.license = 'MIT'
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
@@ -10,7 +10,7 @@ module Pod
|
|
10
10
|
DESC
|
11
11
|
|
12
12
|
self.arguments = [
|
13
|
-
CLAide::Argument.new(['
|
13
|
+
CLAide::Argument.new([''], false)
|
14
14
|
]
|
15
15
|
|
16
16
|
def self.options
|
@@ -26,7 +26,32 @@ module Pod
|
|
26
26
|
|
27
27
|
def initialize(argv)
|
28
28
|
@module_name = argv.shift_argument
|
29
|
-
|
29
|
+
tmp_version = argv.shift_argument
|
30
|
+
#如果满足
|
31
|
+
if tmp_version =~ /([0-9]+\.)+[0-9]+/
|
32
|
+
@version = tmp_version
|
33
|
+
else
|
34
|
+
tmp_str = tmp_version.dup
|
35
|
+
last_v = "0"
|
36
|
+
mid_v = "0"
|
37
|
+
main_v = "0"
|
38
|
+
unless tmp_str.empty?
|
39
|
+
last_v = tmp_str.slice!(tmp_str.length - 1, 1)
|
40
|
+
end
|
41
|
+
unless tmp_str.empty?
|
42
|
+
mid_v = tmp_str.slice!(tmp_str.length - 1, 1)
|
43
|
+
end
|
44
|
+
unless tmp_str.empty?
|
45
|
+
main_v = tmp_str
|
46
|
+
end
|
47
|
+
|
48
|
+
versions = Array.new
|
49
|
+
versions << main_v
|
50
|
+
versions << mid_v
|
51
|
+
versions << last_v
|
52
|
+
@version = versions.join "."
|
53
|
+
end
|
54
|
+
|
30
55
|
@pod_repo = argv.option('repo', 'master')
|
31
56
|
@sources = argv.option('sources', 'https://github.com/CocoaPods/Specs.git').split(',')
|
32
57
|
@flutter_wrapper = argv.option('wrapper', 'flutter')
|
@@ -48,7 +48,12 @@ class Archiver
|
|
48
48
|
def archive
|
49
49
|
|
50
50
|
@pub_upgrade ? pub_upgrade : pub_get
|
51
|
-
|
51
|
+
if local_podfile_exists?
|
52
|
+
use_local_podfile
|
53
|
+
else
|
54
|
+
setup_pod_sources
|
55
|
+
end
|
56
|
+
|
52
57
|
if @build_run
|
53
58
|
excute_build_run
|
54
59
|
end
|
@@ -118,6 +123,11 @@ class Archiver
|
|
118
123
|
end
|
119
124
|
end
|
120
125
|
|
126
|
+
def local_podfile_exists?
|
127
|
+
local_podfile_dir = @working_dir + '/local_podfile'
|
128
|
+
File.exist? local_podfile_dir
|
129
|
+
end
|
130
|
+
|
121
131
|
def setup_pod_sources
|
122
132
|
Pod::UserInterface.info 'Setup pod sources...'
|
123
133
|
origin_pod_file_root_dir = @working_dir + '/.ios'
|
@@ -166,23 +176,33 @@ class Archiver
|
|
166
176
|
|
167
177
|
end
|
168
178
|
|
179
|
+
def use_local_podfile
|
180
|
+
origin_pod_file_root_dir = @working_dir + '/.ios'
|
181
|
+
origin_pod_file_dir = origin_pod_file_root_dir+ '/Podfile'
|
182
|
+
if File.exist? origin_pod_file_dir
|
183
|
+
File.delete(origin_pod_file_dir)
|
184
|
+
end
|
185
|
+
local_podfile_dir = @working_dir + '/local_podfile'
|
186
|
+
FileUtils.copy_file local_podfile_dir, origin_pod_file_dir
|
187
|
+
end
|
188
|
+
|
169
189
|
def excute_build_run
|
170
190
|
if CommandRunner.run(@flutter_wrapper, 'packages','pub','run','build_runner','build','--delete-conflicting-outputs') == false
|
171
|
-
raise "run build_runner
|
191
|
+
raise "Error running #{@flutter_wrapper} packages pub run build_runner build --delete-conflicting-outputs"
|
172
192
|
end
|
173
193
|
end
|
174
194
|
|
175
195
|
def build_framework
|
176
|
-
if CommandRunner.run(@flutter_wrapper, 'build','ios-framework',"--output=#{@product_dir}") == false
|
196
|
+
if CommandRunner.run(@flutter_wrapper, 'build','ios-framework','--no-profile',"--output=#{@product_dir}") == false
|
177
197
|
# FileUtils.remove_dir product_dir, true
|
178
|
-
raise "
|
198
|
+
raise "Error running #{@flutter_wrapper} build ios-framework --no-profile --output=#{@product_dir} "
|
179
199
|
end
|
180
200
|
end
|
181
201
|
|
182
202
|
def build_app(mode)
|
183
203
|
if CommandRunner.run(@flutter_wrapper, 'build','ios',"--#{mode}" ,"--no-codesign") == false
|
184
204
|
# FileUtils.remove_dir product_dir, true
|
185
|
-
raise "
|
205
|
+
raise "Error running #{@flutter_wrapper} build ios --#{mode} --no-codesign"
|
186
206
|
end
|
187
207
|
end
|
188
208
|
|
@@ -348,6 +368,8 @@ end
|
|
348
368
|
s.source = { :http => app_download_url }
|
349
369
|
s.ios.deployment_target = '9.0'
|
350
370
|
s.prepare_command = "ruby download_sdk.rb #{sdk_download_url}"
|
371
|
+
s.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
|
372
|
+
s.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
|
351
373
|
vendored_frameworks = ["App.framework", "Flutter.framework", "FlutterPluginRegistrant.framework"]
|
352
374
|
@plugins.each do |plugin|
|
353
375
|
vendored_frameworks.append "#{plugin.name}.framework"
|
@@ -366,7 +388,7 @@ end
|
|
366
388
|
end
|
367
389
|
|
368
390
|
Dir.chdir temp_dir do |dir|
|
369
|
-
Pod::Command::Repo::Push.run([@pod_repo, '--allow-warnings', "--sources=#{@sources.join(',')}"])
|
391
|
+
Pod::Command::Repo::Push.run([@pod_repo, '--skip-import-validation', '--verbose', '--allow-warnings', "--sources=#{@sources.join(',')}"])
|
370
392
|
end
|
371
393
|
|
372
394
|
end
|
@@ -5,13 +5,19 @@ class CommandRunner
|
|
5
5
|
def CommandRunner.run(*args)
|
6
6
|
command = args.join ' '
|
7
7
|
Pod::UserInterface.info "Running #{command}..."
|
8
|
-
stdin,
|
8
|
+
stdin, stdout_stderr, wait_thr = Open3.popen2e(*args)
|
9
|
+
Thread.new do
|
10
|
+
stdout_stderr.each {|l| puts l }
|
11
|
+
end
|
12
|
+
|
9
13
|
exit_status = wait_thr.value
|
10
14
|
if exit_status.success?
|
11
|
-
puts
|
15
|
+
puts stdout_stderr.gets
|
12
16
|
else
|
13
|
-
puts
|
17
|
+
puts stdout_stderr.gets
|
14
18
|
end
|
19
|
+
stdin.close
|
20
|
+
stdout_stderr.close
|
15
21
|
return exit_status.success?
|
16
22
|
end
|
17
23
|
end
|
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.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "\bDreamtracer"
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|
@@ -108,7 +108,7 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
|
-
description:
|
111
|
+
description: Flutter archive tool
|
112
112
|
email:
|
113
113
|
- jinqiucheng1006@live.cn
|
114
114
|
executables: []
|
@@ -142,11 +142,11 @@ files:
|
|
142
142
|
- lib/cocoapods_plugin.rb
|
143
143
|
- spec/command/flutter_spec.rb
|
144
144
|
- spec/spec_helper.rb
|
145
|
-
homepage: https://github.com/
|
145
|
+
homepage: https://github.com/NicolasKim/cocoapods-flutter-dt.git
|
146
146
|
licenses:
|
147
147
|
- MIT
|
148
148
|
metadata: {}
|
149
|
-
post_install_message:
|
149
|
+
post_install_message:
|
150
150
|
rdoc_options: []
|
151
151
|
require_paths:
|
152
152
|
- lib
|
@@ -162,9 +162,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
162
162
|
version: '0'
|
163
163
|
requirements: []
|
164
164
|
rubygems_version: 3.0.6
|
165
|
-
signing_key:
|
165
|
+
signing_key:
|
166
166
|
specification_version: 4
|
167
|
-
summary:
|
167
|
+
summary: Simple way to archive and use
|
168
168
|
test_files:
|
169
169
|
- spec/command/flutter_spec.rb
|
170
170
|
- spec/spec_helper.rb
|