apprepo 0.0.6 → 0.0.8
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 +11 -9
- data/lib/apprepo.rb +12 -25
- data/lib/apprepo/analyser.rb +26 -0
- data/lib/apprepo/commands_generator.rb +50 -39
- data/lib/apprepo/detect_values.rb +8 -20
- data/lib/apprepo/loader.rb +4 -2
- data/lib/apprepo/manifest.rb +9 -2
- data/lib/apprepo/options.rb +34 -14
- data/lib/apprepo/runner.rb +20 -19
- data/lib/apprepo/setup.rb +8 -9
- data/lib/apprepo/uploader.rb +208 -124
- data/lib/apprepo/version.rb +3 -3
- metadata +5 -28
- data/lib/apprepo/download_metadata.rb +0 -44
- data/lib/apprepo/upload_assets.rb +0 -22
- data/lib/apprepo/upload_descriptor.rb +0 -12
- data/lib/apprepo/upload_metadata.rb +0 -192
data/lib/apprepo/version.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module AppRepo
|
2
|
-
VERSION = '0.0.
|
3
|
-
DESCRIPTION = 'Upload icon,
|
4
|
-
SUMMARY = 'Upload icon,
|
2
|
+
VERSION = '0.0.8'.freeze
|
3
|
+
DESCRIPTION = 'Upload icon, manifest.json and your app to the T-Mobile Enterprise AppRepo and notify users on updaet using a single command'.freeze
|
4
|
+
SUMMARY = 'Upload icon, manifest and your app to SFTP'.freeze
|
5
5
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apprepo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Felix Krause
|
@@ -18,9 +18,6 @@ dependencies:
|
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '0'
|
21
|
-
- - "<"
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version: 2.0.0
|
24
21
|
type: :runtime
|
25
22
|
prerelease: false
|
26
23
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -28,9 +25,6 @@ dependencies:
|
|
28
25
|
- - "~>"
|
29
26
|
- !ruby/object:Gem::Version
|
30
27
|
version: '0'
|
31
|
-
- - "<"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 2.0.0
|
34
28
|
- !ruby/object:Gem::Dependency
|
35
29
|
name: fastlane_core
|
36
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -267,21 +261,7 @@ dependencies:
|
|
267
261
|
- - "~>"
|
268
262
|
- !ruby/object:Gem::Version
|
269
263
|
version: '0'
|
270
|
-
-
|
271
|
-
name: fastlane
|
272
|
-
requirement: !ruby/object:Gem::Requirement
|
273
|
-
requirements:
|
274
|
-
- - "~>"
|
275
|
-
- !ruby/object:Gem::Version
|
276
|
-
version: '1.89'
|
277
|
-
type: :development
|
278
|
-
prerelease: false
|
279
|
-
version_requirements: !ruby/object:Gem::Requirement
|
280
|
-
requirements:
|
281
|
-
- - "~>"
|
282
|
-
- !ruby/object:Gem::Version
|
283
|
-
version: '1.89'
|
284
|
-
description: Upload icon, metadata and your app to the T-Mobile Enterprise AppRepo
|
264
|
+
description: Upload icon, manifest.json and your app to the T-Mobile Enterprise AppRepo
|
285
265
|
and notify users on updaet using a single command
|
286
266
|
email:
|
287
267
|
- suculent@me.com
|
@@ -292,17 +272,14 @@ files:
|
|
292
272
|
- LICENSE
|
293
273
|
- README.md
|
294
274
|
- lib/apprepo.rb
|
275
|
+
- lib/apprepo/analyser.rb
|
295
276
|
- lib/apprepo/commands_generator.rb
|
296
277
|
- lib/apprepo/detect_values.rb
|
297
|
-
- lib/apprepo/download_metadata.rb
|
298
278
|
- lib/apprepo/loader.rb
|
299
279
|
- lib/apprepo/manifest.rb
|
300
280
|
- lib/apprepo/options.rb
|
301
281
|
- lib/apprepo/runner.rb
|
302
282
|
- lib/apprepo/setup.rb
|
303
|
-
- lib/apprepo/upload_assets.rb
|
304
|
-
- lib/apprepo/upload_descriptor.rb
|
305
|
-
- lib/apprepo/upload_metadata.rb
|
306
283
|
- lib/apprepo/uploader.rb
|
307
284
|
- lib/apprepo/version.rb
|
308
285
|
homepage: https://github.com/suculent/apprepo
|
@@ -328,7 +305,7 @@ rubyforge_project:
|
|
328
305
|
rubygems_version: 2.6.1
|
329
306
|
signing_key:
|
330
307
|
specification_version: 4
|
331
|
-
summary: Upload icon,
|
332
|
-
notify users on updaet using a single command
|
308
|
+
summary: Upload icon, manifest.json and your app to the T-Mobile Enterprise AppRepo
|
309
|
+
and notify users on updaet using a single command
|
333
310
|
test_files: []
|
334
311
|
has_rdoc:
|
@@ -1,44 +0,0 @@
|
|
1
|
-
module AppRepo
|
2
|
-
class DownloadMetadata
|
3
|
-
def self.run(options, path)
|
4
|
-
UI.message('Downloading existing metadata.json...')
|
5
|
-
download(options, path)
|
6
|
-
UI.success('Successfully downloaded all metadata')
|
7
|
-
rescue => ex
|
8
|
-
UI.error(ex)
|
9
|
-
UI.error("Couldn't download already existing metadata from AppRepo.")
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.download(_options, _folder_path)
|
13
|
-
UI.message('TODO: DOWNLOAD existing metadata.json NOT IMPLEMENTED')
|
14
|
-
|
15
|
-
# v = options[:app].latest_version
|
16
|
-
|
17
|
-
# v.screenshots.each do |language, screenshots|
|
18
|
-
# screenshots.each do |screenshot|
|
19
|
-
# file_name = [screenshot.sort_order, screenshot.device_type, screenshot.sort_order].join("_")
|
20
|
-
# original_file_extension = File.basename(screenshot.original_file_name)
|
21
|
-
# file_name += "." + original_file_extension
|
22
|
-
|
23
|
-
# UI.message("Downloading existing screenshot '#{file_name}'")
|
24
|
-
|
25
|
-
# # If the screen shot is for an appleTV we need to store it in a way that we'll know it's an appleTV
|
26
|
-
# # screen shot later as the screen size is the same as an iPhone 6 Plus in landscape.
|
27
|
-
# if screenshot.device_type == "appleTV"
|
28
|
-
# containing_folder = File.join(folder_path, "appleTV", screenshot.language)
|
29
|
-
# else
|
30
|
-
# containing_folder = File.join(folder_path, screenshot.language)
|
31
|
-
# end
|
32
|
-
|
33
|
-
# begin
|
34
|
-
# FileUtils.mkdir_p(containing_folder)
|
35
|
-
# rescue
|
36
|
-
# # if it's already there
|
37
|
-
# end
|
38
|
-
# path = File.join(containing_folder, file_name)
|
39
|
-
# File.write(path, open(screenshot.url).read)
|
40
|
-
# end
|
41
|
-
# end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
module AppRepo
|
2
|
-
class UploadAssets
|
3
|
-
def upload(options)
|
4
|
-
app = options[:app]
|
5
|
-
|
6
|
-
v = app.edit_version
|
7
|
-
UI.user_error!("Could not find a version to edit for app '#{app.name}'") unless v
|
8
|
-
|
9
|
-
if options[:app_icon]
|
10
|
-
UI.message('Uploading app icon...')
|
11
|
-
v.upload_large_icon!(options[:app_icon])
|
12
|
-
end
|
13
|
-
|
14
|
-
if options[:apple_watch_app_icon]
|
15
|
-
UI.message('Uploading apple watchapp icon...')
|
16
|
-
v.upload_watch_icon!(options[:apple_watch_app_icon])
|
17
|
-
end
|
18
|
-
|
19
|
-
v.save!
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
module AppRepo
|
2
|
-
class UploadDescriptor
|
3
|
-
attr_accessor :appcode # required
|
4
|
-
attr_accessor :ipa # can be inferred anyway (glob or metadata)
|
5
|
-
attr_accessor :metadata # optional, allows re-uploading same binary without metadata change
|
6
|
-
|
7
|
-
def initialize(appcode)
|
8
|
-
self.appcode = appcode
|
9
|
-
UI.message('Initializing "AppRepo:UploadDescriptor with appcode "' + self.appcode + '"')
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
@@ -1,192 +0,0 @@
|
|
1
|
-
module AppRepo
|
2
|
-
# upload description, rating, etc.
|
3
|
-
class UploadMetadata
|
4
|
-
# All the localised values attached to the version
|
5
|
-
LOCALISED_VERSION_VALUES = [:description, :keywords, :release_notes, :support_url, :marketing_url].freeze
|
6
|
-
|
7
|
-
# Everything attached to the version but not being localised
|
8
|
-
NON_LOCALISED_VERSION_VALUES = [:copyright].freeze
|
9
|
-
|
10
|
-
# Localised app details values
|
11
|
-
LOCALISED_APP_VALUES = [:name, :privacy_url].freeze
|
12
|
-
|
13
|
-
# Non localized app details values
|
14
|
-
NON_LOCALISED_APP_VALUES = [:primary_category, :secondary_category,
|
15
|
-
:primary_first_sub_category, :primary_second_sub_category,
|
16
|
-
:secondary_first_sub_category, :secondary_second_sub_category
|
17
|
-
].freeze
|
18
|
-
|
19
|
-
# Make sure to call `load_from_filesystem` before calling upload
|
20
|
-
def upload(options)
|
21
|
-
return if options[:skip_metadata]
|
22
|
-
verify_available_languages!(options)
|
23
|
-
|
24
|
-
app = options[:app]
|
25
|
-
|
26
|
-
details = app.details
|
27
|
-
v = app.edit_version
|
28
|
-
|
29
|
-
(LOCALISED_VERSION_VALUES + LOCALISED_APP_VALUES).each do |key|
|
30
|
-
current = options[key]
|
31
|
-
next unless current
|
32
|
-
|
33
|
-
unless current.is_a?(Hash)
|
34
|
-
UI.error("Error with provided '#{key}'. Must be a hash, the key being the language.")
|
35
|
-
next
|
36
|
-
end
|
37
|
-
|
38
|
-
current.each do |language, value|
|
39
|
-
next unless value.to_s.length > 0
|
40
|
-
strip_value = value.to_s.strip
|
41
|
-
v.send(key)[language] = strip_value if LOCALISED_VERSION_VALUES.include?(key)
|
42
|
-
details.send(key)[language] = strip_value if LOCALISED_APP_VALUES.include?(key)
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
(NON_LOCALISED_VERSION_VALUES + NON_LOCALISED_APP_VALUES).each do |key|
|
47
|
-
current = options[key].to_s.strip
|
48
|
-
next unless current.to_s.length > 0
|
49
|
-
v.send("#{key}=", current) if NON_LOCALISED_VERSION_VALUES.include?(key)
|
50
|
-
details.send("#{key}=", current) if NON_LOCALISED_APP_VALUES.include?(key)
|
51
|
-
end
|
52
|
-
|
53
|
-
v.release_on_approval = options[:automatic_release]
|
54
|
-
|
55
|
-
set_review_information(v, options)
|
56
|
-
set_app_rating(v, options)
|
57
|
-
|
58
|
-
UI.message('Uploading metadata to iTunes Connect')
|
59
|
-
v.save!
|
60
|
-
details.save!
|
61
|
-
UI.success('Successfully uploaded initial set of metadata to iTunes Connect')
|
62
|
-
end
|
63
|
-
|
64
|
-
# If the user is using the 'default' language, then assign values where they are needed
|
65
|
-
def assign_defaults(options)
|
66
|
-
# Build a complete list of the required languages
|
67
|
-
enabled_languages = []
|
68
|
-
|
69
|
-
# Get all languages used in existing settings
|
70
|
-
(LOCALISED_VERSION_VALUES + LOCALISED_APP_VALUES).each do |key|
|
71
|
-
current = options[key]
|
72
|
-
next unless current && current.is_a?(Hash)
|
73
|
-
current.each do |language, _value|
|
74
|
-
enabled_languages << language unless enabled_languages.include?(language)
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
# Check folder list (an empty folder signifies a language is required)
|
79
|
-
Dir.glob(File.join(options[:metadata_path], '*')).each do |lng_folder|
|
80
|
-
next unless File.directory?(lng_folder) # We don't want to read txt as they are non localised
|
81
|
-
|
82
|
-
language = File.basename(lng_folder)
|
83
|
-
enabled_languages << language unless enabled_languages.include?(language)
|
84
|
-
end
|
85
|
-
|
86
|
-
return unless enabled_languages.include?('default')
|
87
|
-
UI.message('Detected languages: ' + enabled_languages.to_s)
|
88
|
-
|
89
|
-
(LOCALISED_VERSION_VALUES + LOCALISED_APP_VALUES).each do |key|
|
90
|
-
current = options[key]
|
91
|
-
next unless current && current.is_a?(Hash)
|
92
|
-
|
93
|
-
default = current['default']
|
94
|
-
next if default.nil?
|
95
|
-
|
96
|
-
enabled_languages.each do |language|
|
97
|
-
value = current[language]
|
98
|
-
next unless value.nil?
|
99
|
-
|
100
|
-
current[language] = default
|
101
|
-
end
|
102
|
-
current.delete('default')
|
103
|
-
end
|
104
|
-
end
|
105
|
-
|
106
|
-
# Makes sure all languages we need are actually created
|
107
|
-
def verify_available_languages!(options)
|
108
|
-
return if options[:skip_metadata]
|
109
|
-
|
110
|
-
# Collect all languages we need
|
111
|
-
# We only care about languages from user provided values
|
112
|
-
# as the other languages are on iTC already anyway
|
113
|
-
v = options[:app].edit_version
|
114
|
-
UI.user_error!("Could not find a version to edit for app '#{options[:app].name}', the app metadata is read-only currently") unless v
|
115
|
-
|
116
|
-
enabled_languages = []
|
117
|
-
LOCALISED_VERSION_VALUES.each do |key|
|
118
|
-
current = options[key]
|
119
|
-
next unless current && current.is_a?(Hash)
|
120
|
-
current.each do |language, _value|
|
121
|
-
enabled_languages << language unless enabled_languages.include?(language)
|
122
|
-
end
|
123
|
-
end
|
124
|
-
|
125
|
-
if enabled_languages.count > 0
|
126
|
-
v.create_languages(enabled_languages)
|
127
|
-
lng_text = 'language'
|
128
|
-
lng_text += 's' if enabled_languages.count != 1
|
129
|
-
UI.message("Activating #{lng_text} #{enabled_languages.join(', ')}...")
|
130
|
-
v.save!
|
131
|
-
end
|
132
|
-
true
|
133
|
-
end
|
134
|
-
|
135
|
-
# Loads the metadata files and stores them into the options object
|
136
|
-
def load_from_filesystem(options)
|
137
|
-
return if options[:skip_metadata]
|
138
|
-
|
139
|
-
# Load localised data
|
140
|
-
Loader.language_folders(options[:metadata_path]).each do |lng_folder|
|
141
|
-
language = File.basename(lng_folder)
|
142
|
-
(LOCALISED_VERSION_VALUES + LOCALISED_APP_VALUES).each do |key|
|
143
|
-
path = File.join(lng_folder, "#{key}.txt")
|
144
|
-
next unless File.exist?(path)
|
145
|
-
|
146
|
-
UI.message("Loading '#{path}'...")
|
147
|
-
options[key] ||= {}
|
148
|
-
options[key][language] ||= File.read(path)
|
149
|
-
end
|
150
|
-
end
|
151
|
-
|
152
|
-
# Load non localised data
|
153
|
-
(NON_LOCALISED_VERSION_VALUES + NON_LOCALISED_APP_VALUES).each do |key|
|
154
|
-
path = File.join(options[:metadata_path], "#{key}.txt")
|
155
|
-
next unless File.exist?(path)
|
156
|
-
|
157
|
-
UI.message("Loading '#{path}'...")
|
158
|
-
options[key] ||= File.read(path)
|
159
|
-
end
|
160
|
-
end
|
161
|
-
|
162
|
-
private
|
163
|
-
|
164
|
-
def set_review_information(v, options)
|
165
|
-
return unless options[:app_review_information]
|
166
|
-
info = options[:app_review_information]
|
167
|
-
UI.user_error!('`app_review_information` must be a hash') unless info.is_a?(Hash)
|
168
|
-
|
169
|
-
v.review_first_name = info[:first_name] if info[:first_name]
|
170
|
-
v.review_last_name = info[:last_name] if info[:last_name]
|
171
|
-
v.review_phone_number = info[:phone_number] if info[:phone_number]
|
172
|
-
v.review_email = info[:email_address] if info[:email_address]
|
173
|
-
v.review_demo_user = info[:demo_user] if info[:demo_user]
|
174
|
-
v.review_demo_password = info[:demo_password] if info[:demo_password]
|
175
|
-
v.review_user_needed = (v.review_demo_user.to_s + v.review_demo_password.to_s).length > 0
|
176
|
-
v.review_notes = info[:notes] if info[:notes]
|
177
|
-
end
|
178
|
-
|
179
|
-
def set_app_rating(v, options)
|
180
|
-
return unless options[:app_rating_config_path]
|
181
|
-
|
182
|
-
require 'json'
|
183
|
-
begin
|
184
|
-
json = JSON.parse(File.read(options[:app_rating_config_path]))
|
185
|
-
rescue => ex
|
186
|
-
UI.error(ex.to_s)
|
187
|
-
UI.user_error!("Error parsing JSON file at path '#{options[:app_rating_config_path]}'")
|
188
|
-
end
|
189
|
-
v.update_rating(json)
|
190
|
-
end
|
191
|
-
end
|
192
|
-
end
|