From d98c22e39f847e46770643bc6dd7cba40db0daca Mon Sep 17 00:00:00 2001 From: Chris Hamons Date: Mon, 8 Apr 2019 10:26:23 -0500 Subject: [PATCH] [mmp] Don't apply libintl hack when you explicitly ask for that file (#5855) - A long while ago, this hack was added to mmp: // Shutup the warning until we decide on bug: 36478 if (shortendName.ToLowerInvariant () == "intl" && IsUnifiedFullXamMacFramework) - This breaks use cases were we explicitly ask for that file, so let's fix that for now until we can fix the root cause for real --- tests/mmptest/src/NativeReferencesTests.cs | 15 +++++++++++++++ tools/mmp/driver.cs | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/mmptest/src/NativeReferencesTests.cs b/tests/mmptest/src/NativeReferencesTests.cs index 93099ecb61..6d8a3c1e48 100644 --- a/tests/mmptest/src/NativeReferencesTests.cs +++ b/tests/mmptest/src/NativeReferencesTests.cs @@ -210,5 +210,20 @@ namespace Xamarin.MMP.Tests NativeReferenceTestCore (tmpDir, test, "MultipleNativeReferences_OnlyInvokeMMPOneTime_AndCopyEverythingIn", null, true); }); } + + + [Test] + public void ReferenceNativeRefNoCodeUsage_ShouldStillCopy () + { + MMPTests.RunMMPTest (tmpDir => { + TI.UnifiedTestConfig test = new TI.UnifiedTestConfig (tmpDir) { + XM45 = true, + ItemGroup = CreateSingleNativeRef ("/Library/Frameworks/Mono.framework/Libraries/libintl.dylib", "Dynamic") + }; + var log = TI.TestUnifiedExecutable (test); + Console.WriteLine (log.BuildOutput); + Assert.True (File.Exists (Path.Combine (tmpDir, "bin/Debug/XM45Example.app/Contents/MonoBundle/libintl.dylib"))); + }); + } } } diff --git a/tools/mmp/driver.cs b/tools/mmp/driver.cs index c73d0f0452..79d096c113 100644 --- a/tools/mmp/driver.cs +++ b/tools/mmp/driver.cs @@ -1616,7 +1616,7 @@ namespace Xamarin.Bundler { return true; } // Shutup the warning until we decide on bug: 36478 - if (shortendName.ToLowerInvariant () == "intl" && IsUnifiedFullXamMacFramework) + if (shortendName.ToLowerInvariant () == "intl" && !native_references.Any (x => x.Contains ("libintl.dylib")) && IsUnifiedFullXamMacFramework) return true; return false; }