Class: Fastlane::Wpmreleasetoolkit::Versioning::DerivedBuildCodeFormatter
- Inherits:
-
Object
- Object
- Fastlane::Wpmreleasetoolkit::Versioning::DerivedBuildCodeFormatter
- Defined in:
- lib/fastlane/plugin/wpmreleasetoolkit/versioning/formatters/derived_build_code_formatter.rb
Overview
The ‘DerivedBuildCodeFormatter` class is a specialized build code formatter for derived build codes. It takes in an AppVersion object and derives a build code from it.
Instance Method Summary collapse
-
#build_code(build_code = nil, version:) ⇒ String
Calculate the next derived build code.
Instance Method Details
#build_code(build_code = nil, version:) ⇒ String
Calculate the next derived build code.
This method derives a new build code from the given AppVersion object by concatenating the digit 1, the major version, the minor version, the patch version, and the build number.
to have a consistent signature with other build code formatters.
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/versioning/formatters/derived_build_code_formatter.rb', line 19 def build_code(build_code = nil, version:) format( # 1 is appended to the beginning of the string in case there needs to be additional platforms or # extensions that could then use a different digit prefix such as 2, etc. '1%<major>.2i%<minor>.2i%<patch>.2i%<build_number>.2i', major: version.major, minor: version.minor, patch: version.patch, build_number: version.build_number ) end |