fastlane-plugin-apadmi_grout 2.2.3 → 2.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 88b9593055aca0e7fe8c4535af085623c55f1d79c5fef91168a7e7500c2c0ab8
4
- data.tar.gz: 80c8be68a1f728ac09b38d0b3bf16662d6b031992b6d60135aa0f7439c92d5c5
3
+ metadata.gz: 057b6fbd946ea3c41cd4d444fd00bb1a4f40ee48e30e878016304c68b42089d8
4
+ data.tar.gz: abd2f3609fd6656873a14a4efcd5775c1ecb315bbde9419bddcfe40ead6bc709
5
5
  SHA512:
6
- metadata.gz: b1b09b1fdc76861286ffb9ab76e79cdf5110f8ac68dffa55ada5f74345bc90a7d45c130ed98fb887f414fd4ac96e3bf0c1c89cbb5292d85afa4fc61c4c7129ef
7
- data.tar.gz: 5df4a62ce753b3e5fac95a862cd30227d2a6e60b3ee3ad4fc2efcac501b754efacb474f3b888b8c23c1958346d3bab0704810df50765e6a30e6ba2c326eccb33
6
+ metadata.gz: 5c5c4e67a30bfcb6a5a8eb97f5a19f23c598c1b679492e51c84a1b7345694c1e23e5a9db72be83e360dd4d466bc4406d6ee5d67d22cbf2f5a3b956e4b2dff313
7
+ data.tar.gz: c93367d52af8479de1417337f592474f9a10c5f3cd1be4a413575e2974db99f698753619ae97a26bad4b8cdbff10510af60fdf80124cfe93634e7317634988f8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Fastlane Plugin Changelog
2
2
 
3
+ ## [2.3.1] - 2023-04-05
4
+ * Fix issue with apk generation where path was returned incorrectly
5
+ * Bump core library version dependency
6
+
7
+ ## [2.3.0] - 2023-04-03
8
+ * Added utility for building APKs and AABs through fastlane.
9
+
3
10
  ## [2.2.3] - 2023-01-26
4
11
  * Bump core library version dependency
5
12
 
