fastlane-plugin-sunny_project 0.1.1 → 0.1.3
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/lib/fastlane/plugin/sunny_project.rb +1 -1
- data/lib/fastlane/plugin/sunny_project/actions/curr_semver_action.rb +44 -0
- data/lib/fastlane/plugin/sunny_project/actions/dart_packages_status_action.rb +45 -0
- data/lib/fastlane/plugin/sunny_project/actions/finalize_version_action.rb +64 -0
- data/lib/fastlane/plugin/sunny_project/actions/generate_icons_action.rb +77 -0
- data/lib/fastlane/plugin/sunny_project/actions/increase_version_action.rb +12 -53
- data/lib/fastlane/plugin/sunny_project/actions/{sunny_project_action.rb → pub_publish_action.rb} +7 -11
- data/lib/fastlane/plugin/sunny_project/actions/release_notes_action.rb +96 -0
- data/lib/fastlane/plugin/sunny_project/actions/rename_assets_action.rb +44 -0
- data/lib/fastlane/plugin/sunny_project/helper/sunny_project_helper.rb +108 -7
- data/lib/fastlane/plugin/sunny_project/options/plugin_options.rb +33 -0
- data/lib/fastlane/plugin/sunny_project/version.rb +1 -1
- metadata +14 -8
- data/lib/fastlane/plugin/sunny_project/actions/sunny_release_action.rb +0 -72
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a515090fcca006dc19c431618a5487ee87396f4e663dc3da861100a97e4b6f00
|
|
4
|
+
data.tar.gz: 2c515e01ab4c674fca09dc659c68e43a3cc715b72adee7fb2204f3c8fdadc013
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 195d698da34785c9587403779566ca69b525e62daad899ac99602751a4254baf1aa7a978dad63e8e771045578d79fb9faa4e8717238b471e1866c6dab0670e7d
|
|
7
|
+
data.tar.gz: 1e7e79897ecd1945b1913eb350f90bbe442f5878e14ca09e300b77a16be752a264dc5bd9f9264e8175cabd682267bbb442fa7108191aa6b944824fe5c398eb54
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
require 'fastlane/action'
|
|
2
|
+
require_relative '../helper/sunny_project_helper'
|
|
3
|
+
require 'semantic'
|
|
4
|
+
|
|
5
|
+
module Fastlane
|
|
6
|
+
module Actions
|
|
7
|
+
class CurrSemverAction < Action
|
|
8
|
+
def self.run(options)
|
|
9
|
+
Sunny.current_semver
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def self.description
|
|
13
|
+
"Gets the current version from the project's pubspec.yaml file"
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def self.authors
|
|
17
|
+
["ericmartineau"]
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def self.return_value
|
|
21
|
+
# If your method provides a return value, you can describe here what it does
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def self.details
|
|
25
|
+
# Optional:
|
|
26
|
+
""
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def self.available_options
|
|
30
|
+
[
|
|
31
|
+
|
|
32
|
+
]
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def self.is_supported?(platform)
|
|
36
|
+
# Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
|
|
37
|
+
# See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
|
|
38
|
+
#
|
|
39
|
+
# [:ios, :mac, :android].include?(platform)
|
|
40
|
+
true
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
require 'fastlane/action'
|
|
2
|
+
require 'fastlane_core'
|
|
3
|
+
require 'fastlane_core/ui/ui'
|
|
4
|
+
|
|
5
|
+
require_relative '../helper/sunny_project_helper'
|
|
6
|
+
require_relative '../options/plugin_options'
|
|
7
|
+
require 'semantic'
|
|
8
|
+
|
|
9
|
+
module Fastlane
|
|
10
|
+
UI = FastlaneCore::UI unless Fastlane.const_defined?("UI")
|
|
11
|
+
module Actions
|
|
12
|
+
class DartPackagesStatus < Fastlane::Action
|
|
13
|
+
def self.run(options)
|
|
14
|
+
params = FastlaneCore::Configuration.create(SunnyPlugin::Options.available_options, options.__hash__)
|
|
15
|
+
params.load_configuration_file("Sunnyfile")
|
|
16
|
+
"Hello #{params.pretty_print}"
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def self.description
|
|
20
|
+
"Checks status of plugins modules"
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.authors
|
|
24
|
+
["ericmartineau"]
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def self.return_value
|
|
28
|
+
# If your method provides a return value, you can describe here what it does
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def self.details
|
|
32
|
+
# Optional:
|
|
33
|
+
""
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def self.available_options
|
|
37
|
+
SunnyPluginOptions.available_options
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def self.is_supported?(platform)
|
|
41
|
+
true
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
require 'fastlane/action'
|
|
2
|
+
require_relative '../helper/sunny_project_helper'
|
|
3
|
+
|
|
4
|
+
module Fastlane
|
|
5
|
+
module Actions
|
|
6
|
+
class FinalizeVersionAction < Action
|
|
7
|
+
def self.run(options)
|
|
8
|
+
version = Sunny.current_semver
|
|
9
|
+
# If we got this far, let's commit the build number and update the git tags. If the rest of the pro
|
|
10
|
+
# process fails, we should revert this because it will mess up our commit logs
|
|
11
|
+
Fastlane::Actions::GitCommitAction.run(path: %w[./pubspec.yaml ./pubspec.lock ./CHANGELOG.md],
|
|
12
|
+
allow_nothing_to_commit: true,
|
|
13
|
+
message: "Version bump to: #{version.major}.#{version.minor}.#{version.patch}#800#{version.build}")
|
|
14
|
+
Fastlane::Actions::AddGitTagAction.run(
|
|
15
|
+
tag: "sunny/builds/v#{version.build}",
|
|
16
|
+
force: true,
|
|
17
|
+
sign: false,
|
|
18
|
+
)
|
|
19
|
+
Fastlane::Actions::PushGitTagsAction.run(log: true)
|
|
20
|
+
if File.exist?(Sunny.release_notes_file)
|
|
21
|
+
File.delete(Sunny.release_notes_file)
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def self.description
|
|
26
|
+
"Commit version tags"
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def self.authors
|
|
30
|
+
["ericmartineau"]
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def self.return_value
|
|
34
|
+
# If your method provides a return value, you can describe here what it does
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def self.details
|
|
38
|
+
# Optional:
|
|
39
|
+
""
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def self.available_options
|
|
43
|
+
[
|
|
44
|
+
FastlaneCore::ConfigItem.new(key: :tag_group,
|
|
45
|
+
env_name: "SUNNY_PROJECT_TAG_GROUP",
|
|
46
|
+
description: "The name of the tag group",
|
|
47
|
+
optional: false,
|
|
48
|
+
type: String,
|
|
49
|
+
default_value: "sunny/builds"),
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
]
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def self.is_supported?(platform)
|
|
56
|
+
# Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
|
|
57
|
+
# See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
|
|
58
|
+
#
|
|
59
|
+
# [:ios, :mac, :android].include?(platform)
|
|
60
|
+
true
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
require 'fastlane/action'
|
|
2
|
+
require_relative '../helper/sunny_project_helper'
|
|
3
|
+
require 'semantic'
|
|
4
|
+
|
|
5
|
+
module Fastlane
|
|
6
|
+
module Actions
|
|
7
|
+
class GenerateIconsAction < Action
|
|
8
|
+
def self.run(options)
|
|
9
|
+
Dir.chdir("..") {
|
|
10
|
+
self.download_icons
|
|
11
|
+
self.build_icon_fonts(options)
|
|
12
|
+
}
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def self.build_icon_fonts(options)
|
|
16
|
+
snake_name = options[:icon_set_name]
|
|
17
|
+
camel_value = snake_name.split('_').downcase.collect(&:capitalize).join
|
|
18
|
+
helper.exec_cmd("Generate flutter icons", "icon_font_generator",
|
|
19
|
+
"--from=#{options[:icon_source_folder]}", "--class-name=#{camel_value}",
|
|
20
|
+
"--out-font=lib/fonts/#{camel_value}.ttf", "--out-flutter=lib/#{snake_name}_font.dart",
|
|
21
|
+
"--normalize")
|
|
22
|
+
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def self.download_icons
|
|
26
|
+
Dir.chdir("..") {
|
|
27
|
+
cmd("Download icons", "dart", "tools/iconsource/downloader.dart")
|
|
28
|
+
}
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def self.description
|
|
32
|
+
"Generates a flutter icon set as a font"
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def self.authors
|
|
36
|
+
["ericmartineau"]
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def self.return_value
|
|
40
|
+
# If your method provides a return value, you can describe here what it does
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def self.details
|
|
44
|
+
# Optional:
|
|
45
|
+
""
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def self.available_options
|
|
49
|
+
[
|
|
50
|
+
FastlaneCore::ConfigItem.new(key: :icon_source_folder,
|
|
51
|
+
env_name: "SUNNY_PROJECT_ICON_SOURCE_FOLDER",
|
|
52
|
+
description: "The folder to look in for svg icons",
|
|
53
|
+
optional: false,
|
|
54
|
+
type: String,
|
|
55
|
+
default_value: "iconsource/svg"),
|
|
56
|
+
FastlaneCore::ConfigItem.new(key: :icon_set_name,
|
|
57
|
+
env_name: "SUNNY_PROJECT_ICON_SET_NAME",
|
|
58
|
+
description: "The snake-case name of the icon set",
|
|
59
|
+
optional: false,
|
|
60
|
+
verify_block: proc do |value|
|
|
61
|
+
UI.error!("This value cannot be blank") unless value
|
|
62
|
+
UI.error!("This value must be snake case") unless Sunny.underscore(value) == value
|
|
63
|
+
end,
|
|
64
|
+
type: String),
|
|
65
|
+
]
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def self.is_supported?(platform)
|
|
69
|
+
# Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
|
|
70
|
+
# See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
|
|
71
|
+
#
|
|
72
|
+
# [:ios, :mac, :android].include?(platform)
|
|
73
|
+
true
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
@@ -5,56 +5,12 @@ require 'semantic'
|
|
|
5
5
|
module Fastlane
|
|
6
6
|
module Actions
|
|
7
7
|
class IncreaseVersionAction < Action
|
|
8
|
-
### Reads the latest version from pubspec.yaml
|
|
9
|
-
def self.current_semver
|
|
10
|
-
Semantic::Version.new current_version
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
### Reads the latest version from pubspec.yaml (doesn't have to be in .. to run)
|
|
14
|
-
def self.current_semver_path
|
|
15
|
-
version = nil
|
|
16
|
-
Dir.chdir("..") {
|
|
17
|
-
version=current_semver
|
|
18
|
-
}
|
|
19
|
-
version
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def self.build_number
|
|
23
|
-
current_semver.build
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def self.release_notes_file
|
|
27
|
-
".release-notes"
|
|
28
|
-
end
|
|
29
|
-
|
|
30
8
|
def self.run(options)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
version=nil
|
|
34
|
-
Dir.chdir("..") {
|
|
35
|
-
if options[:patch]
|
|
36
|
-
cmd("bump patch", "pubver bump patch -b")
|
|
37
|
-
version=current_semver
|
|
38
|
-
end
|
|
39
|
-
if options[:build]
|
|
40
|
-
cmd("bump build", "pubver bump build")
|
|
41
|
-
version=current_semver
|
|
42
|
-
end
|
|
43
|
-
if version
|
|
44
|
-
puts(version)
|
|
45
|
-
else
|
|
46
|
-
puts("No version changes occurred")
|
|
47
|
-
next
|
|
48
|
-
end
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
version
|
|
52
|
-
|
|
53
|
-
|
|
9
|
+
Sunny.do_increase_version options
|
|
54
10
|
end
|
|
55
11
|
|
|
56
12
|
def self.description
|
|
57
|
-
"
|
|
13
|
+
"Increment version number in pubspec.yaml file"
|
|
58
14
|
end
|
|
59
15
|
|
|
60
16
|
def self.authors
|
|
@@ -71,12 +27,17 @@ module Fastlane
|
|
|
71
27
|
end
|
|
72
28
|
|
|
73
29
|
def self.available_options
|
|
30
|
+
verify_type = lambda do |value|
|
|
31
|
+
UI.error "Invalid option: #{value} Must be 'build' or 'patch'" unless value == "build" or value == "patch"
|
|
32
|
+
end
|
|
74
33
|
[
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
34
|
+
FastlaneCore::ConfigItem.new(key: :type,
|
|
35
|
+
env_name: "SUNNY_PROJECT_TYPE",
|
|
36
|
+
description: "Whether to make a patch or build version change",
|
|
37
|
+
optional: true,
|
|
38
|
+
verify_block: verify_type,
|
|
39
|
+
default_value: 'build',
|
|
40
|
+
type: String)
|
|
80
41
|
]
|
|
81
42
|
end
|
|
82
43
|
|
|
@@ -88,7 +49,5 @@ module Fastlane
|
|
|
88
49
|
true
|
|
89
50
|
end
|
|
90
51
|
end
|
|
91
|
-
|
|
92
|
-
|
|
93
52
|
end
|
|
94
53
|
end
|
data/lib/fastlane/plugin/sunny_project/actions/{sunny_project_action.rb → pub_publish_action.rb}
RENAMED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
require 'fastlane/action'
|
|
2
2
|
require_relative '../helper/sunny_project_helper'
|
|
3
|
+
require 'semantic'
|
|
3
4
|
|
|
4
5
|
module Fastlane
|
|
5
6
|
module Actions
|
|
6
|
-
class
|
|
7
|
-
def self.run(
|
|
8
|
-
|
|
7
|
+
class PubPublishAction < Action
|
|
8
|
+
def self.run(options)
|
|
9
|
+
Sunny.exec_cmd("pub publish", "pub publish -f")
|
|
9
10
|
end
|
|
10
11
|
|
|
11
12
|
def self.description
|
|
12
|
-
"
|
|
13
|
+
"Executes pub publish command"
|
|
13
14
|
end
|
|
14
15
|
|
|
15
16
|
def self.authors
|
|
@@ -26,12 +27,9 @@ module Fastlane
|
|
|
26
27
|
end
|
|
27
28
|
|
|
28
29
|
def self.available_options
|
|
30
|
+
|
|
29
31
|
[
|
|
30
|
-
|
|
31
|
-
# env_name: "SUNNY_PROJECT_YOUR_OPTION",
|
|
32
|
-
# description: "A description of your option",
|
|
33
|
-
# optional: false,
|
|
34
|
-
# type: String)
|
|
32
|
+
|
|
35
33
|
]
|
|
36
34
|
end
|
|
37
35
|
|
|
@@ -43,7 +41,5 @@ module Fastlane
|
|
|
43
41
|
true
|
|
44
42
|
end
|
|
45
43
|
end
|
|
46
|
-
|
|
47
|
-
|
|
48
44
|
end
|
|
49
45
|
end
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
require 'fastlane/action'
|
|
2
|
+
require_relative '../helper/sunny_project_helper'
|
|
3
|
+
require 'semantic'
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
module Fastlane
|
|
7
|
+
module Actions
|
|
8
|
+
|
|
9
|
+
class ReleaseNotesAction < Action
|
|
10
|
+
def self.run(options)
|
|
11
|
+
changes = Sunny.string(options[:changes])
|
|
12
|
+
if Sunny.blank(changes)
|
|
13
|
+
if File.file?(Sunny.release_notes_file)
|
|
14
|
+
changes = Sunny.string(File.read(Sunny.release_notes_file))
|
|
15
|
+
|
|
16
|
+
UI.message "Found release notes: \n#####################################################\n\n#{changes}\n\n#####################################################\n"
|
|
17
|
+
sleep(5)
|
|
18
|
+
return changes
|
|
19
|
+
end
|
|
20
|
+
unless File.file?(Sunny.release_notes_file)
|
|
21
|
+
changes = Sunny.string(Fastlane::Actions::ChangelogFromGitCommitsAction.run(
|
|
22
|
+
path: "./",
|
|
23
|
+
pretty: "%B",
|
|
24
|
+
ancestry_path: false,
|
|
25
|
+
match_lightweight_tag: true,
|
|
26
|
+
quiet: false,
|
|
27
|
+
merge_commit_filtering: ":exclude_merges"
|
|
28
|
+
))
|
|
29
|
+
|
|
30
|
+
if Sunny.blank(changes)
|
|
31
|
+
changes = Sunny.string(Fastlane::Actions::PromptAction.run(
|
|
32
|
+
text: "Please Enter a description of what changed.\nWhen you are finished, type END\n Changelog: ",
|
|
33
|
+
multi_line_end_keyword: 'END'))
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
unless Sunny.blank(changes)
|
|
37
|
+
File.open(Sunny.release_notes_file, 'w') { |file|
|
|
38
|
+
file.write(changes)
|
|
39
|
+
}
|
|
40
|
+
end
|
|
41
|
+
if File.file?(Sunny.release_notes_file)
|
|
42
|
+
changes = Sunny.string(File.read(Sunny.release_notes_file))
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
if File.file?("CHANGELOG.md")
|
|
47
|
+
f = File.open("CHANGELOG.md", "r+")
|
|
48
|
+
lines = f.readlines
|
|
49
|
+
f.close
|
|
50
|
+
v = Sunny.current_semver
|
|
51
|
+
lines = ["## [#{v}]\n", " * #{changes}\n", "\n"] + lines
|
|
52
|
+
|
|
53
|
+
output = File.new("CHANGELOG.md", "w")
|
|
54
|
+
lines.each { |line| output.write line }
|
|
55
|
+
output.close
|
|
56
|
+
end
|
|
57
|
+
changes
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def self.description
|
|
61
|
+
"Get or retrieve release notes from git"
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def self.authors
|
|
65
|
+
["ericmartineau"]
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def self.return_value
|
|
69
|
+
# If your method provides a return value, you can describe here what it does
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def self.details
|
|
73
|
+
# Optional:
|
|
74
|
+
""
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def self.available_options
|
|
78
|
+
[
|
|
79
|
+
FastlaneCore::ConfigItem.new(key: :changes,
|
|
80
|
+
env_name: "SUNNY_PROJECT_CHANGES",
|
|
81
|
+
description: "Change log text",
|
|
82
|
+
optional: true,
|
|
83
|
+
type: String)
|
|
84
|
+
]
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
def self.is_supported?(platform)
|
|
88
|
+
# Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
|
|
89
|
+
# See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
|
|
90
|
+
#
|
|
91
|
+
# [:ios, :mac, :android].include?(platform)
|
|
92
|
+
true
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
require 'fastlane/action'
|
|
2
|
+
require_relative '../helper/sunny_project_helper'
|
|
3
|
+
require 'semantic'
|
|
4
|
+
|
|
5
|
+
module Fastlane
|
|
6
|
+
module Actions
|
|
7
|
+
class RenameAssetsAction < Action
|
|
8
|
+
def self.run(options)
|
|
9
|
+
Sunny.exec_cmd("dart asset_renamer.dart", "dart tools/asset_renamer.dart")
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def self.description
|
|
13
|
+
"Renames assets, generates an assets.dart file to reference them."
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def self.authors
|
|
17
|
+
["ericmartineau"]
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def self.return_value
|
|
21
|
+
# If your method provides a return value, you can describe here what it does
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def self.details
|
|
25
|
+
# Optional:
|
|
26
|
+
""
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def self.available_options
|
|
30
|
+
[
|
|
31
|
+
|
|
32
|
+
]
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def self.is_supported?(platform)
|
|
36
|
+
# Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
|
|
37
|
+
# See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
|
|
38
|
+
#
|
|
39
|
+
# [:ios, :mac, :android].include?(platform)
|
|
40
|
+
true
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -1,16 +1,117 @@
|
|
|
1
1
|
require 'fastlane_core/ui/ui'
|
|
2
|
+
require "fastlane"
|
|
2
3
|
|
|
3
4
|
module Fastlane
|
|
4
5
|
UI = FastlaneCore::UI unless Fastlane.const_defined?("UI")
|
|
5
6
|
|
|
6
|
-
module
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
UI.message("Hello from the sunny_project plugin helper!")
|
|
7
|
+
module Sunny
|
|
8
|
+
def self.string(str)
|
|
9
|
+
if str
|
|
10
|
+
str.strip
|
|
11
|
+
else
|
|
12
|
+
nil
|
|
13
13
|
end
|
|
14
14
|
end
|
|
15
|
+
|
|
16
|
+
def self.blank(str)
|
|
17
|
+
if str
|
|
18
|
+
str.strip.empty?
|
|
19
|
+
else
|
|
20
|
+
true
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def self.do_increase_version(options)
|
|
26
|
+
command = "pubver bump #{options[:type]} "
|
|
27
|
+
if options[:type] == 'patch'
|
|
28
|
+
command += "-b"
|
|
29
|
+
end
|
|
30
|
+
self.exec_cmd("bump patch", command)
|
|
31
|
+
self.current_semver
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def self.exec_cmd(name, *command, **args)
|
|
35
|
+
if (command.count > 1)
|
|
36
|
+
command = command.map { |item| Shellwords.escape item }
|
|
37
|
+
end
|
|
38
|
+
joined = command.join(" ")
|
|
39
|
+
if args[:verbose]
|
|
40
|
+
begin
|
|
41
|
+
return sh(command)
|
|
42
|
+
rescue StandardError => e
|
|
43
|
+
UI.user_error! ">> #{name} failed << \n #{e}"
|
|
44
|
+
end
|
|
45
|
+
else
|
|
46
|
+
if args[:cmd_out]
|
|
47
|
+
UI.command_output name
|
|
48
|
+
else
|
|
49
|
+
UI.command name
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
stdout, err, status = Open3.capture3(joined)
|
|
53
|
+
UI.user_error! ">> #{name} failed << \n command: #{joined}\n error: #{err}" unless status == 0
|
|
54
|
+
stdout
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def self.release_notes_file
|
|
59
|
+
".release-notes"
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
### Reads the latest version from pubspec.yaml
|
|
63
|
+
def self.current_semver
|
|
64
|
+
Semantic::Version.new current_version_string
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
### Reads the latest version from pubspec.yaml
|
|
68
|
+
def self.current_semver_path
|
|
69
|
+
version = nil
|
|
70
|
+
Dir.chdir("..") do
|
|
71
|
+
version = self.current_semver
|
|
72
|
+
end
|
|
73
|
+
version
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
def self.build_number
|
|
77
|
+
self.current_semver.build
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
## Retrieves the current semver based on git tags
|
|
81
|
+
def self.current_version_string
|
|
82
|
+
self.exec_cmd("get version", "pubver get")
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# lane :ximg do |options|
|
|
86
|
+
# Dir.chdir("..") {
|
|
87
|
+
# cmd("dart asset_renamer.dart", "dart tools/asset_renamer.dart")
|
|
88
|
+
# }
|
|
89
|
+
# end
|
|
90
|
+
#
|
|
91
|
+
# lane :icons do
|
|
92
|
+
# download_icons
|
|
93
|
+
# build_icon_fonts
|
|
94
|
+
# end
|
|
95
|
+
#
|
|
96
|
+
# lane :build_icon_fonts do
|
|
97
|
+
# Dir.chdir("..") {
|
|
98
|
+
# cmd("Generate flutter icons", "icon_font_generator", "--from=iconsource/svg", "--class-name=AuthIcons",
|
|
99
|
+
# "--out-font=lib/fonts/AuthIcons.ttf", "--out-flutter=lib/auth_icon_font.dart", "--normalize")
|
|
100
|
+
# }
|
|
101
|
+
# end
|
|
102
|
+
#
|
|
103
|
+
# lane :download_icons do
|
|
104
|
+
# Dir.chdir("..") {
|
|
105
|
+
# cmd("Download icons", "dart", "tools/iconsource/downloader.dart")
|
|
106
|
+
# }
|
|
107
|
+
# end
|
|
108
|
+
|
|
109
|
+
def self.underscore(str)
|
|
110
|
+
str.gsub(/::/, '/').
|
|
111
|
+
gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2').
|
|
112
|
+
gsub(/([a-z\d])([A-Z])/, '\1_\2').
|
|
113
|
+
tr("-", "_").
|
|
114
|
+
downcase
|
|
115
|
+
end
|
|
15
116
|
end
|
|
16
117
|
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
require 'fastlane_core/configuration/config_item'
|
|
2
|
+
require 'fastlane/helper/lane_helper'
|
|
3
|
+
|
|
4
|
+
module Fastlane
|
|
5
|
+
module SunnyProject
|
|
6
|
+
class SunnyPluginOptions
|
|
7
|
+
# This is match specific, as users can append storage specific options
|
|
8
|
+
def self.append_option(option)
|
|
9
|
+
self.available_options # to ensure we created the initial `@available_options` array
|
|
10
|
+
@available_options << option
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def self.default_platform
|
|
14
|
+
case Fastlane::Helper::LaneHelper.current_platform.to_s
|
|
15
|
+
when "mac"
|
|
16
|
+
"macos"
|
|
17
|
+
else
|
|
18
|
+
"ios"
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def self.available_options
|
|
23
|
+
[
|
|
24
|
+
FastlaneCore::ConfigItem.new(key: :sunny_plugins,
|
|
25
|
+
env_name: "SUNNY_PLUGINS",
|
|
26
|
+
description: "The plugins",
|
|
27
|
+
type: Hash,
|
|
28
|
+
optional: false,)
|
|
29
|
+
]
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fastlane-plugin-sunny_project
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ericmartineau
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-
|
|
11
|
+
date: 2020-11-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: pry
|
|
@@ -136,7 +136,7 @@ dependencies:
|
|
|
136
136
|
- - ">="
|
|
137
137
|
- !ruby/object:Gem::Version
|
|
138
138
|
version: 2.160.0
|
|
139
|
-
description:
|
|
139
|
+
description:
|
|
140
140
|
email: smartytime@gmail.com
|
|
141
141
|
executables: []
|
|
142
142
|
extensions: []
|
|
@@ -145,16 +145,22 @@ files:
|
|
|
145
145
|
- LICENSE
|
|
146
146
|
- README.md
|
|
147
147
|
- lib/fastlane/plugin/sunny_project.rb
|
|
148
|
+
- lib/fastlane/plugin/sunny_project/actions/curr_semver_action.rb
|
|
149
|
+
- lib/fastlane/plugin/sunny_project/actions/dart_packages_status_action.rb
|
|
150
|
+
- lib/fastlane/plugin/sunny_project/actions/finalize_version_action.rb
|
|
151
|
+
- lib/fastlane/plugin/sunny_project/actions/generate_icons_action.rb
|
|
148
152
|
- lib/fastlane/plugin/sunny_project/actions/increase_version_action.rb
|
|
149
|
-
- lib/fastlane/plugin/sunny_project/actions/
|
|
150
|
-
- lib/fastlane/plugin/sunny_project/actions/
|
|
153
|
+
- lib/fastlane/plugin/sunny_project/actions/pub_publish_action.rb
|
|
154
|
+
- lib/fastlane/plugin/sunny_project/actions/release_notes_action.rb
|
|
155
|
+
- lib/fastlane/plugin/sunny_project/actions/rename_assets_action.rb
|
|
151
156
|
- lib/fastlane/plugin/sunny_project/helper/sunny_project_helper.rb
|
|
157
|
+
- lib/fastlane/plugin/sunny_project/options/plugin_options.rb
|
|
152
158
|
- lib/fastlane/plugin/sunny_project/version.rb
|
|
153
159
|
homepage: https://github.com/SunnyApp/fastlane-plugin-sunny_project
|
|
154
160
|
licenses:
|
|
155
161
|
- MIT
|
|
156
162
|
metadata: {}
|
|
157
|
-
post_install_message:
|
|
163
|
+
post_install_message:
|
|
158
164
|
rdoc_options: []
|
|
159
165
|
require_paths:
|
|
160
166
|
- lib
|
|
@@ -170,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
170
176
|
version: '0'
|
|
171
177
|
requirements: []
|
|
172
178
|
rubygems_version: 3.0.3
|
|
173
|
-
signing_key:
|
|
179
|
+
signing_key:
|
|
174
180
|
specification_version: 4
|
|
175
181
|
summary: Sunny flutter projects
|
|
176
182
|
test_files: []
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
require 'fastlane/action'
|
|
2
|
-
require_relative '../helper/sunny_project_helper'
|
|
3
|
-
|
|
4
|
-
module Fastlane
|
|
5
|
-
module Actions
|
|
6
|
-
class SunnyReleaseAction < Action
|
|
7
|
-
def self.run(params)
|
|
8
|
-
UI.message("The sunny_release plugin is working!")
|
|
9
|
-
lane :increase_version do |options|
|
|
10
|
-
version=nil
|
|
11
|
-
|
|
12
|
-
Dir.chdir("..") {
|
|
13
|
-
if options[:patch]
|
|
14
|
-
cmd("bump patch", "pubver bump patch -b")
|
|
15
|
-
version=current_semver
|
|
16
|
-
end
|
|
17
|
-
if options[:build]
|
|
18
|
-
cmd("bump build", "pubver bump build")
|
|
19
|
-
version=current_semver
|
|
20
|
-
end
|
|
21
|
-
if version
|
|
22
|
-
puts(version)
|
|
23
|
-
else
|
|
24
|
-
puts("No version changes occurred")
|
|
25
|
-
next
|
|
26
|
-
end
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
version
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
def self.description
|
|
35
|
-
"Sunny release plugin"
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
def self.authors
|
|
39
|
-
["ericmartineau"]
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
def self.return_value
|
|
43
|
-
# If your method provides a return value, you can describe here what it does
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
def self.details
|
|
47
|
-
# Optional:
|
|
48
|
-
""
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
def self.available_options
|
|
52
|
-
[
|
|
53
|
-
# FastlaneCore::ConfigItem.new(key: :your_option,
|
|
54
|
-
# env_name: "SUNNY_PROJECT_YOUR_OPTION",
|
|
55
|
-
# description: "A description of your option",
|
|
56
|
-
# optional: false,
|
|
57
|
-
# type: String)
|
|
58
|
-
]
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
def self.is_supported?(platform)
|
|
62
|
-
# Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
|
|
63
|
-
# See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
|
|
64
|
-
#
|
|
65
|
-
# [:ios, :mac, :android].include?(platform)
|
|
66
|
-
true
|
|
67
|
-
end
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
end
|
|
72
|
-
end
|