[mkbundle] Add `mkbundle --dos2unix` parameter.
commit33a75810b545cd27e82ea4a4dcbf1a274f114642
authorJonathan Pryor <jonpryor@vt.edu>
Fri, 31 Jul 2015 19:21:57 +0000 (31 15:21 -0400)
committerJonathan Pryor <jonpryor@vt.edu>
Fri, 31 Jul 2015 19:36:32 +0000 (31 15:36 -0400)
treeb24b3922bc9031c8087c6a12879fb33c0e1731c6
parent2d1c17d47ea1dc031272939bbaaa3b549f232e42
[mkbundle] Add `mkbundle --dos2unix` parameter.

Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=25086
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=31875
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=32171

Reverts and reworks commit bcfec743.

The problem is that when Xamarin.Android is running mkbundle, dos2unix
should NEVER be used, because the Android NDK NEVER wants Unix-like
paths, which is what dos2unix creates.

Commit bcfec743 attempted to fix this by removing dos2unix invocation
from the Xamarin.Android codepath.

The problem is that the logic was backwards: it removed dos2unix
invocation when XAMARIN_ANDROID was NOT defined, and PRESERVED
dos2unix invocation when XAMARIN_ANDROID WAS defined.

Meaning commit bcfec743 broke normal/default mkbundle.exe use on
Windows -- it would no longer probe for and use dos2unix if present --
and Xamarin.Android use of mkbundle continued to check for and use
dos2unix if it was present, continuing the buggy behavior.

Doh!

Thus, a reworking: Add a `mkbundle --dos2unix` parameter.
If `mkbundle --dos2unix=false` is specified, dos2unix will NOT be
probed for, and will NOT be used. If `mkbundle --dos2unix` or
`mkbundle --dos2unix=true` is used, then dos2unix WILL be used.

This allows the caller to consistently, ahead of time, control
mkbundle's behavior regarding dos2unix, which will e.g. allow
Xamarin.Android to *always* specify --dos2unix=false, allowing things
to build as desired there.
mcs/tools/mkbundle/mkbundle.cs