Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@
path = external/Xamarin.MacDev
url = ../../xamarin/Xamarin.MacDev
branch = main
[submodule "external/MonoTouch.Dialog"]
path = external/MonoTouch.Dialog
url = ../../migueldeicaza/MonoTouch.Dialog
branch = dotnet
1 change: 1 addition & 0 deletions Make.config
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ XAMARIN_MACDEV_PATH=$(TOP)/external/Xamarin.MacDev
MACCORE_PATH=$(TOP)/../maccore
MACIOS_BINARIES_PATH=$(TOP)/external/macios-binaries
IKVM_PATH=$(TOP)/external/ikvm-fork
MONOTOUCH_DIALOG_PATH=$(TOP)/external/MonoTouch.Dialog

MONO_PREFIX ?= /Library/Frameworks/Mono.framework/Versions/Current
SYSTEM_MCS=$(MONO_PREFIX)/bin/mcs
Expand Down
1 change: 1 addition & 0 deletions external/MonoTouch.Dialog
Submodule MonoTouch.Dialog added at 8e60f8
2 changes: 1 addition & 1 deletion external/Touch.Unit
1 change: 1 addition & 0 deletions mk/versions.mk
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ $(eval $(call CheckSubmoduleTemplate,opentk,OPENTK))
$(eval $(call CheckSubmoduleTemplate,Xamarin.MacDev,XAMARIN_MACDEV))
$(eval $(call CheckSubmoduleTemplate,macios-binaries,MACIOS_BINARIES))
$(eval $(call CheckSubmoduleTemplate,ikvm-fork,IKVM))
$(eval $(call CheckSubmoduleTemplate,MonoTouch.Dialog,MONOTOUCH_DIALOG))

include $(TOP)/mk/xamarin.mk

Expand Down
2 changes: 1 addition & 1 deletion msbuild/Xamarin.Shared/Xamarin.Shared.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2250,7 +2250,7 @@ Copyright (C) 2018 Microsoft. All rights reserved.
</CompileProductDefinition>
</Target>

<Target Name="_CreateInstaller" Condition="$(CreatePackage)" DependsOnTargets="Codesign;_CompileProductDefinition;_WriteAppManifest">
<Target Name="_CreateInstaller" Condition="'$(CreatePackage)' == 'true' And '$(_CanOutputAppBundle)' == 'true'" DependsOnTargets="Codesign;_CompileProductDefinition;_WriteAppManifest">
<CreateInstallerPackage
SessionId="$(BuildSessionId)"
Condition="'$(IsMacEnabled)' == 'true'"
Expand Down
13 changes: 8 additions & 5 deletions tests/common/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -769,20 +769,23 @@ public static void FixupTestFiles (string directory, string mode)
}
}

public static string [] CopyDotNetSupportingFiles (string targetDirectory)
public static string [] CopyDotNetSupportingFiles (params string[] targetDirectories)
{
var srcDirectory = Path.Combine (SourceRoot, "tests", "dotnet");
var files = new string [] { "global.json", "NuGet.config" };
var targets = new string [files.Length];
var targets = new List<string> ();
for (var i = 0; i < files.Length; i++) {
var fn = files [i];
targets [i] = Path.Combine (targetDirectory, fn);
var src = Path.Combine (srcDirectory, fn);
if (!File.Exists (src))
ExecutionHelper.Execute ("make", new [] { "-C", srcDirectory, fn });
File.Copy (src, targets [i], true);
foreach (var targetDirectory in targetDirectories) {
var target = Path.Combine (targetDirectory, fn);
File.Copy (src, target, true);
targets.Add (target);
}
}
return targets;
return targets.ToArray ();
}

public static Dictionary<string, string> GetBuildEnvironment (ApplePlatform platform)
Expand Down
8 changes: 6 additions & 2 deletions tests/common/shared-dotnet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
<SupportedOSPlatformVersion>10.0</SupportedOSPlatformVersion>
</PropertyGroup>
<ItemGroup Condition="'$(_PlatformName)' == 'iOS'">
<PackageReference Include="MonoTouch.Dialog" Version="2.0.0-pre1" />
</ItemGroup>

<!-- Logic for tvOS -->
Expand All @@ -22,7 +21,6 @@
<SupportedOSPlatformVersion>10.0</SupportedOSPlatformVersion>
</PropertyGroup>
<ItemGroup Condition="$(TargetFramework.EndsWith('-tvos'))">
<PackageReference Include="MonoTouch.Dialog" Version="2.0.0-pre1" />
</ItemGroup>

<!-- Logic for macOS -->
Expand All @@ -40,4 +38,10 @@
</PropertyGroup>

<!-- Logic for all test suites -->
<ItemGroup>
<PackageReference Include="NUnitLite" Version="3.12.0" />
<ProjectReference Include="$(MSBuildThisFileDirectory)\..\..\external\Touch.Unit\Touch.Client\dotnet\$(_PlatformName)\Touch.Client-$(_PlatformName).dotnet.csproj" />
</ItemGroup>

<Import Project="$(MSBuildThisFileDirectory)/../nunit.framework.targets" />
</Project>
1 change: 1 addition & 0 deletions tests/dotnet/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,4 @@ copy-dotnet-config: $(TARGETS)
$(CP) -c NuGet.config global.json "$$dir"; \
done
$(Q) $(CP) -c NuGet.config global.json $(TOP)/external/Touch.Unit/Touch.Client/dotnet
$(Q) $(CP) -c NuGet.config global.json $(TOP)/external/MonoTouch.Dialog/MonoTouch.Dialog/dotnet
10 changes: 5 additions & 5 deletions tests/dotnet/UnitTests/PackTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ public void BindingFrameworksProject (ApplePlatform platform, bool noBindingEmbe
public void BindingXcFrameworksProject (ApplePlatform platform, bool noBindingEmbedding)
{
var project = "bindings-xcframework-test";
var assemblyName = "bindings-framework-test";
Configuration.IgnoreIfIgnoredPlatform (platform);

var project_path = Path.Combine (Configuration.RootPath, "tests", project, "dotnet", platform.AsString (), $"{project}.csproj");
Expand All @@ -123,23 +124,22 @@ public void BindingXcFrameworksProject (ApplePlatform platform, bool noBindingEm
properties ["OutputPath"] = outputPath + Path.DirectorySeparatorChar;
properties ["IntermediateOutputPath"] = intermediateOutputPath + Path.DirectorySeparatorChar;
properties ["NoBindingEmbedding"] = noBindingEmbedding ? "true" : "false";
properties ["AssemblyName"] = project;

DotNet.AssertPack (project_path, properties);

var nupkg = Path.Combine (outputPath, project + ".1.0.0.nupkg");
var nupkg = Path.Combine (outputPath, assemblyName + ".1.0.0.nupkg");
Assert.That (nupkg, Does.Exist, "nupkg existence");

var archive = ZipFile.OpenRead (nupkg);
var files = archive.Entries.Select (v => v.FullName).ToHashSet ();
Assert.That (archive.Entries.Count, Is.EqualTo (noBindingEmbedding ? 6 : 5), $"nupkg file count - {nupkg}");
Assert.That (files, Does.Contain (project + ".nuspec"), "nuspec");
Assert.That (files, Does.Contain (assemblyName + ".nuspec"), "nuspec");
Assert.That (files, Does.Contain ("_rels/.rels"), ".rels");
Assert.That (files, Does.Contain ("[Content_Types].xml"), "[Content_Types].xml");
Assert.That (files, Does.Contain ($"lib/{platform.ToFrameworkWithDefaultVersion ()}/{project}.dll"), $"{project}.dll");
Assert.That (files, Does.Contain ($"lib/{platform.ToFrameworkWithDefaultVersion ()}/{assemblyName}.dll"), $"{assemblyName}.dll");
Assert.That (files, Has.Some.Matches<string> (v => v.StartsWith ("package/services/metadata/core-properties/", StringComparison.Ordinal) && v.EndsWith (".psmdcp", StringComparison.Ordinal)), "psmdcp");
if (noBindingEmbedding) {
Assert.That (files, Does.Contain ($"lib/{platform.ToFrameworkWithDefaultVersion ()}/{project}.resources.zip"), $"{project}.resources.zip");
Assert.That (files, Does.Contain ($"lib/{platform.ToFrameworkWithDefaultVersion ()}/{assemblyName}.resources.zip"), $"{assemblyName}.resources.zip");
}
}

Expand Down
10 changes: 7 additions & 3 deletions tests/dotnet/UnitTests/ProjectTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,10 @@ public void BuildInterdependentBindingProjects (string platform)
Configuration.CopyDotNetSupportingFiles (dotnet_bindings_dir);
Configuration.CopyDotNetSupportingFiles (dotnet_bindings_dir.Replace (assemblyName, "bindings-test"));
Configuration.CopyDotNetSupportingFiles (dotnet_bindings_dir.Replace (assemblyName, "bindings-test2"));
var cleanupSupportFiles = Configuration.CopyDotNetSupportingFiles (Path.Combine (Configuration.SourceRoot, "external", "Touch.Unit", "Touch.Client/dotnet"));
var cleanupSupportFiles = Configuration.CopyDotNetSupportingFiles (
Path.Combine (Configuration.SourceRoot, "external", "Touch.Unit", "Touch.Client", "dotnet"),
Path.Combine (Configuration.SourceRoot, "external", "MonoTouch.Dialog", "MonoTouch.Dialog", "dotnet")
);
try {
var result = DotNet.AssertBuild (project_path, verbosity);
var lines = BinLog.PrintToLines (result.BinLogPath);
Expand Down Expand Up @@ -476,8 +479,9 @@ public void InvalidRuntimeIdentifier (ApplePlatform platform, string runtimeIden
var properties = GetDefaultProperties (runtimeIdentifier);
var rv = DotNet.AssertBuildFailure (project_path, properties);
var errors = BinLog.GetBuildLogErrors (rv.BinLogPath).ToArray ();
Assert.AreEqual (1, errors.Length, "Error count");
Assert.AreEqual ($"The RuntimeIdentifier '{runtimeIdentifier}' is invalid.", errors [0].Message, "Error message");
var uniqueErrors = errors.Select (v => v.Message).Distinct ().ToArray ();
Assert.AreEqual (1, uniqueErrors.Length, "Error count");
Assert.AreEqual ($"The RuntimeIdentifier '{runtimeIdentifier}' is invalid.", uniqueErrors [0], "Error message");
}

[Test]
Expand Down
5 changes: 0 additions & 5 deletions tests/framework-test/dotnet/shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
<Import Project="$(RootTestsDirectory)/common/shared-dotnet.csproj" />

<ItemGroup>
<PackageReference Include="NUnitLite" Version="3.12.0" />
<ProjectReference Include="$(RootTestsDirectory)\..\external\Touch.Unit\Touch.Client\dotnet\$(_PlatformName)\Touch.Client-$(_PlatformName).dotnet.csproj" />
<!-- MonoTouch.Dialog references System.Json, which isn't shipped with .NET5, so reference the NuGet instead -->
<PackageReference Include="System.Json" Version="4.7.1" />

<ProjectReference Include="$(RootTestsDirectory)\bindings-framework-test\dotnet\$(_PlatformName)\bindings-framework-test.csproj" />
</ItemGroup>

Expand Down
4 changes: 0 additions & 4 deletions tests/fsharp/dotnet/shared.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
<Import Project="$(RootTestsDirectory)/common/shared-dotnet.csproj" />

<ItemGroup>
<PackageReference Include="NUnitLite" Version="3.12.0" />
<ProjectReference Include="$(RootTestsDirectory)\..\external\Touch.Unit\Touch.Client\dotnet\$(_PlatformName)\Touch.Client-$(_PlatformName).dotnet.csproj" />
<!-- MonoTouch.Dialog references System.Json, which isn't shipped with .NET5, so reference the NuGet instead -->
<PackageReference Include="System.Json" Version="4.7.1" />
<PackageReference Include="FSharp.Core" Version="5.0.0" />
</ItemGroup>

Expand Down
5 changes: 0 additions & 5 deletions tests/interdependent-binding-projects/dotnet/shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@
<Import Project="$(RootTestsDirectory)\nunit.framework.targets" />

<ItemGroup>
<PackageReference Include="NUnitLite" Version="3.12.0" />
<ProjectReference Include="$(RootTestsDirectory)\..\external\Touch.Unit\Touch.Client\dotnet\$(_PlatformName)\Touch.Client-$(_PlatformName).dotnet.csproj" />
<!-- MonoTouch.Dialog references System.Json, which isn't shipped with .NET5, so reference the NuGet instead -->
<PackageReference Include="System.Json" Version="4.7.1" />

<ProjectReference Include="$(RootTestsDirectory)\bindings-test\dotnet\$(_PlatformName)\bindings-test.csproj" />
<ProjectReference Include="$(RootTestsDirectory)\bindings-test2\dotnet\$(_PlatformName)\bindings-test2.csproj" />
</ItemGroup>
Expand Down
7 changes: 0 additions & 7 deletions tests/introspection/dotnet/shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@
<Import Project="$(RootTestsDirectory)/common/shared-dotnet.csproj" />
<Import Project="$(RootTestsDirectory)\nunit.framework.targets" />

<ItemGroup>
<PackageReference Include="NUnitLite" Version="3.12.0" />
<ProjectReference Include="$(RootTestsDirectory)\..\external\Touch.Unit\Touch.Client\dotnet\$(_PlatformName)\Touch.Client-$(_PlatformName).dotnet.csproj" />
<!-- MonoTouch.Dialog references System.Json, which isn't shipped with .NET5, so reference the NuGet instead -->
<PackageReference Include="System.Json" Version="4.7.1" />
</ItemGroup>

<ItemGroup Condition="$(TargetFramework.EndsWith('-macos'))">
<Compile Include="$(IntrospectionTestDirectory)\Mac\MacApiCtorInitTest.cs" />
<Compile Include="$(IntrospectionTestDirectory)\Mac\MacApiFieldTest.cs" />
Expand Down
4 changes: 0 additions & 4 deletions tests/linker/ios/dont link/dotnet/shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
<Import Project="$(RootTestsDirectory)\nunit.framework.targets" />

<ItemGroup>
<PackageReference Include="NUnitLite" Version="3.12.0" />
<ProjectReference Include="$(RootTestsDirectory)\..\external\Touch.Unit\Touch.Client\dotnet\$(_PlatformName)\Touch.Client-$(_PlatformName).dotnet.csproj" />
<!-- MonoTouch.Dialog references System.Json, which isn't shipped with .NET5, so reference the NuGet instead -->
<PackageReference Include="System.Json" Version="4.7.1" />
<ProjectReference Include="$(RootTestsDirectory)\BundledResources\dotnet\$(_PlatformName)\BundledResources.csproj" />
</ItemGroup>

Expand Down
4 changes: 0 additions & 4 deletions tests/linker/ios/link all/dotnet/shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@

<ItemGroup>
<PackageReference Include="System.ComponentModel.Composition" Version="4.7.0" />
<PackageReference Include="NUnitLite" Version="3.12.0" />
<ProjectReference Include="$(RootTestsDirectory)\..\external\Touch.Unit\Touch.Client\dotnet\$(_PlatformName)\Touch.Client-$(_PlatformName).dotnet.csproj" />
<!-- MonoTouch.Dialog references System.Json, which isn't shipped with .NET5, so reference the NuGet instead -->
<PackageReference Include="System.Json" Version="4.7.1" />
<ProjectReference Include="$(RootTestsDirectory)\BundledResources\dotnet\$(_PlatformName)\BundledResources.csproj" />
<ProjectReference Include="$(RootTestsDirectory)\bindings-test\dotnet\$(_PlatformName)\bindings-test.csproj" />
</ItemGroup>
Expand Down
4 changes: 0 additions & 4 deletions tests/linker/ios/link sdk/dotnet/shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@
<HintPath>$(ThisTestDirectory)/support.dll</HintPath>
</Reference>

<PackageReference Include="NUnitLite" Version="3.12.0" />
<ProjectReference Include="$(RootTestsDirectory)\..\external\Touch.Unit\Touch.Client\dotnet\$(_PlatformName)\Touch.Client-$(_PlatformName).dotnet.csproj" />
<!-- MonoTouch.Dialog references System.Json, which isn't shipped with .NET5, so reference the NuGet instead -->
<PackageReference Include="System.Json" Version="4.7.1" />
<ProjectReference Include="$(RootTestsDirectory)\BundledResources\dotnet\$(_PlatformName)\BundledResources.csproj" />
<ProjectReference Include="$(RootTestsDirectory)\bindings-test\dotnet\$(_PlatformName)\bindings-test.csproj" />
</ItemGroup>
Expand Down
5 changes: 0 additions & 5 deletions tests/monotouch-test/dotnet/shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@
<Import Project="$(RootTestsDirectory)/common/shared-dotnet.csproj" />

<ItemGroup>
<PackageReference Include="NUnitLite" Version="3.12.0" />
<ProjectReference Include="$(RootTestsDirectory)\..\external\Touch.Unit\Touch.Client\dotnet\$(_PlatformName)\Touch.Client-$(_PlatformName).dotnet.csproj" />
<!-- MonoTouch.Dialog references System.Json, which isn't shipped with .NET5, so reference the NuGet instead -->
<PackageReference Include="System.Json" Version="4.7.1" />

<ProjectReference Include="$(RootTestsDirectory)\EmbeddedResources\dotnet\$(_PlatformName)\EmbeddedResources.csproj" />
<ProjectReference Include="$(RootTestsDirectory)\bindings-test\dotnet\$(_PlatformName)\bindings-test.csproj" />
<ProjectReference Include="$(RootTestsDirectory)\fsharplibrary\dotnet\$(_PlatformName)\fsharplibrary.fsproj" />
Expand Down
5 changes: 0 additions & 5 deletions tests/xcframework-test/dotnet/shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
<Import Project="$(RootTestsDirectory)/common/shared-dotnet.csproj" />

<ItemGroup>
<PackageReference Include="NUnitLite" Version="3.12.0" />
<ProjectReference Include="$(RootTestsDirectory)\..\external\Touch.Unit\Touch.Client\dotnet\$(_PlatformName)\Touch.Client-$(_PlatformName).dotnet.csproj" />
<!-- MonoTouch.Dialog references System.Json, which isn't shipped with .NET5, so reference the NuGet instead -->
<PackageReference Include="System.Json" Version="4.7.1" />

<ProjectReference Include="$(RootTestsDirectory)\bindings-xcframework-test\dotnet\$(_PlatformName)\bindings-xcframework-test.csproj" />
</ItemGroup>

Expand Down