Skip to content

Unable to version Android manifest because regular expressions are incorrect #5

Description

@AlexanderMelchers

Hi there,

I just downloaded your task today as I'm currently migrating our mobile App's build-definition into VSTS Online and yours seemed like a promising solution to version both our Android manifest and iOS property list (latter not yet tested). However, when trying to use the task to version our Android manifest, I got two warning messages, copied below:

##[warning]No matches for regex [(android:versionCode=)(\d+)(")] found in file /Users/vsts/agent/2.133.3/work/1/s/Droid/Properties/AndroidManifest.xml
##[warning]No matches for regex [(android:versionName=)(\d+\.\d+\.\d+)()] found in file /Users/vsts/agent/2.133.3/work/1/s/Droid/Properties/AndroidManifest.xml

What becomes immediately apparent here is that both patterns check for double quotes incorrectly. That is, the pattern for the version code checks for a closing quote, but does not look for an opening quote - and hence the pattern fails - whereas the pattern for the version name doesn't check for the quotes at all. In addition, I think it's not entirely justified to expect the version name to comprised a three-digit code. Ours is simply two-digit.

I'm now going to try to use custom patterns to still use your task to modify our Android manifest, but I think that, first of all, the above patterns should be fixed and, secondly, it might be an idea to allow users to view and - if needed - modify the patterns used to update their Android manifest. For if the latter option had been available already, I could have made the task work, even if the supplied patterns do not work...

Anyway, like I said, I still believe this to be a very promising task, so I hope development continues!

Kind regards,
Alexander.

Activity

  1. marc-mueller commented on May 24, 2018

    @marc-mueller
    Member

    Hi Alexander

    Thanks a lot for your feedback. I'm very sorry for the inconvenience! We ported the regular expressions from an older PowerShell Version of the task to Typescript and it looks like the regular expressions were messed up.

    The reason you don't see the regular expressions for the pre-defined replacements is that we actually didn't want to bother the user when picking a standard replacement. You can always use the custom expressions to to something special on your own.

    I have to quickly re-check the expressions but I think they should be correct like this:
    (android:versionCode=")(\d+)(")
    (android:versionName=")(\d+\.\d+(?:\.\d+)*)(")

    Can you confirm that?

    Thanks
    Marc

  2. AlexanderMelchers commented on May 24, 2018

    @AlexanderMelchers
    Author

    Hi Marc,

    Though I had written the regex patterns slightly differently (especially the second one), both of your samples work fine. Thanks!

    Looking forward to an updated version of your task, though, as this would allow me to run a single task rather than two separate custom expressions. Are you planning another release?

    All the best,
    Alexander.

  3. marc-mueller commented on May 31, 2018

    @marc-mueller
    Member

    Hi Alexander

    We just shipped version 0.8.5 with the fixed regex. Sorry that we haven't been able to fix this earlier. The regex were fixed within a minute, but we found another bug related to the code version we had to address.

    We still have to improve the configuration of the different settings to choose from, but at least we fixed the Android version replacement for now.

    All the best,
    Marc

  4. AlexanderMelchers commented on Jun 1, 2018

    @AlexanderMelchers
    Author

    Hi Marc,

    Cool! I just checked out your new version, and it's not really usable in our situation yet due the version name still being three-part (major, minor, build), but I guess that's what you meant with the last line in your reply. Still very much looking forward to future improvements, though! 👍

    Best regards,
    Alexander.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions