Open krjw-eyev opened 3 years ago
Agree. Coming up in next release
I also needed this to get this to use in a commit message like this:
git commit -m "Version $major.$minor.$patch+$code"
I can still wait for the new release but: Do you think there is a better way of doing it?
Would great if this feature comes fast :)
This feature would be really useful, any news on when it will be available?
@krjw-eyev does the code you posted work ? have you succeeded to get the current version and put it in a variable? I need to know , because am trying to put the version in a git tag but don't know how , since am new to Fastlane and ruby. If anyone can help I'd be grateful.
@davormaricdev any progress / news on the feature? Is there a way I can read the. version after incrementing it then print it in a git tag ? I'd be grateful for your help
This is what I am using. I hope it helps you.
def versionString()
file=YAML.load_file('../version.yml')
version="#{file['major']}.#{file['minor']}.#{file['patch']}"
UI.message version
return version
end
Usage:
lane :set_version_ios do
version = versionString()
increment_version_number_in_xcodeproj(
version_number: version,
xcodeproj: './ios/Runner.xcodeproj'
)
end
@krjw-eyev thank you so much that was extremely helpful. Happy coding
@krjw-eyev am getting the following error
` No such file or directory @ rb_sysopen - ../version.yml
` apparently it is not able to read version.yml although am sure the path is correct because it can read it in bump version lanes , do you happen to know how I can fix this please?
It depends where your version.yml
file is located. ./
is the current directory ../
is the parent directory. ../../
is the parents parent directory and so on.
My folder structure looks like this:
my-flutter-app/
├─ fastlane/
│ ├─ Fastfile
├─ version.yml
I execute fastlane in the my-flutter-app
folder.
@krjw-eyev thank you for your help , I was using the wrong path. works now :)
Is this plugin discontinued???
Fastlane-plugin-flutter_vers | 1.0.0 | No actions found | | ion_manager
[!] No actions were found while loading one or more plugins
Please use bundle exec fastlane
with plugins
More info - https://docs.fastlane.tools/plugins/using-plugins/#run-with-plugins .
Add these with the appropriate paths to your Fastfile and you should be good to go. They came from a little deeper in the plugin (not my code).
` def versionCode() @git = Git.open('../../') head = @git.object('HEAD') commit = @git.gcommit(head.sha) commit.date.to_i - GIT_OFFSET end
def versionString() file=YAML.load_file('../../version.yml') version="#{file['major']}.#{file['minor']}.#{file['patch']}" return version end `
This is more of a feature request if I am not wrong.
I may misuse this since I am new to fastlane and ruby, but I think it would be great to get the version back when using