fastlane-plugin-stream_actions 0.3.8 → 0.3.10

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: 8cf8c89953439e975b0d5cc0e9ff812333ae98dc98f96f56c048eb250086ed65
4
- data.tar.gz: 410f750afd25956d617c6648c34955c62c797287ac2268c6751e70156a2bfaaa
3
+ metadata.gz: b79f6dff0348e86b6e0c99905b3dbe290315bdd6463b58e7f3d4ae16624e5be0
4
+ data.tar.gz: 4d5a2f46f4dab3244265f00225d4e27c11b40e48f40415bc5b65ec65ba3c6954
5
5
  SHA512:
6
- metadata.gz: 073a4c84712c404e6dabae2d25b026631a3a7c93d78405016169334e989dafcd65b4305c92169965a3894adfe24cf02c302f97d47bb696e146a298355f33dbbd
7
- data.tar.gz: dad55328909212291c24bf0432ec966b76399905989b5e470d6b6ac8eb445bebb66bd64198ad88dce0085764b2dd83cac0db71985797a6725c3db170fa7521f7
6
+ metadata.gz: 102bf95950869523ad1bfd0c1a10d3860845521f2ed6fdbd3461886d695a65149cb6a0078c5715fe860af8e66ff921fe6f31c9bb29e060be9bdf49815aef1d37
7
+ data.tar.gz: 5c471b093fb45cf98ad819d4625a9cad46c4152aac9bdfa1912438df822f9130230354f34e91741c01be0a7817a323ba0b2cf44c8acf6d2a46b54d714458ae25
@@ -0,0 +1,179 @@
1
+ module Fastlane
2
+ module Actions
3
+ module SharedValues
4
+ SIMULATOR_APP_OUTPUT_PATH ||= :SIMULATOR_APP_OUTPUT_PATH
5
+ end
6
+
7
+ class BuildAppForIosSimulatorAction < Action
8
+ def self.run(params)
9
+ params[:platform] = verify_destination(params)
10
+ params[:xcargs] = update_xcargs(params)
11
+ params[:archive] = nil if params[:archive]
12
+ params[:configuration] = 'Debug' unless params[:configuration]
13
+ params[:derivedDataPath] = params[:derived_data_path] if params[:derived_data_path]
14
+
15
+ clean(params)
16
+
17
+ XcodebuildAction.run(params)
18
+
19
+ new_path = copy_app(params)
20
+
21
+ provide_shared_values(new_path)
22
+ new_path
23
+ end
24
+
25
+ def self.clean(params)
26
+ if params[:output_directory]
27
+ FastlaneCore::UI.important('🧹 Clearing output directory.')
28
+ FileUtils.rm_rf(params[:output_directory])
29
+ end
30
+
31
+ path = "./#{params[:scheme]}.app"
32
+ if File.directory?(path)
33
+ FastlaneCore::UI.important('🧹 Removing previous build.')
34
+ FileUtils.rm_rf(path)
35
+ end
36
+
37
+ path = "build/#{params[:scheme]}.app"
38
+ if File.directory?(path)
39
+ FastlaneCore::UI.important('🧹 Removing previous build.')
40
+ FileUtils.rm_rf(path)
41
+ end
42
+ end
43
+
44
+ def self.update_xcargs(params)
45
+ if params[:xcargs] && params[:xcargs].include?('destination')
46
+ FastlaneCore::UI.important(
47
+ '🎭 Overwriting `xcargs` option for safety reasons. Consider excluding `-destination` argument from it.'
48
+ )
49
+ params[:xcargs] = ''
50
+ end
51
+
52
+ platform = available_destinations[params[:platform]][:destination]
53
+ destination = "-destination 'generic/platform=#{platform}'"
54
+ products_path = "-IDECustomBuildProductsPath='#{products_path(params)}'"
55
+ if params[:derived_data_path]
56
+ "#{params[:xcargs]} #{products_path} #{destination}"
57
+ else
58
+ derived_data_path = "-derivedDataPath '#{products_path(params)}'"
59
+ "#{params[:xcargs]} #{products_path} #{destination} #{derived_data_path}"
60
+ end
61
+ end
62
+
63
+ def self.products_path(params)
64
+ params[:output_directory] || 'build'
65
+ end
66
+
67
+ def self.copy_app(params)
68
+ platform = available_destinations[params[:platform]][:folder]
69
+ postfix = "#{params[:configuration]}-#{platform}/#{params[:scheme]}.app"
70
+ products_path = products_path(params)
71
+
72
+ products_app_path =
73
+ if params[:project]
74
+ "#{File.dirname(File.expand_path(params[:project]))}/#{products_path}/#{postfix}"
75
+ elsif params[:workspace]
76
+ "#{File.dirname(File.expand_path(params[:workspace]))}/#{products_path}/#{postfix}"
77
+ else
78
+ "#{Dir.pwd}/#{products_path}/#{postfix}"
79
+ end
80
+
81
+ derived_data_app_path =
82
+ if params[:derived_data_path]
83
+ "#{params[:derived_data_path]}/Build/Products/#{postfix}"
84
+ else
85
+ "#{Dir.pwd}/#{products_path}/Build/Products/#{postfix}"
86
+ end
87
+
88
+ app_path = File.directory?(derived_data_app_path) ? derived_data_app_path : products_app_path
89
+
90
+ if params[:output_directory]
91
+ FileUtils.mkdir_p(params[:output_directory])
92
+ FileUtils.cp_r(app_path, params[:output_directory])
93
+ "#{params[:output_directory]}/#{params[:scheme]}.app"
94
+ else
95
+ FileUtils.rm_rf("#{params[:scheme]}.app")
96
+ FileUtils.cp_r(app_path, './')
97
+ "./#{params[:scheme]}.app"
98
+ end
99
+ end
100
+
101
+ def self.verify_destination(params)
102
+ case params[:platform]
103
+ when 'iOS', nil
104
+ :iOS
105
+ when 'tvOS'
106
+ :tvOS
107
+ when 'watchOS'
108
+ :watchOS
109
+ else
110
+ FastlaneCore::UI.user_error!(
111
+ "🔬 Unrecognized platform: '#{params[:platform]}'. Available: 'iOS', 'tvOS' and 'watchOS'"
112
+ )
113
+ end
114
+ end
115
+
116
+ def self.available_destinations
117
+ {
118
+ iOS: { destination: 'iOS Simulator', folder: 'iphonesimulator' },
119
+ tvOS: { destination: 'tvOS Simulator', folder: 'appletvsimulator' },
120
+ watchOS: { destination: 'watchOS Simulator', folder: 'applewatchsimulator' }
121
+ }
122
+ end
123
+
124
+ def self.provide_shared_values(path)
125
+ Actions.lane_context[SharedValues::SIMULATOR_APP_OUTPUT_PATH] = File.expand_path(path)
126
+ ENV[SharedValues::SIMULATOR_APP_OUTPUT_PATH.to_s] = File.expand_path(path)
127
+ end
128
+
129
+ #####################################################
130
+ # Documentation #
131
+ #####################################################
132
+
133
+ def self.description
134
+ "This plugin builds apps exclusively for iOS, tvOS or watchOS Simulators."
135
+ end
136
+
137
+ def self.example_code
138
+ [
139
+ build_app_for_simulator(
140
+ scheme: 'sample-app',
141
+ project: 'sample-app/sample-app.xcodeproj',
142
+ configuration: 'Release',
143
+ output_directory: 'build'
144
+ )
145
+ ]
146
+ end
147
+
148
+ def self.output
149
+ [
150
+ ['SIMULATOR_APP_OUTPUT_PATH', 'The path to the newly generated app file']
151
+ ]
152
+ end
153
+
154
+ def self.available_options
155
+ XcodebuildAction.available_options + [
156
+ ['output_directory', 'The directory in which the app file should be stored in'],
157
+ ['workspace', 'Path to the workspace file'],
158
+ ['project', 'Path to the project file'],
159
+ ['scheme', "The project's scheme. Make sure it's marked as `Shared`"],
160
+ ['platform', "Use a custom simulator destination for building the app (iOS, tvOS or watchOS)"],
161
+ ['configuration', 'The configuration to use when building the app. Defaults to "Release"'],
162
+ ['derived_data_path', 'The directory where built products and other derived data will go'],
163
+ ['result_bundle_path', 'Path to the result bundle directory to create'],
164
+ ['buildlog_path', 'The directory where to store the build log'],
165
+ ['raw_buildlog', 'Set to true to see xcodebuild raw output'],
166
+ ['xcargs', "Pass additional xcodebuild options. Be sure to quote the setting names and values e.g. OTHER_LDFLAGS='-ObjC -lstdc++'"]
167
+ ]
168
+ end
169
+
170
+ def self.category
171
+ :building
172
+ end
173
+
174
+ def self.is_supported?(platform)
175
+ [:ios, :tvos, :watchos].include?(platform)
176
+ end
177
+ end
178
+ end
179
+ end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module StreamActions
3
- VERSION = '0.3.8'
3
+ VERSION = '0.3.10'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-stream_actions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
4
+ version: 0.3.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - GetStream
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-22 00:00:00.000000000 Z
11
+ date: 2023-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: xctest_list
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 1.2.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 1.2.1
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: bundler
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -206,20 +220,6 @@ dependencies:
206
220
  - - ">="
