vladimirpetrovski / bitrise-step-version-extractor-android

Bitrise step for extracting the versionName and the versionCode on Android.
https://bitrise.io
MIT License
1 stars 4 forks source link

Step is parsing first output instead of last #7

Closed giorgi-rsi closed 2 years ago

giorgi-rsi commented 2 years ago

The step is trying to parse the first output for version name and the second for version code. Instead, it should be parsing the last output for version code and one before the last for version name.

This is an issue when for example default config is printing something also

defaultConfig {
  ...
  println "Build started"
}

the output will be:

Build started

> Task :app:printVersion
0.0.1-a2eb417e
1

Step will put Build as version name and started as version code, instead of 0.0.1-a2eb417e and 1

giorgi-rsi commented 2 years ago

There is a tailing of output in step tail -n 2, but the step does not work during the build.