Skip to content

Commit

Permalink
Fix problem that the fastlane-plugin-versioning_android plugin introd…
Browse files Browse the repository at this point in the history
…uces

This plugin is unable to read the version name when it is a variable. It reads it as a string.
See this:
beplus/fastlane-plugin-versioning_android#7
  • Loading branch information
micbakos-rdx committed May 23, 2023
1 parent 3f4a121 commit 0d9ca89
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ GEM
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3)
fastlane-plugin-firebase_app_distribution (0.3.8)
fastlane-plugin-json (1.1.0)
fastlane-plugin-versioning_android (0.1.0)
gh_inspector (1.1.3)
google-apis-androidpublisher_v3 (0.31.0)
Expand Down Expand Up @@ -218,6 +219,7 @@ PLATFORMS
DEPENDENCIES
fastlane
fastlane-plugin-firebase_app_distribution
fastlane-plugin-json
fastlane-plugin-versioning_android

BUNDLED WITH
Expand Down
8 changes: 6 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ def debugPropertiesFile = rootProject.file("keystore-development.properties")
def debugKeystoreProperties = new Properties()
debugKeystoreProperties.load(new FileInputStream(debugPropertiesFile))

static def getCommitHash() {
'git rev-parse --verify --short HEAD'.execute().text.trim()
}

android {
signingConfigs {
debug {
Expand Down Expand Up @@ -63,7 +67,7 @@ android {
buildTypes {
debug {
testCoverageEnabled true
versionNameSuffix "-" + rootProject.ext.internalVersionName
versionNameSuffix "-" + rootProject.ext.internalVersionName + "-" + getCommitHash()
resValue "string", "app_name", "Radix Wallet Dev"
}
debugAlpha {
Expand All @@ -78,7 +82,7 @@ android {
debugPreview {
initWith release
applicationIdSuffix ".preview"
versionNameSuffix "-" + rootProject.ext.internalVersionName
versionNameSuffix "-" + rootProject.ext.internalVersionName + "-" + getCommitHash()
minifyEnabled true
signingConfig signingConfigs.debugPreview
resValue "string", "app_name", "Radix Wallet Preview"
Expand Down
4 changes: 2 additions & 2 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ lane :release_to_google_play do
skip_upload_screenshots: true,
release_status: "draft",
json_key: ENV["GOOGLE_PLAY_PREVIEW_DEPLOYER_JSON_FILE"]
)
)

build_number_to_commit = File.read("../versioning/#{BUILD_NUMBER_FILE}")
version_name = android_get_version_name
Expand Down Expand Up @@ -146,4 +146,4 @@ lane :bump_build_number do |options|
gradle_file: "app/build.gradle"
)

end
end
3 changes: 2 additions & 1 deletion fastlane/Pluginfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
# Ensure this file is checked in to source control!

gem 'fastlane-plugin-firebase_app_distribution'
gem 'fastlane-plugin-versioning_android'
gem 'fastlane-plugin-versioning_android'
gem 'fastlane-plugin-json'
8 changes: 8 additions & 0 deletions fastlane/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ Deploy to Google Play Console



### get_version_name

```sh
[bundle exec] fastlane get_version_name
```



----

This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run.
Expand Down

0 comments on commit 0d9ca89

Please sign in to comment.