@@ -0,0 +1,173 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "fastlane/action"
4
+ require "fastlane/actions/gradle"
5
+ require "apadmi_grout"
6
+ require_relative "../utils/fastlane_logger"
7
+
8
+ # WARNING: Since this is calling out to Gradle, this isn't covered at all by tests
9
+ # Be very very careful before making any changes.
10
+ module Fastlane
11
+ module Actions
12
+ # Build an IPA binary
13
+ class BuildApkOrAabAction < Action
14
+ def self.run(params)
15
+ logger = FastLane::FastlaneLogger.new
16
+
17
+ build_type = Apadmi::Grout::CommandParsingUtils.determining_build_type(params[:gradle_command])
18
+ output_name = params[:output_name] || Apadmi::Grout::FilenameUtils.binary_output_filename(
19
+ client_name: params[:client_name],
20
+ product_name: params[:product_name],
21
+ platform: "Android",
22
+ version: params[:version],
23
+ build_number: params[:build_number]
24
+ ) + ".#{build_type}"
25
+
26
+ logger.message("Generating #{build_type}: #{output_name}")
27
+
28
+ new_params = params
29
+ new_params[:task] = params[:gradle_command]
30
+ new_params[:properties] = signing_properties(params) if params[:inject_signing_creds]
31
+ new_params[:system_properties] = config_properties(params)
32
+
33
+ Fastlane::Actions::GradleAction.run(new_params)
34
+
35
+ artifact = case build_type
36
+ when AndroidBuildType::APK
37
+ lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH]
38
+ when AndroidBuildType::AAB
39
+ lane_context[SharedValues::GRADLE_AAB_OUTPUT_PATH]
40
+ else
41
+ raise "Something terrible has happened, could not find artifact path"
42
+ end
43
+
44
+ new_artifact_path = "#{params[:output_directory]}/#{output_name}"
45
+ File.rename(artifact, new_artifact_path)
46
+ logger.success("Generated #{output_name} in #{params[:output_directory]}")
47
+
48
+ new_artifact_path
49
+ end
50
+
51
+ def self.config_properties(options)
52
+ {
53
+ "versionCode" => options[:build_number],
54
+ "versionName" => options[:version],
55
+ "commitHash" => ENV["BITRISE_GIT_COMMIT"] || Apadmi::Grout::GitUtils.commit_hash
56
+ }.merge(options[:additional_config_properties])
57
+ end
58
+
59
+ def self.signing_properties(params)
60
+ {
61
+ "android.injected.signing.store.file" => params[:keystore_path],
62
+ "android.injected.signing.store.password" => params[:keystore_password],
63
+ "android.injected.signing.key.alias" => params[:keystore_alias],
64
+ "android.injected.signing.key.password" => params[:key_password]
65
+ }
66
+ end
67
+
68
+ def self.description
69
+ "Builds an APK or AAB depeding on the command"
70
+ end
71
+
72
+ def self.authors
73
+ ["samdc@apadmi.com"]
74
+ end
75
+
76
+ def self.fastlane_signing_properties
77
+ [
78
+ FastlaneCore::ConfigItem.new(key: :keystore_path,
79
+ description: "Path to the keystore file",
80
+ env_name: "BITRISE_SIGNING_KEY_DOWNLOAD_PATH",
81
+ type: String,
82
+ optional: true),
83
+ FastlaneCore::ConfigItem.new(key: :keystore_password,
84
+ description: "Keystore password",
85
+ env_name: "BITRISEIO_ANDROID_KEYSTORE_PASSWORD",
86
+ type: String,
87
+ optional: true),
88
+ FastlaneCore::ConfigItem.new(key: :keystore_alias,
89
+ description: "Keystore alias",
90
+ env_name: "BITRISEIO_ANDROID_KEYSTORE_ALIAS",
91
+ type: String,
92
+ optional: true),
93
+ FastlaneCore::ConfigItem.new(key: :key_password,
94
+ description: "Private key password",
95
+ env_name: "BITRISEIO_ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD",
96
+ type: String,
97
+ optional: true)
98
+ ]
99
+ end
100
+
101
+ def self.available_options
102
+ [
103
+ FastlaneCore::ConfigItem.new(key: :client_name,
104
+ description: "The name of the client",
105
+ env_name: "CLIENT_NAME",
106
+ type: String,
107
+ verify_block: proc do |value|
108
+ UI.user_error!("Didn't pass a valid client name") unless value
109
+ end,
110
+ optional: false),
111
+ FastlaneCore::ConfigItem.new(key: :product_name,
112
+ description: "The name of the product",
113
+ env_name: "PRODUCT_NAME",
114
+ type: String,
115
+ verify_block: proc do |value|
116
+ UI.user_error!("Didn't pass a valid product name") unless value
117
+ end,
118
+ optional: false),
119
+ FastlaneCore::ConfigItem.new(key: :version,
120
+ description: "The app version e.g. 0.1.0",
121
+ type: String,
122
+ verify_block: proc do |value|
123
+ UI.user_error!("Didn't pass a valid version name") unless value
124
+ end,
125
+ optional: false),
126
+ FastlaneCore::ConfigItem.new(key: :build_number,
127
+ description: "The app build number e.g. 3948",
128
+ default_value: Apadmi::Grout::GitUtils.number_of_commits,
129
+ type: String,
130
+ verify_block: proc do |value|
131
+ UI.user_error!("Didn't pass a valid build number") unless value
132
+ end,
133
+ optional: false),
134
+ FastlaneCore::ConfigItem.new(key: :output_name,
135
+ description: "The desired name of the output file",
136
+ default_value: nil,
137
+ type: String,
138
+ optional: true),
139
+ FastlaneCore::ConfigItem.new(key: :output_directory,
140
+ description: "The desired output location",
141
+ env_name: "BITRISE_DEPLOY_DIR",
142
+ type: String,
143
+ default_value: "#{Apadmi::Grout::GitUtils.git_root}/build",
144
+ verify_block: proc do |value|
145
+ UI.user_error!("Didn't pass a valid output directory") unless value
146
+ end,
147
+ optional: false),
148
+ FastlaneCore::ConfigItem.new(key: :gradle_command,
149
+ description: "The gradle command e.g assembleRelease",
150
+ type: String,
151
+ verify_block: proc do |value|
152
+ UI.user_error!("Didn't pass a valid gradle command") unless value
153
+ end,
154
+ optional: false),
155
+ FastlaneCore::ConfigItem.new(key: :inject_signing_creds,
156
+ description: "Whether or not to inject the signing credentials",
157
+ type: Boolean,
158
+ default_value: true,
159
+ optional: true),
160
+ FastlaneCore::ConfigItem.new(key: :additional_config_properties,
161
+ description: "Config properties to be passed through to gradle",
162
+ type: Hash,
163
+ default_value: {},
164
+ optional: true)
165
+ ] + Fastlane::Actions::GradleAction.available_options + fastlane_signing_properties
166
+ end
167
+
168
+ def self.is_supported?(platform)
169
+ platform == :android
170
+ end
171
+ end
172
+ end
173
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Fastlane
4
4
  module ApadmiGrout
5
- VERSION = "2.2.3"
5
+ VERSION = "2.3.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-apadmi_grout
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.3
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Apadmi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-26 00:00:00.000000000 Z
11
+ date: 2023-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: apadmi_grout
@@ -160,6 +160,7 @@ files:
160
160
  - CHANGELOG.md
161
161
  - LICENSE
162
162
  - lib/fastlane/plugin/apadmi_grout.rb
163
+ - lib/fastlane/plugin/apadmi_grout/actions/build_apk_or_aab_action.rb
163
164
  - lib/fastlane/plugin/apadmi_grout/actions/build_ipa_action.rb
164
165
  - lib/fastlane/plugin/apadmi_grout/actions/find_tickets_to_move_action.rb
165
166
  - lib/fastlane/plugin/apadmi_grout/actions/generate_release_notes_action.rb