fastlane-plugin-apprepo 0.1.0 → 0.2.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/.coveralls.yml +2 -0
- data/.gitignore +0 -0
- data/.rspec +3 -0
- data/.rubocop.yml +4 -0
- data/Gemfile +7 -1
- data/README.md +9 -2
- data/assets/RepofileDefault +34 -0
- data/assets/apprepo.png +0 -0
- data/assets/circle.key +27 -0
- data/assets/fastlane.png +0 -0
- data/assets/manifest.png +0 -0
- data/circle.yml +11 -9
- data/coverage/.last_run.json +5 -0
- data/coverage/.resultset.json +1244 -0
- data/coverage/.resultset.json.lock +0 -0
- data/fastlane-plugin-apprepo.gemspec +6 -2
- data/fastlane/Appfile +1 -0
- data/fastlane/Fastfile +42 -0
- data/fastlane/Pluginfile +1 -0
- data/fastlane/Repofile +33 -0
- data/greeter.rb +6 -0
- data/lib/fastlane/plugin/apprepo.rb +26 -7
- data/lib/fastlane/plugin/apprepo/actions/apprepo_action.rb +106 -92
- data/lib/fastlane/plugin/apprepo/actions/download_manifest.rb +40 -0
- data/lib/fastlane/plugin/apprepo/actions/init.rb +46 -0
- data/lib/fastlane/plugin/apprepo/actions/rubocop.rb +29 -0
- data/lib/fastlane/plugin/apprepo/actions/run.rb +69 -0
- data/lib/fastlane/plugin/apprepo/actions/submit.rb +41 -0
- data/lib/fastlane/plugin/apprepo/analyser.rb +35 -0
- data/lib/fastlane/plugin/apprepo/command.rb +17 -0
- data/lib/fastlane/plugin/apprepo/commands_generator.rb +121 -0
- data/lib/fastlane/plugin/apprepo/detect_values.rb +29 -0
- data/lib/fastlane/plugin/apprepo/helper/analyser.rb +35 -0
- data/lib/fastlane/plugin/apprepo/helper/commands_generator.rb +121 -0
- data/lib/fastlane/plugin/apprepo/helper/detect_values.rb +29 -0
- data/lib/fastlane/plugin/apprepo/helper/loader.rb +15 -0
- data/lib/fastlane/plugin/apprepo/helper/manifest.rb +44 -0
- data/lib/fastlane/plugin/apprepo/helper/options.rb +120 -0
- data/lib/fastlane/plugin/apprepo/helper/runner.rb +68 -0
- data/lib/fastlane/plugin/apprepo/helper/setup.rb +49 -0
- data/lib/fastlane/plugin/apprepo/helper/uploader.rb +301 -0
- data/lib/fastlane/plugin/apprepo/loader.rb +15 -0
- data/lib/fastlane/plugin/apprepo/manifest.rb +44 -0
- data/lib/fastlane/plugin/apprepo/options.rb +120 -0
- data/lib/fastlane/plugin/apprepo/runner.rb +68 -0
- data/lib/fastlane/plugin/apprepo/setup.rb +49 -0
- data/lib/fastlane/plugin/apprepo/uploader.rb +301 -0
- data/lib/fastlane/plugin/apprepo/version.rb +4 -3
- data/manifest.json +10 -0
- data/sampleapp.ipa +1 -0
- data/test +0 -0
- metadata +46 -2
File without changes
|
@@ -14,9 +14,13 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.homepage = 'https://github.com/suculent/fastlane-plugin-apprepo'
|
15
15
|
spec.license = 'MIT'
|
16
16
|
|
17
|
-
|
17
|
+
spec_files = `git ls-files -z`.split("\x0").reject do |f|
|
18
|
+
f.match(%r{^(test|spec|features)/})
|
19
|
+
end
|
20
|
+
|
21
|
+
spec.files = spec_files
|
18
22
|
spec.require_paths = ['lib']
|
19
|
-
|
23
|
+
|
20
24
|
spec.add_development_dependency 'json', '= 1.8.1'
|
21
25
|
spec.add_development_dependency 'rspec', '~> 3.4', '>= 3.4.0'
|
22
26
|
spec.add_development_dependency 'fastlane', '~> 1.89'
|
data/fastlane/Appfile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
package_name "com.suculent.Apprepo-fastlane-plugin"
|
data/fastlane/Fastfile
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
fastlane_version "1.90.0"
|
2
|
+
|
3
|
+
default_platform :mac
|
4
|
+
|
5
|
+
platform :mac do
|
6
|
+
before_all do
|
7
|
+
ENV["SLACK_URL"] = "https://hooks.slack.com/services/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"
|
8
|
+
end
|
9
|
+
|
10
|
+
desc "Runs all the tests"
|
11
|
+
lane :test do
|
12
|
+
sh "rspec .."
|
13
|
+
end
|
14
|
+
|
15
|
+
desc "Build a RubyGem"
|
16
|
+
lane :build do
|
17
|
+
sh "gem build ../fastlane-plugin-apprepo.gemspec"
|
18
|
+
end
|
19
|
+
|
20
|
+
desc "Deploy a new version to the RubyGems.org"
|
21
|
+
lane :deploy do
|
22
|
+
sh "gem push ../fastlane-plugin-apprepo-0.1.0.gem"
|
23
|
+
|
24
|
+
slack(
|
25
|
+
message: "Successfully deployed new Fastlane Plugin Update."
|
26
|
+
)
|
27
|
+
end
|
28
|
+
|
29
|
+
after_all do |lane|
|
30
|
+
# This block is called, only if the executed lane was successful
|
31
|
+
#slack(
|
32
|
+
# message: "Successfully deployed new Fastlane Plugin Update."
|
33
|
+
#)
|
34
|
+
end
|
35
|
+
|
36
|
+
error do |lane, exception|
|
37
|
+
slack(
|
38
|
+
message: exception.message,
|
39
|
+
success: false
|
40
|
+
)
|
41
|
+
end
|
42
|
+
end
|
data/fastlane/Pluginfile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
#gem "fastlane-plugin-apprepo"
|
data/fastlane/Repofile
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
###################### More Options ######################
|
2
|
+
# If you want to have even more control, check out the documentation
|
3
|
+
# https://github.com/suculent/apprepo/blob/master/Repofile.md
|
4
|
+
|
5
|
+
###################### Automatically generated ######################
|
6
|
+
# Feel free to remove the following line if you use fastlane (which you should)
|
7
|
+
|
8
|
+
app_identifier "com.apprepo.test" # your app's bundle identifier
|
9
|
+
ipa "./sampleapp.ipa" # can be overriden with --ipa
|
10
|
+
manifest_path "./manifest.json" # Path to the manifest.json you want to use.
|
11
|
+
|
12
|
+
#
|
13
|
+
# Authentication
|
14
|
+
#
|
15
|
+
|
16
|
+
# You can use your '~/.ssh/config' file to setup RSA keys to AppRepo, or use following options:
|
17
|
+
|
18
|
+
|
19
|
+
repo_url "107.22.101.216" # repo.teacloud.net
|
20
|
+
repo_user "circle"
|
21
|
+
repo_key "assets/circle.key"
|
22
|
+
# repo_key "/Users/sychram/.ssh/circle.key" # should have 'chmod 600'
|
23
|
+
|
24
|
+
notify true # Add this to automatically notify the AppRepo users after uploading metadata/binary.
|
25
|
+
|
26
|
+
# Optionals
|
27
|
+
|
28
|
+
app_version "0.1"
|
29
|
+
app_icon "./assets/apprepo.png"
|
30
|
+
appcode "APPREPO"
|
31
|
+
repo_title "TestApp"
|
32
|
+
repo_description "Some description is required for AppRepo users to know, that is this app."
|
33
|
+
repo_summary "Experimental Fastlane Extension"
|
data/greeter.rb
ADDED
@@ -1,17 +1,36 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# encoding: utf-8
|
4
|
+
|
5
|
+
require 'json'
|
6
|
+
require 'fastlane'
|
7
|
+
require 'fastlane_core'
|
8
|
+
|
9
|
+
require_relative 'apprepo/version'
|
3
10
|
|
4
11
|
module Fastlane
|
12
|
+
# Root module of the plugin (seems like a class-loader)
|
5
13
|
module Apprepo
|
6
14
|
# Return all .rb files inside the "actions" and "helper" directory
|
7
15
|
def self.all_classes
|
8
16
|
Dir[File.expand_path('*/{actions,helper}/*.rb', File.dirname(__FILE__))]
|
9
17
|
end
|
10
18
|
end
|
11
|
-
end
|
12
19
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
20
|
+
Encoding.default_external = Encoding::UTF_8
|
21
|
+
Encoding.default_internal = Encoding::UTF_8
|
22
|
+
|
23
|
+
# By default we want to import all available actions and helpers
|
24
|
+
# A plugin can contain any number of actions and plugins
|
25
|
+
Fastlane::Apprepo.all_classes.each do |current|
|
26
|
+
require current
|
27
|
+
end
|
28
|
+
|
29
|
+
# Test only, should be removed...
|
30
|
+
UI.message('Initializing new CommandsGenerator')
|
31
|
+
cgen = Apprepo::CommandsGenerator.new
|
32
|
+
UI.message('Downloading Manifest...')
|
33
|
+
cgen.download_manifest
|
34
|
+
UI.message('Running Deployment...')
|
35
|
+
cgen.run
|
17
36
|
end
|
@@ -2,125 +2,139 @@ require 'fastlane'
|
|
2
2
|
|
3
3
|
module Fastlane
|
4
4
|
module Actions
|
5
|
+
# Action subclass for the Fastlane plugin
|
6
|
+
|
7
|
+
# rubocop:disable Metrics/AbcSize
|
8
|
+
# rubocop:disable Metrics/AbcSize
|
9
|
+
# rubocop:disable Metrics/MethodLength
|
10
|
+
# rubocop:disable Metrics/CyclomaticComplexity
|
11
|
+
# rubocop:disable Metrics/PerceivedComplexity
|
5
12
|
class ApprepoAction < Action
|
6
|
-
def self.run(
|
7
|
-
require '
|
13
|
+
def self.run(_params)
|
14
|
+
require 'Apprepo'
|
8
15
|
|
9
16
|
if defined?(::Apprepo::Command::Make)
|
10
|
-
|
11
|
-
|
17
|
+
# New `Apprepo make` command
|
18
|
+
puts 'New `Apprepo make` command'
|
12
19
|
::Apprepo::Command::Make.run
|
13
20
|
|
14
21
|
else
|
15
|
-
|
16
|
-
|
22
|
+
# Legacy `Apprepo` command
|
23
|
+
puts 'Legacy `Apprepo` command'
|
17
24
|
::Apprepo::Command.run
|
18
25
|
end
|
19
26
|
end
|
20
27
|
|
21
28
|
def self.description
|
22
|
-
|
29
|
+
'Runs `Apprepo` for the project'
|
23
30
|
end
|
24
31
|
|
25
32
|
def self.available_options
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
33
|
+
[
|
34
|
+
FastlaneCore::ConfigItem.new(key: :ipa,
|
35
|
+
short_option: '-i',
|
36
|
+
optional: true,
|
37
|
+
env_name: 'Apprepo_IPA_PATH',
|
38
|
+
description: 'Path to your ipa file',
|
39
|
+
default_value: Dir['*.ipa'].first,
|
40
|
+
verify_block: proc do |value|
|
34
41
|
UI.user_error!("Could not find ipa file at path '#{value}'") unless File.exist?(value)
|
35
42
|
UI.user_error!("'#{value}' doesn't seem to be an ipa file") unless value.end_with?('.ipa')
|
36
|
-
|
37
|
-
|
38
|
-
|
43
|
+
end,
|
44
|
+
conflicting_options: [:pkg],
|
45
|
+
conflict_block: proc do |value|
|
39
46
|
UI.user_error!("You can't use 'ipa' and '#{value.key}' options in one run.")
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
47
|
+
end),
|
48
|
+
FastlaneCore::ConfigItem.new(key: :app_identifier,
|
49
|
+
short_option: '-b',
|
50
|
+
optional: false,
|
51
|
+
env_name: 'Apprepo_APP_ID',
|
52
|
+
description: 'Your bundle identifier',
|
53
|
+
default_value: ''),
|
54
|
+
FastlaneCore::ConfigItem.new(key: :app_code,
|
55
|
+
short_option: '-c',
|
56
|
+
optional: true,
|
57
|
+
env_name: 'Apprepo_APPCODE',
|
58
|
+
description: 'APPCODE value for Apprepo'),
|
59
|
+
FastlaneCore::ConfigItem.new(key: :repo_url,
|
60
|
+
short_option: '-r',
|
61
|
+
optional: false,
|
62
|
+
env_name: 'Apprepo_URL',
|
63
|
+
description: 'URL of your Apprepo server'),
|
64
|
+
FastlaneCore::ConfigItem.new(key: :repo_user,
|
65
|
+
short_option: '-u',
|
66
|
+
optional: false,
|
67
|
+
env_name: 'Apprepo_USER',
|
68
|
+
description: 'USER of your Apprepo server'),
|
69
|
+
FastlaneCore::ConfigItem.new(key: :repo_key,
|
70
|
+
short_option: '-k',
|
71
|
+
optional: false,
|
72
|
+
env_name: 'Apprepo_KEY',
|
73
|
+
description: 'RSA key for your Apprepo server'),
|
74
|
+
FastlaneCore::ConfigItem.new(key: :repo_description,
|
75
|
+
short_option: '-d',
|
76
|
+
optional: true,
|
77
|
+
env_name: 'Apprepo_DESCRIPTION',
|
78
|
+
description: 'Long detailed description for your Apprepo server',
|
79
|
+
default_value: ''),
|
80
|
+
FastlaneCore::ConfigItem.new(key: :repo_summary,
|
81
|
+
short_option: '-s',
|
82
|
+
optional: true,
|
83
|
+
env_name: 'Apprepo_SUMMARY',
|
84
|
+
description: 'Short description for your Apprepo server',
|
85
|
+
default_value: ''),
|
86
|
+
FastlaneCore::ConfigItem.new(key: :manifest_path,
|
87
|
+
short_option: '-m',
|
88
|
+
description: 'Path to the folder containing the metadata files',
|
89
|
+
optional: true),
|
90
|
+
FastlaneCore::ConfigItem.new(key: :repo_title,
|
91
|
+
short_option: '-a',
|
92
|
+
description: 'Name of the app',
|
93
|
+
optional: false),
|
94
|
+
FastlaneCore::ConfigItem.new(key: :skip_binary_upload,
|
95
|
+
description: 'Skip uploading an ipa or pkg to Apprepo',
|
96
|
+
is_string: false,
|
97
|
+
default_value: false),
|
98
|
+
FastlaneCore::ConfigItem.new(key: :app_version,
|
99
|
+
short_option: '-z',
|
100
|
+
description: 'The version that should be edited or created',
|
101
|
+
optional: true),
|
102
|
+
FastlaneCore::ConfigItem.new(key: :skip_manifest,
|
103
|
+
description: "Don't upload the metadata (e.g. title, description), this will still upload screenshots",
|
104
|
+
is_string: false,
|
105
|
+
default_value: false),
|
106
|
+
FastlaneCore::ConfigItem.new(key: :notify,
|
107
|
+
description: 'Notify Apprepo users on update',
|
108
|
+
is_string: false,
|
109
|
+
default_value: false),
|
110
|
+
FastlaneCore::ConfigItem.new(key: :build_number,
|
111
|
+
short_option: '-n',
|
112
|
+
description: 'If set the given build number (already uploaded to iTC) will be used instead of the current built one',
|
113
|
+
optional: true,
|
114
|
+
conflicting_options: [:ipa, :pkg],
|
115
|
+
conflict_block: proc do |value|
|
102
116
|
UI.user_error!("You can't use 'build_number' and '#{value.key}' options in one run.")
|
103
|
-
|
117
|
+
end),
|
104
118
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
119
|
+
# App Metadata
|
120
|
+
# Non Localised
|
121
|
+
FastlaneCore::ConfigItem.new(key: :app_icon,
|
122
|
+
description: 'Metadata: The path to the app icon',
|
123
|
+
optional: true,
|
124
|
+
short_option: '-l',
|
125
|
+
verify_block: proc do |value|
|
112
126
|
UI.user_error!("Could not find png file at path '#{value}'") unless File.exist?(value)
|
113
127
|
UI.user_error!("'#{value}' doesn't seem to be a png file") unless value.end_with?('.png')
|
114
|
-
|
115
|
-
|
128
|
+
end)
|
129
|
+
]
|
116
130
|
end
|
117
131
|
|
118
|
-
def self.
|
132
|
+
def self.supported?(platform)
|
119
133
|
[:ios, :mac].include? platform
|
120
134
|
end
|
121
135
|
|
122
136
|
def self.authors
|
123
|
-
[
|
137
|
+
['suculent']
|
124
138
|
end
|
125
139
|
end
|
126
140
|
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
class DownloadManifestAction < Action
|
4
|
+
def self.run(_params)
|
5
|
+
puts _params
|
6
|
+
command :download_manifest do |c|
|
7
|
+
c.syntax = 'apprepo download_manifest'
|
8
|
+
c.description = 'Download metadata only'
|
9
|
+
c.action do |_args, options|
|
10
|
+
config = FastlaneCore::Configuration
|
11
|
+
available_opts = Apprepo::Options.available_options
|
12
|
+
options = config.create(available_opts, options.__hash__)
|
13
|
+
options.load_configuration_file('Repofile')
|
14
|
+
Apprepo::Runner.new(options).download_manifest
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
#####################################################
|
20
|
+
# @!group Documentation
|
21
|
+
#####################################################
|
22
|
+
|
23
|
+
def self.description
|
24
|
+
'Runs the Apprepo plugin'
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.available_options
|
28
|
+
[]
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.authors
|
32
|
+
['suculent@me.com']
|
33
|
+
end
|
34
|
+
|
35
|
+
def self.is_supported?(_platform)
|
36
|
+
true
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
class InitAction < Action
|
4
|
+
def self.run(_params)
|
5
|
+
#sh 'bundle exec rubocop -D'
|
6
|
+
command :init do |c|
|
7
|
+
c.syntax = 'apprepo init'
|
8
|
+
c.description = 'Create the initial `apprepo` configuration'
|
9
|
+
c.action do |_args, options|
|
10
|
+
if File.exist?('Repofile') || File.exist?('fastlane/Repofile')
|
11
|
+
UI.important('You already got a running apprepo setup.')
|
12
|
+
return 0
|
13
|
+
end
|
14
|
+
|
15
|
+
require 'apprepo/setup'
|
16
|
+
config = FastlaneCore::Configuration
|
17
|
+
available_opts = Apprepo::Options.available_options
|
18
|
+
options = config.create(available_opts, options.__hash__)
|
19
|
+
Apprepo::Runner.new(options)
|
20
|
+
Apprepo::Setup.new.run(options)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
#####################################################
|
26
|
+
# @!group Documentation
|
27
|
+
#####################################################
|
28
|
+
|
29
|
+
def self.description
|
30
|
+
'Initializes Repofile'
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.available_options
|
34
|
+
[]
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.authors
|
38
|
+
['suculent@me.com']
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.is_supported?(_platform)
|
42
|
+
true
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|