fastlane-plugin-alioss 0.1.4 → 0.1.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 519638f4674f39271bf610d7ba4804580c098beac4cf61514b5a8b3895d9c0ef
4
- data.tar.gz: fa8137a4f8955c8afc8b820fd4791fc16c5be9a1f31a6a9211d730ae5d887f4f
3
+ metadata.gz: 5bd1331922554cde2867fc8cdb95e6b11af69e7ceced2c29cdebece53e159760
4
+ data.tar.gz: 1fe39ac6b0a7e41cde31d8f8b5eaefa5d6ec586f34bd9bd1971637d748ce214b
5
5
  SHA512:
6
- metadata.gz: ce2b4d1885cf40b43a71310eed93bfec54b6ff5e3f94ccfdb9720dfe7502d3f23b0381d3ee9f772a3eb5571221a6c145bfdef1276af496a7e3dc7b002f7f583f
7
- data.tar.gz: 7a82176eff7a8b6a5e28e3f309a3c16f8d77de0985310f333d2c99102115f76da364a68a8de68a960056db0a038a0a14b56ff4b1e00687e68d268f98929655de
6
+ metadata.gz: a1d45063a823616df6e8247eb8a4fc1af4eb1e68655f1c9651c9fd00a3801da7ff278027db7a3aba9da88a1aa8ca6fe6446a768e9c7f273640e13bd1d3cf23bc
7
+ data.tar.gz: 861959a9cbd289ce65fbdca462354ceb68726afcd146e4dc0d3dc196bea556861f5ecfc702cedd2f4725c0884540f91c390acc068a4e95b0f2fd9a3ef9cc1249
data/README.md CHANGED
@@ -16,6 +16,56 @@ upload ipa/apk to aliyun oos server, and scan QRcode to install app on mobile ph
16
16
 
17
17
  **Note to author:** Add a more detailed description about this plugin here. If your plugin contains multiple actions, make sure to mention them here.
18
18
 
