2016-05-26 16:06:52 +03:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
2019-02-04 17:22:00 +03:00
|
|
|
<Import Project="..\..\packages\NUnit.3.11.0\build\NUnit.props" Condition="Exists('..\..\packages\NUnit.3.11.0\build\NUnit.props')" />
|
2016-05-26 16:06:52 +03:00
|
|
|
<PropertyGroup>
|
|
|
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
|
|
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
2017-05-08 14:20:01 +03:00
|
|
|
<ProductVersion>8.0.30703</ProductVersion>
|
|
|
|
<SchemaVersion>2.0</SchemaVersion>
|
2016-05-26 16:06:52 +03:00
|
|
|
<ProjectGuid>{6E5405EC-1F68-4CD8-AD4B-E4CCFBE47977}</ProjectGuid>
|
2017-05-08 14:20:01 +03:00
|
|
|
<OutputType>Library</OutputType>
|
2016-10-19 05:27:10 +03:00
|
|
|
<RootNamespace>Xamarin.MMP.Tests</RootNamespace>
|
2016-05-26 16:06:52 +03:00
|
|
|
<AssemblyName>mmptest</AssemblyName>
|
2019-10-14 17:18:46 +03:00
|
|
|
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
2020-12-04 15:05:51 +03:00
|
|
|
<LangVersion>preview</LangVersion>
|
2016-05-26 16:06:52 +03:00
|
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
|
|
|
<DebugSymbols>true</DebugSymbols>
|
|
|
|
<DebugType>full</DebugType>
|
|
|
|
<Optimize>false</Optimize>
|
2017-05-08 14:20:01 +03:00
|
|
|
<OutputPath>bin\Debug</OutputPath>
|
2020-05-28 17:35:09 +03:00
|
|
|
<DefineConstants>DEBUG;MONOMAC;MMP_TEST;__MACOS__</DefineConstants>
|
2016-05-26 16:06:52 +03:00
|
|
|
<ErrorReport>prompt</ErrorReport>
|
2019-06-27 16:34:36 +03:00
|
|
|
<WarningLevel>0</WarningLevel>
|
2016-05-26 16:06:52 +03:00
|
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
|
|
|
<Optimize>true</Optimize>
|
2017-05-08 14:20:01 +03:00
|
|
|
<OutputPath>bin\Release</OutputPath>
|
2020-05-28 17:35:09 +03:00
|
|
|
<DefineConstants>MONOMAC;MMP_TEST;__MACOS__</DefineConstants>
|
2016-05-26 16:06:52 +03:00
|
|
|
<ErrorReport>prompt</ErrorReport>
|
2019-06-27 16:34:36 +03:00
|
|
|
<WarningLevel>0</WarningLevel>
|
2016-05-26 16:06:52 +03:00
|
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
|
|
<Reference Include="System" />
|
|
|
|
<Reference Include="System.Core" />
|
|
|
|
<Reference Include="System.Xml" />
|
2020-07-31 16:20:50 +03:00
|
|
|
<PackageReference Include="NUnit" Version="3.12.0" />
|
|
|
|
<PackageReference Include="NUnit.ConsoleRunner" Version="3.11.1" />
|
2017-01-11 23:10:39 +03:00
|
|
|
<Reference Include="mmp">
|
Xamarin.Mac native Apple Silicon targetting support (#10115)
* Add support for Xamarin.Mac arm64
* Add compile product definition task
Xamarin.Mac can be provided with a ProductDefinition file for the generated pkg. Normally, providing a product definition was optional. However, with Apple Silicon, we have an extra issue : `productbuild` needs to know what architectures your package target. If not provided with them, it will guess to the best of its abilities. However, on Catalina and lower, the guess is x86_64, even if you have an arm64 slice. To fix this, we add a new task to compile the product definition and use this file to create the pkg. If you provide your own Product Definition, we can check and warn if the architectures don't match what we expect. If the file doesn't exist or there is no architecture, we set it ourselves based on our target architectures.
* Don't reference dynamic objC_send on arm64
When building in debug, we currently try to link dynamic objC_send symbols when targeting a 64-bit architecture. However, this is actually only defined on Intel architectures, not on arm64, so we end up failing because we're referring symbols that don't exist. Rework the `GetRequiredSymbols` to take an abi, and tag those symbols to only be valid on i386/x86_64, so they don't get referred at all when building on arm64, but still get referred in x86_64.
* Fix improper delete/move with already existing directories
* Fix stret requirement for Xamarin.Mac in arm64.
The generator supposes that we're running in x64 mode, refactor to take into account the possibility of running in arm64.
* Implement OS version generation in Product.plist, based on MinimumSystemVersion of the app
* Re-generalize some mmp registrar rules
`Microsoft.macOS.registrar` was missed by the current rule set
* Fix mmp tests
* Set E7072 as not translated
Tests were failing otherwise
* Rename Xamarin.Mac lib/x86_64 folder to 64bits (currently all targeted archs are the same)
* Fix style issues
* Fix `ToLower` usage for invariant usage
* Fix xtro-sharpie test
2021-03-18 04:48:02 +03:00
|
|
|
<Aliases>global,mmp</Aliases>
|
2017-01-11 23:10:39 +03:00
|
|
|
<HintPath>..\..\_mac-build\Library\Frameworks\Xamarin.Mac.framework\Versions\git\lib\mmp\mmp.exe</HintPath>
|
|
|
|
</Reference>
|
2020-07-31 16:20:50 +03:00
|
|
|
<PackageReference Include="Mono.Cecil" Version="0.11.1" />
|
2021-04-10 02:58:28 +03:00
|
|
|
<PackageReference Include="MSBuild.StructuredLogger" Version="2.1.404" />
|
2016-05-26 16:06:52 +03:00
|
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
|
|
<Folder Include="Resources\" />
|
2017-01-11 23:10:39 +03:00
|
|
|
<Folder Include="unit\" />
|
2016-05-26 16:06:52 +03:00
|
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
|
|
<Compile Include="src\MMPTest.cs" />
|
|
|
|
<Compile Include="src\NativeReferencesTests.cs" />
|
|
|
|
<Compile Include="..\common\mac\ProjectTestHelpers.cs">
|
|
|
|
<Link>ProjectTestHelpers.cs</Link>
|
|
|
|
</Compile>
|
2016-06-06 13:18:52 +03:00
|
|
|
<Compile Include="..\..\tests\common\Configuration.cs">
|
2016-05-26 16:06:52 +03:00
|
|
|
<Link>Configuration.cs</Link>
|
|
|
|
</Compile>
|
2016-06-06 13:18:52 +03:00
|
|
|
<Compile Include="..\..\src\ObjCRuntime\ErrorHelper.cs">
|
2016-05-26 16:06:52 +03:00
|
|
|
<Link>ErrorHelper.cs</Link>
|
|
|
|
</Compile>
|
2016-06-06 13:18:52 +03:00
|
|
|
<Compile Include="..\..\src\ObjCRuntime\RuntimeException.cs">
|
2016-05-26 16:06:52 +03:00
|
|
|
<Link>RuntimeException.cs</Link>
|
|
|
|
</Compile>
|
|
|
|
<Compile Include="src\ExtensionTests.cs" />
|
2016-10-19 05:27:10 +03:00
|
|
|
<Compile Include="src\RemotingConfigurationTests.cs" />
|
2017-01-11 23:10:39 +03:00
|
|
|
<Compile Include="src\AOTTests.cs" />
|
2020-07-23 16:31:44 +03:00
|
|
|
<Compile Include="src\aot.cs" />
|
2017-04-05 22:38:40 +03:00
|
|
|
<Compile Include="src\FrameworkLinksTests.cs" />
|
2017-05-30 17:23:28 +03:00
|
|
|
<Compile Include="src\TargetFrameworkDetectionTests.cs" />
|
2017-05-17 01:05:26 +03:00
|
|
|
<Compile Include="src\LinkerTests.cs" />
|
2017-05-16 17:59:55 +03:00
|
|
|
<Compile Include="src\Extensions.cs" />
|
2017-05-22 18:44:06 +03:00
|
|
|
<Compile Include="..\mtouch\Cache.cs">
|
|
|
|
<Link>Cache.cs</Link>
|
|
|
|
</Compile>
|
2017-09-18 23:01:30 +03:00
|
|
|
<Compile Include="src\NetStandardTests.cs" />
|
2017-11-14 21:40:11 +03:00
|
|
|
<Compile Include="..\common\ProductTests.cs">
|
|
|
|
<Link>ProductTests.cs</Link>
|
|
|
|
</Compile>
|
[mtouch/mmp] Give users more control over optimizations, and share more code between mtouch and mmp. (#3242)
* [mtouch/mmp] Give users more control over optimizations, and share more code between mtouch and mmp.
1. Add an --optimize flag to mtouch/mmp that allows users to select which
optimizations to apply (or not). This makes it easier to add future
optimizations, and allow users to disable any optimization that causes
problems without having to disable many other features.
2. Share as much optimization code as possible between mtouch and mmp. This
immediately gives a benefit to mmp, which has three new optimizations only
mtouch had: NSObject.IsDirectBinding inlining, IntPtr.Size inlining and
dead code elimination.
This results in ~6kb of disk space saved for a linked Xamarin.Mac app:
* link sdk: [Debug][1], [Release][2]
* link all: [Debug][3], [Release][4]
Testing also verifies that monotouchtest ([Debug][5], [Release][6]) has not
changed size at all, which means that no default optimizations have changed
inadvertedly.
[1]: https://gist.github.com/rolfbjarne/6b731e3b5ca6170355662e6505c3d492#link-sdk-mac--debug
[2]: https://gist.github.com/rolfbjarne/6b731e3b5ca6170355662e6505c3d492#link-sdk-mac--release
[3]: https://gist.github.com/rolfbjarne/6b731e3b5ca6170355662e6505c3d492#link-all-mac--debug
[4]: https://gist.github.com/rolfbjarne/6b731e3b5ca6170355662e6505c3d492#link-all-mac--release
[5]: https://gist.github.com/rolfbjarne/6b731e3b5ca6170355662e6505c3d492#monotouchtest-iphonedebug64
[6]: https://gist.github.com/rolfbjarne/6b731e3b5ca6170355662e6505c3d492#monotouchtest-iphonerelease64
* [tools] Don't enable the IsDirectBinding optimization by default for Xamarin.Mac apps, it's not safe.
* Fix whitespace issues.
* [doc] Document optimizations.
* Officially support optimizations by adding them to the Versions.plist.
* [linker] Improve IntPtr.Size inliner + dead code eliminatior and add tests.
* Properly handle operands for the ldc_i4_s instruction (they're sbyte).
* Fix less-than condition to actually do a less-than comparison.
* Make sure to look up the bitness in the Target, not the Application, since
the Application's value will be incorrect when building fat apps (both
Is32Build and Is64Build will be true).
* Remove unnecessary checks for the IntPtr.Size inliner: this optimization
does not depend on other instructions than the IntPtr.get_Size call, so
remove the checks that verify surrounding instructions. This makes the
IntPtr.Size inliner kick in in more scenarios (such as the new tests).
* Add tests.
* [tests] Add mmp tests for optimizations.
* [tests] Fix XM optimization tests.
* [tests] Fix test build error.
2018-01-23 13:33:48 +03:00
|
|
|
<Compile Include="..\common\ExecutionHelper.cs">
|
|
|
|
<Link>src\ExecutionHelper.cs</Link>
|
|
|
|
</Compile>
|
Optimize calls to BlockLiteral.SetupBlock to inject the block signature. (#3391)
* [linker] Optimize calls to BlockLiteral.SetupBlock to inject the block signature.
Optimize calls to BlockLiteral.SetupBlock[Unsafe] to calculate the block
signature at build time, and inject it into the call site.
This makes block invocations 10-15x faster (I've added tests that asserts at
least an 8x increase).
It's also required in order to be able to remove the dynamic registrar code in
the future (since calculating the block signature at runtime requires the
dynamic registrar).
* [mtouch/mmp] Add support for reporting errors/warnings that point to the code line causing the error/warning.
Add support for reporting errors/warnings that point to the code line causing
the error/warning by adding ErrorHelper overloads that take the exact
instruction to report (previously we defaulted to the first line/instruction
in a method).
* [tests] Add support for asserting filename/linenumber in warning messages.
* Make all methods that manually create BlockLiterals optimizable.
* [tests] Create a BaseOptimizeGeneratedCodeTest test that's included in both XI's and XM's link all test.
* [tests] Add link all test (for both XI and XM) to test the BlockLiteral.SetupBlock optimization.
* [tests] Add mtouch/mmp tests for the BlockLiteral.SetupBlock optimization.
* [tests][linker] Make the base test class abstract, so tests in the base class aren't executed twice.
* [tests][linker] Don't execute linkall-only tests in linksdk.
The optimization tests only apply when the test assembly is linked, and that
only happens in linkall, so exclude those tests in linksdk.
* [tests][mmptest] Update test according to mmp changes.
Fixes these test failures:
1) Failed : Xamarin.MMP.Tests.MMPTests.MM0132("inline-runtime-arch")
The warning 'MM0132: Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.' was not found in the output:
Message #1 did not match:
actual: 'Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, blockliteral-setupblock.'
expected: 'Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.'
Message #2 did not match:
actual: 'Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, blockliteral-setupblock.'
expected: 'Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.'
2) Failed : Xamarin.MMP.Tests.MMPTests.MM0132("foo")
The warning 'MM0132: Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.' was not found in the output:
Message #1 did not match:
actual: 'Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, blockliteral-setupblock.'
expected: 'Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.'
Message #2 did not match:
actual: 'Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, blockliteral-setupblock.'
expected: 'Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.'
* [tests][linker] Fix typo.
Fixes this test failure:
1) SetupBlock_CustomDelegate (Linker.Shared.BaseOptimizeGeneratedCodeTest.SetupBlock_CustomDelegate)
Counter
Expected: 1
But was: 2
* [registrar] Minor adjustment to error message to match previous (and better) behavior.
Fixes this test failure:
1) Failed : Xamarin.Registrar.GenericType_WithInvalidParameterTypes
The error 'MT4136: The registrar cannot marshal the parameter type 'System.Collections.Generic.List`1<U>' of the parameter 'arg' in the method 'Open`1.Bar(System.Collections.Generic.List`1<U>)'' was not found in the output:
Message #1 did not match:
actual: 'The registrar cannot marshal the parameter type 'System.Collections.Generic.List`1<Foundation.NSObject>' of the parameter 'arg' in the method 'Open`1.Bar(System.Collections.Generic.List`1<U>)''
expected: 'The registrar cannot marshal the parameter type 'System.Collections.Generic.List`1<U>' of the parameter 'arg' in the method 'Open`1.Bar(System.Collections.Generic.List`1<U>)''
* [docs] mmp shows MM errors/warnings.
* [docs] Improve according to reviews.
* [tests] Fix merge failure causing test duplication.
2018-02-06 09:08:15 +03:00
|
|
|
<Compile Include="..\common\ApiTest.cs">
|
|
|
|
<Link>src\ApiTest.cs</Link>
|
|
|
|
</Compile>
|
|
|
|
<Compile Include="..\common\BundlerTest.cs">
|
|
|
|
<Link>src\BundlerTest.cs</Link>
|
|
|
|
</Compile>
|
2018-02-02 09:09:04 +03:00
|
|
|
<Compile Include="..\common\Profile.cs">
|
|
|
|
<Link>Profile.cs</Link>
|
|
|
|
</Compile>
|
|
|
|
<Compile Include="src\MmpTool.cs" />
|
|
|
|
<Compile Include="..\common\BundlerTool.cs">
|
|
|
|
<Link>BundlerTool.cs</Link>
|
|
|
|
</Compile>
|
2018-03-02 16:33:27 +03:00
|
|
|
<Compile Include="src\CodeStrippingTests.cs" />
|
|
|
|
<Compile Include="..\..\tools\common\StringUtils.cs">
|
|
|
|
<Link>StringUtils.cs</Link>
|
|
|
|
</Compile>
|
2018-03-22 04:00:23 +03:00
|
|
|
<Compile Include="src\WarningTests.cs" />
|
2018-06-20 12:04:22 +03:00
|
|
|
<Compile Include="src\Unified45.cs" />
|
|
|
|
<Compile Include="src\System.ServiceModel\Net45.cs" />
|
2018-08-14 04:04:56 +03:00
|
|
|
<Compile Include="src\BindingProjectTests.cs" />
|
2018-03-16 16:53:53 +03:00
|
|
|
<Compile Include="src\SmokeTests.cs" />
|
|
|
|
<Compile Include="src\RegistrarTests.cs" />
|
|
|
|
<Compile Include="src\AssemblyReferencesTests.cs" />
|
[msbuild] Set 'CopyNuGetImplementations' to true for app extensions. Fixes #4235 and #4237. (#4512) (#4648) (#4773)
In Xamarin.iOS.Common.targets, just before the _CompileToNative target, we
modify the mtouch references to ensure that we get the lib assemblies for
nugets, and not the ref references:
https://github.com/xamarin/xamarin-macios/blob/9e31d07ecc08a64372dd562e843c3d8950d24985/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets#L784-L791
This logic removes nuget references, and then re-adds any copy-local dll
references.
This works fine in executable projects, but not in library projects (aka
extensions), because nugets aren't copied for library projects:
https://github.com/NuGet/NuGet.BuildTasks/blob/cf4b0a12cf1f75e0654f28c2a9020251c41d126a/src/Microsoft.NuGet.Build.Tasks/Microsoft.NuGet.targets#L86
So we need to set the CopyNuGetImplementations variable to 'true' for our
library projects.
Fixes https://github.com/xamarin/xamarin-macios/issues/4235.
Fixes https://github.com/xamarin/xamarin-macios/issues/4237.
* [tests] Redirect MSBuildExtensionsPath to MSBuildExtensionsPathFallbackPathsOverride when running msbuild for package reference tests.
This fixes a problem where nuget restore would fail for projects with
PackageReferences, because a variable would be empty and msbould would try to
write to /:
nuget restore ../MyAppWithPackageReference/MyAppWithPackageReference.csproj
MSBuild auto-detection: using msbuild version '15.0' from '/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/msbuild/15.0/bin/'.
Restoring packages for /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/msbuild/tests/MyAppWithPackageReference/MyAppWithPackageReference.csproj...
Committing restore...
Generating MSBuild file /MyAppWithPackageReference.csproj.nuget.g.props.
Path / is a directory
This will become unnecessary when PR #4111 is merged.
* Add Xamarin.Mac test showing that fix is not needed (?!?)
* Add AppExtension test with packagereference
* Make extension actually have json code generated
* Fix ProjectTypeGuids of checked in extension projects, as they were not openable in VSfM
* XM extension test now correctly fails
* Now that we have a failing test, fix XM same as rest of platforms
* Disable XM tests due to msbuild redirect sadness
* Disable iOS tests as well due to #4110
* Disable iOS tests by using the Ignore attribute.
Disable tests by using the Ignore attribute, because just commenting out the
TestCase attributes makes the test fail:
1) NotRunnable : Xamarin.iOS.Tasks.ProjectReferenceTests.BasicTest
No suitable constructor was found
2018-09-10 15:29:23 +03:00
|
|
|
<Compile Include="src\PackageReferenceTests.cs" />
|
2018-12-12 17:55:57 +03:00
|
|
|
<Compile Include="src\BindingProjectNoEmbeddingTests.cs" />
|
2020-04-08 17:19:34 +03:00
|
|
|
<Compile Include="..\..\tools\common\SdkVersions.cs">
|
2018-10-26 16:23:36 +03:00
|
|
|
<Link>SdkVersions.cs</Link>
|
|
|
|
</Compile>
|
2019-03-01 01:33:25 +03:00
|
|
|
<Compile Include="src\TargetFrameworkMutateTests.cs" />
|
2019-09-24 14:40:18 +03:00
|
|
|
<Compile Include="..\..\tools\common\MachO.cs">
|
|
|
|
<Link>MachO.cs</Link>
|
|
|
|
</Compile>
|
2020-01-31 23:02:52 +03:00
|
|
|
<Compile Include="..\..\tools\mtouch\Errors.Designer.cs">
|
|
|
|
<Link>Errors.Designer.cs</Link>
|
|
|
|
</Compile>
|
2020-07-16 18:13:15 +03:00
|
|
|
<Compile Include="src\NativeExtensionEmbedding.cs" />
|
2020-12-04 15:05:51 +03:00
|
|
|
<Compile Include="..\common\BinLog.cs">
|
|
|
|
<Link>BinLog.cs</Link>
|
|
|
|
</Compile>
|
|
|
|
<Compile Include="..\common\Tool.cs">
|
|
|
|
<Link>src\Tool.cs</Link>
|
|
|
|
</Compile>
|
2016-05-26 16:06:52 +03:00
|
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
|
|
<None Include="Info.plist" />
|
2020-01-31 23:02:52 +03:00
|
|
|
<None Include="..\..\tools\mtouch\Errors.resx">
|
|
|
|
<Link>Errors.resx</Link>
|
|
|
|
</None>
|
2016-05-26 16:06:52 +03:00
|
|
|
</ItemGroup>
|
2016-10-19 05:27:10 +03:00
|
|
|
<ItemGroup>
|
|
|
|
<EmbeddedResource Include="..\common\mac\remoting.config">
|
|
|
|
<Link>remoting.config</Link>
|
|
|
|
</EmbeddedResource>
|
|
|
|
</ItemGroup>
|
2017-05-08 14:20:01 +03:00
|
|
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
2016-05-26 16:06:52 +03:00
|
|
|
<Import Project="CustomBuildActions.targets" />
|
|
|
|
</Project>
|