cocoapods-flutter-dt 0.0.3 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 18f5e54d76525f37dd069456318eac1d194bb8da3238f85d59ff1cec9ab174e7
4
- data.tar.gz: 8b07578c4702e2d99be36fb99970afe732275cbf30e89acf269166a401f452eb
3
+ metadata.gz: 0d058cdad92967be7cdb6faf68d8bce286faee3ba289296a5a6f11df41738f53
4
+ data.tar.gz: eb3e2b8a366cbe38e1db06e19aae8e1d4a7e1694bb4153077895f96c1c3aa578
5
5
  SHA512:
6
- metadata.gz: 4dcab1bf0b6cabfa622724dbd69764eef0861b76c9e4ddd74030ba002ac5db8b696e759254bb0a09cc306ee985bc9fb217fe99454a3c896ac959b302250f2ef7
7
- data.tar.gz: 9ecbb88939b5498078b00c5610a7ae7f3945feb651bcfbd80107c8a3b4fa035190ecc34caba83ad4f7dd9b4f33aadd68f49a620653177ca7cf94d0a87c470a80
6
+ metadata.gz: 20879048433c4ef4939104a66c4362a265f41dbd1e2f9a0bb1a098f5338f153b9bea446bb3997b56ad4fd4963b9191e30a960854ac269a1b84b36c7fcbe2e61b
7
+ data.tar.gz: f580c9792e50cd5a57651944c961f18fd22667d02faa45d8a93cfe21e582c7e949d47a984467daa1690f4c1568689cc3e0a71240d0177f7f77c3cbfd0d5dc0ae
data/README.md CHANGED
@@ -1,23 +1,24 @@
1
1
  # cocoapods-flutter
2
2
 
3
- cocoapods plugin for integration Flutter easily.
3
+ Cocoapods plugin for Flutter project integration.
4
4
 
5
5
  ## Installation
6
6
 
7
7
  **Precondition**
8
- Before you use `cocoapods-flutter`, make sure binary server and archive CI tool is ready. I provide you an archive tool and a binary server. Click link below and redirect to another repository.
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
- [FlutterArchiveTool](https://github.com/NicolasKim/flutter_archive.git)
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
- ### Case 1
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', :mode=>'debug/release', :sdk_version=>'1.12.13'
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
- ### Case 2
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 'PACKAGE_NAME', :path=>'local/module/path'
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`
@@ -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{A short description of cocoapods-flutter.}
12
- spec.summary = %q{A longer description of cocoapods-flutter.}
13
- spec.homepage = 'https://github.com/EXAMPLE/cocoapods-flutter'
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(['MODULE', 'VERSION', 'PODREPO'], false)
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
- @version = argv.shift_argument
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')
@@ -1,3 +1,3 @@
1
1
  module CocoapodsFlutter
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.9"
3
3
  end
@@ -48,7 +48,12 @@ class Archiver
48
48
  def archive
49
49
 
50
50
  @pub_upgrade ? pub_upgrade : pub_get
51
- setup_pod_sources
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 fail"
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','--debug','--release',"--output=#{@product_dir}") == false
177
197
  # FileUtils.remove_dir product_dir, true
178
- raise "run build_runner fail"
198
+ raise "Error running #{@flutter_wrapper} build ios-framework --debug --release --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 "run build_runner fail"
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, stdout, stderr, wait_thr = Open3.popen3(*args)
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 stdout.gets
15
+ puts stdout_stderr.gets
12
16
  else
13
- puts stderr.gets
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
@@ -26,9 +26,6 @@ module Pod
26
26
  flutter_project_mode = parse_key(:mode, requirements)
27
27
  flutter_project_path = parse_key(:path, requirements)
28
28
  flutter_project_repo = parse_key(:git, requirements)
29
- flutter_project_repo_url = flutter_project_repo[:url]
30
- flutter_project_repo_ref = flutter_project_repo[:ref]
31
- flutter_command_wrapper = flutter_project_repo[:wrapper]
32
29
  flutter_project_version = parse_version requirements
33
30
  if flutter_project_mode.nil?
34
31
  flutter_project_mode = "release"
@@ -42,6 +39,9 @@ module Pod
42
39
  end
43
40
 
44
41
  unless flutter_project_repo.nil?
42
+ flutter_project_repo_url = flutter_project_repo[:url]
43
+ flutter_project_repo_ref = flutter_project_repo[:ref]
44
+ flutter_command_wrapper = flutter_project_repo[:wrapper]
45
45
  UI.info "Using git source..."
46
46
  if flutter_project_repo_ref.nil?
47
47
  flutter_project_repo_ref = 'master'
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.3
4
+ version: 0.0.9
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-08-11 00:00:00.000000000 Z
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: A short description of cocoapods-flutter.
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/EXAMPLE/cocoapods-flutter
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: A longer description of cocoapods-flutter.
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