19
+
20
+ 支持Mac和Windows <br>
21
+
22
+ ---
23
+ MacOS平台:<br>
24
+ Make sure you have the latest version of the Xcode command line tools installed:
25
+
26
+ ```
27
+ xcode-select --install
28
+ ```
29
+
30
+ Install _fastlane_ using
31
+ ```
32
+ [sudo] gem install fastlane -NV
33
+ ```
34
+ or alternatively using `brew cask install fastlane`
35
+
36
+ Windows平台:<br>
37
+ 1、Install ruby on your windows machine. ([不知道如何安装ruby?](https://www.runoob.com/ruby/ruby-installation-windows.html)) <br>
38
+ 2、Go to your command line and type `gem install fastlane -NV`. <br>
39
+ 3、You have fastlane on your windows machine ready. <br>
40
+ 参考:https://stackoverflow.com/questions/43797206/fastlane-windows-cannot-installing <br>
41
+
42
+
43
+ MacOS & Windows环境配置好后,需要安装fastlane插件以支持iOS、Android个性化定制功能 <br>
44
+ * `gem 'fastlane-plugin-versioning'`
45
+ * `gem 'fastlane-plugin-appicon'`
46
+ * `gem 'fastlane-plugin-changelog'`
47
+ * `gem 'fastlane-plugin-pgyer'`
48
+ * `gem 'fastlane-plugin-alioss'`
49
+ * `gem 'fastlane-plugin-versioning_android'`
50
+ <br>
51
+ 不安装这些,首次使用命令时会自动安装 <br>
52
+
53
+ ---
54
+
55
+ `Gemfile`文件需要添加阿里云ruby SDK `gem 'aliyun-sdk', '~> 0.3.0'` <br>
56
+
57
+ 关于阿里云OSS文件服务器最终目录结构介绍:<br>
58
+ ![阿里云OSS目录结构图01](doc/001.png)<br>
59
+ ![阿里云OSS目录结构图01](doc/002.png)<br>
60
+ ![阿里云OSS目录结构图01](doc/003.png)<br>
61
+ ![阿里云OSS目录结构图01](doc/004.png)<br>
62
+ ![阿里云OSS目录结构图01](doc/005.png)<br>
63
+
64
+ 参考文档:[react-native fastlane自动化构建分发应用管理工具for iOS and Android(去掉RN即可移植到自己的项目)](https://www.cnblogs.com/wood-life/p/10649619.html) <br>
65
+
66
+ [完整的fastlane配置for iOS/Android](doc/fastlane配置.zip) <br>
67
+
68
+
19
69
  ## Example
20
70
 
21
71
  Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
@@ -93,19 +93,26 @@ module Fastlane
93
93
  case File.extname(filename)
94
94
  when ".ipa"
95
95
  bucket_path = "#{path_for_app_name}/iOS"
96
+ # 如果无法从lane_context中获取则从实际的ipa文件中读取
97
+ if build_number.nil? || version_number.nil?
98
+ build_number = GetIpaInfoPlistValueAction.run(ipa: build_file, key: 'CFBundleVersion')
99
+ version_number = GetIpaInfoPlistValueAction.run(ipa: build_file, key: 'CFBundleShortVersionString')
100
+ end
96
101
  when ".apk"
97
102
  bucket_path = "#{path_for_app_name}/Android"
98
103
  # versionName、versionCode先从output.json文件里取
99
104
  apk_output_json_path = File.join(File.dirname(build_file), "output.json")
100
105
  if File.readable?(apk_output_json_path)
101
106
  apk_output_json = JSON.parse(File.read(apk_output_json_path))
102
- build_number = apk_output_json.first["apkInfo"]["versionCode"]
103
- version_number = apk_output_json.first["apkInfo"]["versionName"]
107
+ if !apk_output_json.first.nil? && !apk_output_json.first["apkInfo"].nil?
108
+ build_number = apk_output_json.first["apkInfo"]["versionCode"]
109
+ version_number = apk_output_json.first["apkInfo"]["versionName"]
110
+ end
104
111
  end
105
112
  # 如果output.json文件里取不到则从Actions.lane_context中取
106
113
  if build_number.nil? || version_number.nil?
107
114
  if Actions.lane_context[:ANDROID_VERSION_NAME].nil? || Actions.lane_context[:ANDROID_VERSION_CODE].nil?
108
- UI.important "Actions.lane_context 不包含[ANDROID_VERSION_NAME, ANDROID_VERSION_CODE],请配置fastlane env"
115
+ UI.important "Actions.lane_context 不包含[ANDROID_VERSION_NAME, ANDROID_VERSION_CODE],请配置fastlane env(推荐在Fastlane文件中使用fastlane-plugin-versioning_android获取versionCode/versionName)。"
109
116
  else
110
117
  build_number = Actions.lane_context[SharedValues::ANDROID_VERSION_CODE]
111
118
  version_number = Actions.lane_context[SharedValues::ANDROID_VERSION_NAME]
@@ -152,7 +159,6 @@ module Fastlane
152
159
  UI.message "配置 manifest.plist ..."
153
160
  app_name = GetIpaInfoPlistValueAction.run(ipa: build_file, key: 'CFBundleDisplayName')
154
161
  app_identifier = GetIpaInfoPlistValueAction.run(ipa: build_file, key: 'CFBundleIdentifier')
155
- version_number = GetIpaInfoPlistValueAction.run(ipa: build_file, key: 'CFBundleShortVersionString')
156
162
  download_url = download_url
157
163
  UI.message "app_name: #{app_name}"
158
164
  UI.message "app_identifier: #{app_identifier}"
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Alioss
3
- VERSION = "0.1.4"
3
+ VERSION = "0.1.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-alioss
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - woodwu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-29 00:00:00.000000000 Z
11
+ date: 2019-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry