diff --git a/msbuild/Xamarin.Mac.Tasks/Xamarin.Mac.Common.targets b/msbuild/Xamarin.Mac.Tasks/Xamarin.Mac.Common.targets index 009aef1ed287..9965d7c7960d 100644 --- a/msbuild/Xamarin.Mac.Tasks/Xamarin.Mac.Common.targets +++ b/msbuild/Xamarin.Mac.Tasks/Xamarin.Mac.Common.targets @@ -186,6 +186,13 @@ Copyright (C) 2014 Xamarin. All rights reserved. + + + + + + + <_CollectBundleResourcesDependsOn> _CompileImageAssets; diff --git a/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets b/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets index 0b826bcc3ed4..c05e6e6c2926 100644 --- a/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets +++ b/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets @@ -458,6 +458,13 @@ Copyright (C) 2013-2016 Xamarin. All rights reserved. + + + + + + + <_CollectBundleResourcesDependsOn> _CompileInterfaceDefinitions; diff --git a/msbuild/tests/Xamarin.iOS.Tasks.Tests/TargetTests/TargetTests.cs b/msbuild/tests/Xamarin.iOS.Tasks.Tests/TargetTests/TargetTests.cs index b9072574cefb..8428c43b5abd 100644 --- a/msbuild/tests/Xamarin.iOS.Tasks.Tests/TargetTests/TargetTests.cs +++ b/msbuild/tests/Xamarin.iOS.Tasks.Tests/TargetTests/TargetTests.cs @@ -139,14 +139,19 @@ public void GetReferencedAssemblies_Executable () { RunTargetOnInstance (MonoTouchProjectInstance, TargetName.ResolveReferences); var references = MonoTouchProjectInstance.GetItems ("ReferencePath").ToArray (); + var expected_references = new string[] { + "MyLibrary.dll", + "System.dll", + "System.Xml.dll", + "System.Core.dll", + "mscorlib.dll", + "Xamarin.iOS.dll", + "System.Drawing.Common.dll", + }; + Array.Sort (expected_references); - Assert.AreEqual (6, references.Length, "#1"); - Assert.IsTrue (references.Any (t => t.EvaluatedInclude.Contains ("MyLibrary")), "#2"); - Assert.IsTrue (references.Any (t => t.EvaluatedInclude.Contains ("System")), "#3a"); - Assert.IsTrue (references.Any (t => t.EvaluatedInclude.Contains ("System.Xml")), "#3b"); - Assert.IsTrue (references.Any (t => t.EvaluatedInclude.Contains ("System.Core")), "#3c"); - Assert.IsTrue (references.Any (t => t.EvaluatedInclude.Contains ("mscorlib")), "#3d"); - Assert.IsTrue (references.Any (t => t.EvaluatedInclude.Contains ("Xamarin.iOS")), "#3e"); + var actual_references = references.Select ((v) => Path.GetFileName (v.EvaluatedInclude)).OrderBy ((v) => v); + CollectionAssert.AreEquivalent (expected_references, actual_references, "References"); } [Test] @@ -154,13 +159,18 @@ public void GetReferencedAssemblies_Library () { RunTargetOnInstance (LibraryProjectInstance, TargetName.ResolveReferences); var references = LibraryProjectInstance.GetItems ("ReferencePath").ToArray (); - - Assert.AreEqual (5, references.Length, "#1"); - Assert.IsTrue (references.Any (t => t.EvaluatedInclude.Contains ("System")), "#2a"); - Assert.IsTrue (references.Any (t => t.EvaluatedInclude.Contains ("System.Xml")), "#2b"); - Assert.IsTrue (references.Any (t => t.EvaluatedInclude.Contains ("System.Core")), "#2c"); - Assert.IsTrue (references.Any (t => t.EvaluatedInclude.Contains ("mscorlib")), "#2d"); - Assert.IsTrue (references.Any (t => t.EvaluatedInclude.Contains ("Xamarin.iOS")), "#2e"); + var expected_references = new string[] { + "System.dll", + "System.Xml.dll", + "System.Core.dll", + "mscorlib.dll", + "Xamarin.iOS.dll", + "System.Drawing.Common.dll", + }; + Array.Sort (expected_references); + + var actual_references = references.Select ((v) => Path.GetFileName (v.EvaluatedInclude)).OrderBy ((v) => v); + CollectionAssert.AreEquivalent (expected_references, actual_references, "References"); } [Test] diff --git a/tests/common/mac/ProjectTestHelpers.cs b/tests/common/mac/ProjectTestHelpers.cs index 13982e6c66bc..8bae19ab7f25 100644 --- a/tests/common/mac/ProjectTestHelpers.cs +++ b/tests/common/mac/ProjectTestHelpers.cs @@ -167,6 +167,18 @@ public class UnifiedTestConfig // Generated by TestUnifiedExecutable/TestSystemMonoExecutable and added to TestCode public Guid guid { get; set; } + public string BundleName { + get { return AssemblyName != "" ? AssemblyName : ProjectName.Split ('.') [0]; } + } + + public string BundlePath { + get { return Path.Combine (TmpDir, "bin", Release ? "Release" : "Debug", BundleName + ".app"); } + } + + public string ExecutablePath { + get { return Path.Combine (BundlePath, "Contents", "MacOS", BundleName); } + } + public UnifiedTestConfig (string tmpDir) { TmpDir = tmpDir; @@ -427,9 +439,7 @@ public static string GenerateAndBuildUnifiedExecutable (UnifiedTestConfig config public static string RunGeneratedUnifiedExecutable (UnifiedTestConfig config) { - string bundleName = config.AssemblyName != "" ? config.AssemblyName : config.ProjectName.Split ('.')[0]; - string exePath = Path.Combine (config.TmpDir, "bin/" + (config.Release ? "Release/" : "Debug/") + bundleName + ".app/Contents/MacOS/" + bundleName); - return RunEXEAndVerifyGUID (config.TmpDir, config.guid, exePath); + return RunEXEAndVerifyGUID (config.TmpDir, config.guid, config.ExecutablePath); } public static OutputText TestUnifiedExecutable (UnifiedTestConfig config, bool shouldFail = false, string[] environment = null) diff --git a/tests/introspection/iOS/introspection-ios.csproj b/tests/introspection/iOS/introspection-ios.csproj index 7231a24d561a..c0e48c59fc88 100644 --- a/tests/introspection/iOS/introspection-ios.csproj +++ b/tests/introspection/iOS/introspection-ios.csproj @@ -143,7 +143,6 @@ - diff --git a/tests/mmptest/src/AssemblyReferencesTests.cs b/tests/mmptest/src/AssemblyReferencesTests.cs index 5fbb213eb37e..a0e39f702d94 100644 --- a/tests/mmptest/src/AssemblyReferencesTests.cs +++ b/tests/mmptest/src/AssemblyReferencesTests.cs @@ -1,5 +1,6 @@ using System; using System.IO; +using System.Linq; using System.Text; using NUnit.Framework; @@ -17,7 +18,11 @@ public void ShouldNotAllowReference_ToSystemDrawing () TestCode = "System.Drawing.RectangleF f = new System.Drawing.RectangleF ();", XM45 = true }; - TI.TestUnifiedExecutable (test, shouldFail: true); + TI.TestUnifiedExecutable (test); + var allAssembliesInBundle = Directory.GetFiles (test.BundlePath, "*.dll", SearchOption.AllDirectories).Select (Path.GetFileName); + Assert.That (allAssembliesInBundle, Does.Contain ("mscorlib.dll"), "mscorlib.dll"); + Assert.That (allAssembliesInBundle, Does.Contain ("System.Drawing.Common.dll"), "System.Drawing.Common.dll"); + Assert.That (allAssembliesInBundle, Does.Not.Contain ("System.Drawing.dll"), "System.Drawing.dll"); }); } diff --git a/tests/monotouch-test/monotouch-test.csproj b/tests/monotouch-test/monotouch-test.csproj index f4f66bec0846..84933fc6f8e0 100644 --- a/tests/monotouch-test/monotouch-test.csproj +++ b/tests/monotouch-test/monotouch-test.csproj @@ -156,7 +156,6 @@ - diff --git a/tests/xammac_tests/xammac_tests.csproj b/tests/xammac_tests/xammac_tests.csproj index bfdb67740a26..e8ce769f5672 100644 --- a/tests/xammac_tests/xammac_tests.csproj +++ b/tests/xammac_tests/xammac_tests.csproj @@ -60,7 +60,6 @@ -