[mkbundle] Add `mkbundle --dos2unix` parameter.
authorJonathan Pryor <jonpryor@vt.edu>
Fri, 31 Jul 2015 19:21:57 +0000 (15:21 -0400)
committerJonathan Pryor <jonpryor@vt.edu>
Fri, 31 Jul 2015 19:35:37 +0000 (15:35 -0400)
commit7d68d78eee9f0f48adee310aa901ff66231d1a42
treeedb2a37605ad52b34dc0ab944753edd1821124f5
parent832f63035ff9912284e4acf2093d10437bc2a063
[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