xamarin-macios/msbuild/tests/MyAppWithPackageReference/MyAppWithPackageReference.c...

70 строки
2.9 KiB
XML
Исходник Обычный вид История

[msbuild] Set 'CopyNuGetImplementations' to true for app extensions. Fixes #4235 and #4237. (#4512) * [msbuild] Set 'CopyNuGetImplementations' to true for app extensions. Fixes #4235 and #4237. 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-08-20 14:43:48 +03:00
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectGuid>{8FEBEE38-9A70-4434-8659-1C96138567DF}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>MyAppWithPackageReference</RootNamespace>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
<AssemblyName>MyAppWithPackageReference</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<MtouchArch>x86_64</MtouchArch>
<MtouchLink>None</MtouchLink>
<MtouchDebug>true</MtouchDebug>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
<MtouchArch>x86_64</MtouchArch>
<MtouchLink>None</MtouchLink>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhone\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<MtouchArch>ARM64</MtouchArch>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchDebug>true</MtouchDebug>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\iPhone\Release</OutputPath>
<MtouchArch>ARM64</MtouchArch>
<CodesignKey>iPhone Developer</CodesignKey>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="Xamarin.iOS" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
</ItemGroup>
<ItemGroup>
<None Include="Info.plist" />
</ItemGroup>
<ItemGroup>
<Compile Include="AppDelegate.cs" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
<ItemGroup>
<ProjectReference Include="..\MyExtensionWithPackageReference\MyExtensionWithPackageReference.csproj">
<Project>{D1F9F9CC-B3E5-49B2-8F71-7FF2B0B57E08}</Project>
<Name>MyExtensionWithPackageReference</Name>
<IsAppExtension>True</IsAppExtension>
</ProjectReference>
</ItemGroup>
</Project>