beplus / fastlane-plugin-versioning_android Goto Github PK
View Code? Open in Web Editor NEWAndroid Versioning Plugin for Fastlane
License: MIT License
Android Versioning Plugin for Fastlane
License: MIT License
I've tried in many ways to pass the version name to include the single colon as the syntax demands, but it always includes the version name without the colons
gradle_file = "./android/app/build.gradle"
android_set_version_name(
gradle_file: gradle_file,
bump_type: "patch"
)
version_name = android_get_version_name(gradle_file: gradle_file)
puts(version_name) # Returns an empy string
versionName ""
While android_set_version_code(gradle_file: gradle_file)
works perfectly, no problem.
Why?
Hi, could you add in your plugin a parameter in order to manager flavours?
Indeed, in case of our app, we have the same code to build two different apps and so have two flavours defined and for each a versionName and a versionCode value.
Moreover, I've tested your plugin and I don't understand how the bump_type parameter works since I must set a value for the version_name parameter. I thought that the bump_type will increment automatically the versionName value. Which values are expected for bump_type parameter?
Thanks a lot.
Somehow it cannot find the build.gradle file...
------------------------------
--- Step: default_platform ---
------------------------------
Driving the lane 'android version' 🚀
--------------------------------------
--- Step: android_get_version_code ---
--------------------------------------
An exception occured while reading gradle file: No such file or directory @ rb_sysopen - /Users/<me>/Application/MyAoo/app/build.gradle
But when I take the exact path printed in the terminal, it's found...
Using fastlane 2.139.0
Could not find fastlane-plugin-versioning_android-0.1.1 in any of the sources.
The latest version is v0.1.0 on RubyGems
I have found a bug in android_set_version_name
.
If there is a space in the version name, for example:
"3.2.1 some word"
only the last set of characters after the last space are replaced. So if I were to try to set the version name to "3.2.2 another word" the actual version name in the gradle file will be:
"3.2.1 some 3.2.2 another word"
Using android_set_version_name
without options sets versionName
to an empty string. If you run it twice it then completely removes the property from gradle.
If you instead try setting a specific version (e.g. android_set_version_name(version_name: '1.0.0')
) it sets an invalid raw numeric instead of a string
def flutterVersionName = 1.0.0 // Error's when building - invalid format
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
An exception occured while reading gradle file: No such file or directory @ rb_sysopen
android_get_version_code
and android_get_version_name
containing white space in provided gradle path.E-g .
android_get_version_code(gradle_file: "MBFS/build.gradle")
works fine.
android_get_version_code(gradle_file: "MBFS\ JP/build.gradle")
exception occur.
android_set_version_name Action not found file when used build.gradle.ktx ( kotlin script).
It is working in build.gradle. but build.gradle.ktx is not working.
Please handling branch ( ktx, groovy ) and apply.
Before creating an apk file, I call android_set_version_code & android_set_version_name, but it seems that only android_set_version_name works. Before and after creating apk, I use to check android_get_version_code, but then I check the output.json file, in which buildCode: 1, and buildName: "8539".
Hello,
I'm facing a problem when invoke android_get_version_name
Due my build.gradle has following structure:
android {
def versionMajor = 6
def versionMinor = 8
def versionPatch = 27
compileSdkVersion 30
....
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
Then android_get_version_name
is returned ${versionMajor}.${versionMinor}.${versionPatch}
instead of 6.8.27
, I'm not sure if there's a problem with this plugin or do I have to change something from my side.
There's the fastlane step i have
platform :android do
desc "Runs something fun"
lane :doSomethingFun do
gradle(task: "test")
increment_version_code(
gradle_file_path: “app/build.gradle”
)
versionName = android_get_version_name // <!-- here I'm getting `${versionMajor}.${versionMinor}.${versionPatch}`
#gradle(task: "test")
end
I am being faced with the following error when running a Fastlane lane in a Docker container (based on debian:bullseye-slim
):
/usr/lib/ruby/2.7.0/fileutils.rb:548:in `rename': Invalid cross-device link @ rb_file_s_rename - (/tmp/fastlaneIncrementVersionName20230307-13093-1g2hon7, ./android/app/build.gradle) (Errno::EXDEV)
/usr/lib/ruby/2.7.0/fileutils.rb:1424:in `utime': \e[31m[!] Operation not permitted @ apply2files - ./android/app/build.gradle\e[0m (Errno::EPERM)
Any specific reason this plugin uses a temporary file in the /tmp
folder for making changes to the build.gradle
instead of replacing directly in the original build.gradle
file?
This seems like an unnecessary detour?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.