Create classic snapshot of bgen and update tests/scripts (#3153)

Previous PMCS removal changes froze XamMac.BindingAttributes.dll but not bgen.exe which causes interesting issues when we make changes there and run classic XM tests.

This can be seen here: #3147

This PR freezes bgen-classic in macios-binaries (which will need to be added to master and bumped before this goes in) and update various scripts/tests.
This commit is contained in:
Chris Hamons 2018-01-03 15:41:49 -06:00 коммит произвёл GitHub
Родитель 09e346142e
Коммит 4c5161a446
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
7 изменённых файлов: 32 добавлений и 8 удалений

2
external/macios-binaries поставляемый

@ -1 +1 @@
Subproject commit 67ca117a455f5b8f614ac87c6c762768a7f356d9
Subproject commit f88ef91e05bc589b718d67310ebcfc771e62eac1

Просмотреть файл

@ -195,7 +195,9 @@ MAC_TARGETS_DIRS += \
MAC_TARGETS += \
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/bin/bgen \
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/bin/bgen-classic \
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/bgen/bgen.exe \
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/bgen/bgen-classic.exe \
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/bgen/XamMac.BindingAttributes.dll \
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/bgen/Xamarin.Mac-full.BindingAttributes.dll \
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/bgen/Xamarin.Mac-mobile.BindingAttributes.dll \
@ -207,6 +209,10 @@ $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/bin/bgen: | $(MAC_DESTDIR)$(MAC_FRAME
$(Q_GEN) printf "#!/bin/sh -e\n\nexec /Library/Frameworks/Mono.framework/Versions/Current/bin/mono64 --debug $(abspath $(MAC_TARGETDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/bgen/bgen.exe) \"\$$@\"\n" > $@
$(Q) chmod +x $@
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/bin/bgen-classic: | $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/bin
$(Q_GEN) printf "#!/bin/sh -e\n\nexec /Library/Frameworks/Mono.framework/Versions/Current/bin/mono64 --debug $(abspath $(MAC_TARGETDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/bgen/bgen-classic.exe) \"\$$@\"\n" > $@
$(Q) chmod +x $@
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/bin/bmac: bmac.ikvm | $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/bin
$(Q) install -m 0755 $< $@
@ -218,6 +224,10 @@ $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/bgen/%.exe: build/common/bgen.exe
$(Q) install -m 0755 $< $@
$(Q) install -m 0644 $< $(@:.exe=.pdb)
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/bgen/bgen-classic.exe: $(MACIOS_BINARIES_PATH)/bgen.exe
$(Q) install -m 0755 $< $@
$(Q) install -m 0644 $< $(@:.exe=.pdb)
$(MAC_BUILD_DIR)/XamMac.BindingAttributes.dll: $(MACIOS_BINARIES_PATH)/XamMac.BindingAttributes.dll
$(Q) mkdir -p $(dir $@)
$(Q) cp $< $@

Просмотреть файл

@ -13,6 +13,8 @@ fi
ROOT_DIR=$BIN_DIR/..
bgen_path=$BIN_DIR/bgen
btouch_arguments=()
for arg in "$@"; do
if [[ $sdk == next-arg ]]; then
@ -41,6 +43,7 @@ sdk=$(echo $sdk | tr '[:upper:]' '[:lower:]')
case $sdk in
xammac)
refs="--target-framework=XamMac,v1.0"
bgen_path=$BIN_DIR/bgen-classic
;;
mobile|xamarin.mac)
refs="--target-framework=Xamarin.Mac,Version=v2.0,Profile=Mobile"
@ -60,4 +63,4 @@ mobile|xamarin.mac)
;;
esac
exec $BIN_DIR/bgen $refs "${btouch_arguments[@]}"
exec $bgen_path $refs "${btouch_arguments[@]}"

Просмотреть файл

@ -352,6 +352,12 @@ namespace Xamarin.Tests
}
}
public static string BGenClassicPath {
get {
return Path.Combine (BinDirXM, "bgen-classic");
}
}
public static string MmpPath {
get {
return Path.Combine (BinDirXM, "mmp");

Просмотреть файл

@ -156,10 +156,13 @@ namespace GeneratorTests
}
[Test]
public void Bug31788 ()
[TestCase (Profile.macClassic)]
[TestCase (Profile.macFull)]
[TestCase (Profile.macModern)]
public void Bug31788 (Profile profile)
{
var bgen = new BGenTool ();
bgen.Profile = Profile.macClassic;
bgen.Profile = profile;
bgen.Defines = BGenTool.GetDefaultDefines (bgen.Profile);
bgen.CreateTemporaryBinding (File.ReadAllText (Path.Combine (Configuration.SourceRoot, "tests", "generator", "bug31788.cs")));
bgen.AssertExecute ("build");

Просмотреть файл

@ -40,9 +40,9 @@ namespace Xamarin.Tests
public string WarnAsError; // Set to empty string to pass /warnaserror, set to non-empty string to pass /warnaserror:<nonemptystring>
public string NoWarn; // Set to empty string to pass /nowarn, set to non-empty string to pass /nowarn:<nonemptystring>
protected override string ToolPath { get { return Configuration.BGenPath; } }
protected override string ToolPath { get { return Profile == Profile.macClassic ? Configuration.BGenClassicPath : Configuration.BGenPath; } }
protected override string MessagePrefix { get { return "BI"; } }
protected override string MessageToolName { get { return "bgen"; } }
protected override string MessageToolName { get { return Profile == Profile.macClassic ? "bgen-classic" : "bgen"; } }
public BGenTool ()
{

Просмотреть файл

@ -537,7 +537,8 @@ namespace BI1062Tests {
[Test]
[TestCase (Profile.iOS)]
[TestCase (Profile.macClassic)]
[TestCase (Profile.macFull)]
[TestCase (Profile.macModern)]
public void WarnAsError (Profile profile)
{
const string message = "The member 'SomeMethod' is decorated with [Static] and its container class warnaserrorTests.FooObject_Extensions is decorated with [Category] this leads to hard to use code. Please inline SomeMethod into warnaserrorTests.FooObject class.";
@ -587,7 +588,8 @@ namespace BI1062Tests {
[Test]
[TestCase (Profile.iOS)]
[TestCase (Profile.macClassic)]
[TestCase (Profile.macFull)]
[TestCase (Profile.macModern)]
public void NoWarn (Profile profile)
{
const string message = "The member 'SomeMethod' is decorated with [Static] and its container class nowarnTests.FooObject_Extensions is decorated with [Category] this leads to hard to use code. Please inline SomeMethod into nowarnTests.FooObject class.";