Skip to content

Commit d8bb799

Browse files
committed
Fix UWP test build warnings and errors.
This commit fixes build script to use nuget instead of msbuild for package restore because UWP/WinRT build does not support msbuild restore. It causes build error in some environment including AppVeyor. This commit also fixes package version related warnings. We will use netfx 1.1 for netstandard 1.x testing.
1 parent 54624d4 commit d8bb799

File tree

10 files changed

+65
-23
lines changed

10 files changed

+65
-23
lines changed

build/Build.ps1

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,16 @@ if ( $LastExitCode -ne 0 )
129129

130130
Write-Host "Restore $slnWindows packages..."
131131

132-
& $msbuild /t:restore $slnWindows $restoreOptions
132+
if ( $env:APPVEYOR -eq "True" )
133+
{
134+
# Use nuget for legacy environments.
135+
nuget restore $slnWindows -Verbosity quiet
136+
}
137+
else
138+
{
139+
& $msbuild /t:restore $slnWindows $restoreOptions
140+
}
141+
133142
if ( $LastExitCode -ne 0 )
134143
{
135144
Write-Error "Failed to restore $slnWindows"

src/MsgPack.Uwp/project.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,13 @@
5252
"dependencies": {
5353
"Microsoft.NETCore.UniversalWindowsPlatform": "5.2.3",
5454
"System.Collections.NonGeneric": "4.3.0",
55-
"System.Collections.Specialized": "4.3.0"
55+
"System.Collections.Specialized": "4.3.0",
56+
"System.Diagnostics.Contracts": "4.3.0",
57+
"System.Net.NameResolution": "4.3.0",
58+
"System.Net.Primitives": "4.3.0",
59+
"System.Runtime.WindowsRuntime" : "4.3.0",
60+
"System.Threading.Overlapped": "4.3.0",
61+
"Microsoft.Win32.Primitives": "4.3.0"
5662
},
5763
"frameworks": {
5864
"uap10.0": {}
Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
<?xml version="1.0" encoding="utf-8" standalone="no"?>
22
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<PropertyGroup Condition="'$(NuGetPackageRoot)' == ''">
4-
<NuGetPackageRoot>$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
3+
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
4+
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
5+
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
6+
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">d:\Yusuke\git\msgpack-cli\test\MsgPack.UnitTest.Uwp.Aot\project.lock.json</ProjectAssetsFile>
7+
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
8+
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Yusuke\.nuget\packages\</NuGetPackageFolders>
9+
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">ProjectJson</NuGetProjectStyle>
10+
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">4.4.0</NuGetToolVersion>
511
</PropertyGroup>
6-
<ImportGroup>
7-
<Import Project="$(NuGetPackageRoot)\Xamarin.Forms\2.3.3.180\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets" Condition="Exists('$(NuGetPackageRoot)\Xamarin.Forms\2.3.3.180\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets')" />
12+
<PropertyGroup>
13+
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
14+
</PropertyGroup>
15+
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
16+
<Import Project="$(NuGetPackageRoot)xamarin.forms\2.3.3.180\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets" Condition="Exists('$(NuGetPackageRoot)xamarin.forms\2.3.3.180\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets')" />
817
</ImportGroup>
918
</Project>

test/MsgPack.UnitTest.Uwp.Aot/project.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
{
22
"dependencies": {
33
"Microsoft.NETCore.UniversalWindowsPlatform": "5.2.3",
4-
"NUnit": "3.8.1",
4+
"NUnit": "3.6.1",
55
"nunit.xamarin": "3.6.1",
66
"System.Collections.NonGeneric": "4.3.0",
77
"System.Collections.Specialized": "4.3.0",
88
"System.Data.Common": "4.3.0",
9-
"System.Numerics.Vectors": "4.4.0",
10-
"System.ValueTuple": "4.4.0",
9+
"System.Diagnostics.Contracts": "4.3.0",
10+
"System.Net.NameResolution": "4.3.0",
11+
"System.Net.Primitives": "4.3.0",
12+
"System.Numerics.Vectors": "4.3.0",
13+
"System.Runtime.WindowsRuntime": "4.3.0",
14+
"System.Threading.Overlapped": "4.3.0",
15+
"System.ValueTuple": "4.3.1",
16+
"Microsoft.Win32.Primitives" : "4.3.0",
1117
"Xamarin.Forms": "2.3.3.180"
1218
},
1319
"frameworks": {
Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
<?xml version="1.0" encoding="utf-8" standalone="no"?>
22
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<PropertyGroup Condition="'$(NuGetPackageRoot)' == ''">
4-
<NuGetPackageRoot>$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
3+
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
4+
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
5+
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
6+
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">d:\Yusuke\git\msgpack-cli\test\MsgPack.UnitTest.Uwp\project.lock.json</ProjectAssetsFile>
7+
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
8+
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Yusuke\.nuget\packages\</NuGetPackageFolders>
9+
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">ProjectJson</NuGetProjectStyle>
10+
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">4.4.0</NuGetToolVersion>
511
</PropertyGroup>
6-
<ImportGroup>
7-
<Import Project="$(NuGetPackageRoot)\Xamarin.Forms\2.3.3.180\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets" Condition="Exists('$(NuGetPackageRoot)\Xamarin.Forms\2.3.3.180\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets')" />
12+
<PropertyGroup>
13+
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
14+
</PropertyGroup>
15+
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
16+
<Import Project="$(NuGetPackageRoot)xamarin.forms\2.3.3.180\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets" Condition="Exists('$(NuGetPackageRoot)xamarin.forms\2.3.3.180\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets')" />
817
</ImportGroup>
918
</Project>

test/MsgPack.UnitTest.Uwp/project.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
{
22
"dependencies": {
33
"Microsoft.NETCore.UniversalWindowsPlatform": "5.2.3",
4-
"NUnit": "3.8.1",
4+
"NUnit": "3.6.1",
55
"nunit.xamarin": "3.6.1",
66
"System.Collections.NonGeneric": "4.3.0",
77
"System.Collections.Specialized": "4.3.0",
88
"System.Data.Common": "4.3.0",
9-
"System.Numerics.Vectors": "4.4.0",
10-
"System.ValueTuple": "4.4.0",
9+
"System.Diagnostics.Contracts": "4.3.0",
10+
"System.Net.NameResolution": "4.3.0",
11+
"System.Net.Primitives": "4.3.0",
12+
"System.Numerics.Vectors": "4.3.0",
13+
"System.Runtime.WindowsRuntime": "4.3.0",
14+
"System.Threading.Overlapped": "4.3.0",
15+
"System.ValueTuple": "4.3.1",
16+
"Microsoft.Win32.Primitives" : "4.3.0",
1117
"Xamarin.Forms": "2.3.3.180"
1218
},
1319
"frameworks": {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="System.ValueTuple" version="4.4.0" targetFramework="wpa81" />
3+
<package id="System.ValueTuple" version="4.4.0" targetFramework="netstandard1.0" />
44
</packages>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="System.Numerics.Vectors" version="4.4.0" targetFramework="win81" />
4-
<package id="System.ValueTuple" version="4.4.0" targetFramework="win81" />
3+
<package id="System.Numerics.Vectors" version="4.4.0" targetFramework="netstandard1.0" />
4+
<package id="System.ValueTuple" version="4.4.0" targetFramework="netstandard1.0" />
55
</packages>

test/MsgPack.UnitTest.Xamarin.iOS/Serialization/AotTest.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727
using MsgPack.Serialization.ReflectionSerializers;
2828

2929
using NUnit.Framework;
30-
#if NETFX_CORE
31-
using TestFixtureSetUp = NUnit.Framework.OneTimeSetUpAttribute;
32-
#endif // NETFX_CORE
3330

3431
namespace MsgPack.Serialization
3532
{

test/MsgPack.UnitTest/MessagePackObjectTest.Miscs.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ private static void TestToStringCore( params MessagePackObject[] targets )
239239
}
240240
}
241241

242-
#if NUNITLITE && !NETFX_CORE
242+
#if NUNITLITE
243243
private static class Does
244244
{
245245
public static NUnit.Framework.Constraints.Constraint Match( string regex )

0 commit comments

Comments
 (0)