207
221
  - !ruby/object:Gem::Version
208
222
  version: '0'
209
- - !ruby/object:Gem::Dependency
210
- name: xctest_list
211
- requirement: !ruby/object:Gem::Requirement
212
- requirements:
213
- - - '='
214
- - !ruby/object:Gem::Version
215
- version: 1.2.1
216
- type: :development
217
- prerelease: false
218
- version_requirements: !ruby/object:Gem::Requirement
219
- requirements:
220
- - - '='
221
- - !ruby/object:Gem::Version
222
- version: 1.2.1
223
223
  description:
224
224
  email: alexey.alterpesotskiy@getstream.io
225
225
  executables: []
@@ -232,6 +232,7 @@ files:
232
232
  - lib/fastlane/plugin/stream_actions/actions/allure_create_launch.rb
233
233
  - lib/fastlane/plugin/stream_actions/actions/allure_create_testcase.rb
234
234
  - lib/fastlane/plugin/stream_actions/actions/allure_run_testplan.rb
235
+ - lib/fastlane/plugin/stream_actions/actions/build_app_for_ios_simulator.rb
235
236
  - lib/fastlane/plugin/stream_actions/actions/custom_match.rb
236
237
  - lib/fastlane/plugin/stream_actions/actions/is_check_required.rb
237
238
  - lib/fastlane/plugin/stream_actions/actions/pod_push_safely.rb