Skip to content

Commit 04655b6

Browse files
authoredFeb 10, 2021
Remove nodefaultlib workaround that was used for server wrappers (#2241)
* Remove nodefaultlib workaround that was used for server wrappers * capitalize NOT * Recreate UWP and get tests runnable again * cleanup rd.xml * Changelog entry
1 parent b2747fe commit 04655b6

23 files changed

+126
-50
lines changed
 

‎CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## vNext (TBD)
22

33
### Fixed
4-
* None
4+
* Fixed an issue that would result in UWP apps being rejected from the Microsoft Store due to an unsupported API (`__C_specific_handler`) being used. (Issue [#2235](https://github.com/realm/realm-dotnet/issues/2235))
55

66
### Enhancements
77
* Add support for the `Guid` data type. It can be used as primary key and is indexable. (PR [#2120](https://github.com/realm/realm-dotnet/pull/2120))

‎Tests/Realm.Tests/Realm.Tests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFrameworks>net461;netcoreapp2.0;monoandroid90;xamarin.ios10;xamarin.mac20</TargetFrameworks>
5-
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);uap10.0.18362</TargetFrameworks>
5+
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);uap10.0.19041</TargetFrameworks>
66
<TargetFrameworks Condition="'$(AddNet5Framework)' == 'true'">$(TargetFrameworks);net5.0</TargetFrameworks>
77
<RootNamespace>Realms.Tests</RootNamespace>
88
<IsTestProject>true</IsTestProject>

‎Tests/Tests.UWP/App.xaml.cs

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
//
1717
////////////////////////////////////////////////////////////////////////////
1818

19-
using System.Collections.Generic;
2019
using System.Reflection;
2120
using Windows.ApplicationModel.Activation;
2221
using Windows.UI.Xaml;
Loading
-1.93 KB
Binary file not shown.
-3.32 KB
Binary file not shown.
-2.21 KB
Binary file not shown.
Loading
Loading
Loading
Loading

‎Tests/Tests.UWP/Assets/StoreLogo.png

1.42 KB
Loading
-2.95 KB
Binary file not shown.
Loading

‎Tests/Tests.UWP/FodyWeavers.xml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd" />
1+
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
2+
<Realm />
3+
</Weavers>

‎Tests/Tests.UWP/MainPage.xaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22
x:Class="Realms.Tests.UWP.MainPage"
33
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5-
xmlns:local="using:Realms.Tests.UWP"
65
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
76
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
87
xmlns:forms="using:Xamarin.Forms.Platform.UWP"
98
mc:Ignorable="d">
109

11-
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
10+
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
1211

13-
</Grid>
12+
</Grid>
1413
</forms:WindowsPage>

‎Tests/Tests.UWP/MainPage.xaml.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
////////////////////////////////////////////////////////////////////////////
22
//
3-
// Copyright 2017 Realm Inc.
3+
// Copyright 2021 Realm Inc.
44
//
55
// Licensed under the Apache License, Version 2.0 (the "License");
66
// you may not use this file except in compliance with the License.

‎Tests/Tests.UWP/Package.appxmanifest

+31-9
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,48 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
3-
<Identity Name="4f50c901-646f-47f4-9a2f-29ccb95c138c" Publisher="CN=irinc" Version="1.0.0.0" />
4-
<mp:PhoneIdentity PhoneProductId="4f50c901-646f-47f4-9a2f-29ccb95c138c" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
2+
3+
<Package
4+
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
5+
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
6+
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
7+
IgnorableNamespaces="uap mp">
8+
9+
<Identity
10+
Name="032e482b-1a73-46f2-afb7-1c22f2e68be8"
11+
Publisher="CN=irinc"
12+
Version="1.0.0.0" />
13+
14+
<mp:PhoneIdentity PhoneProductId="032e482b-1a73-46f2-afb7-1c22f2e68be8" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
15+
516
<Properties>
6-
<DisplayName>io.realm.xamarintests</DisplayName>
17+
<DisplayName>Tests.UWP</DisplayName>
718
<PublisherDisplayName>Realm</PublisherDisplayName>
819
<Logo>Assets\StoreLogo.png</Logo>
920
</Properties>
21+
1022
<Dependencies>
1123
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
1224
</Dependencies>
25+
1326
<Resources>
14-
<Resource Language="x-generate" />
27+
<Resource Language="x-generate"/>
1528
</Resources>
29+
1630
<Applications>
17-
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="io.realm.uwptests.App">
18-
<uap:VisualElements DisplayName="Realm Tests" Square150x150Logo="Assets\MediumTile.png" Square44x44Logo="Assets\Logo.png" Description="Tests for Realm Xamarin" BackgroundColor="transparent">
19-
<uap:DefaultTile Square71x71Logo="Assets\SmallTile.png">
20-
</uap:DefaultTile>
31+
<Application Id="App"
32+
Executable="$targetnametoken$.exe"
33+
EntryPoint="Tests.UWP.App">
34+
<uap:VisualElements
35+
DisplayName="Tests.UWP"
36+
Square150x150Logo="Assets\Square150x150Logo.png"
37+
Square44x44Logo="Assets\Square44x44Logo.png"
38+
Description="Tests.UWP"
39+
BackgroundColor="transparent">
40+
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/>
41+
<uap:SplashScreen Image="Assets\SplashScreen.png" />
2142
</uap:VisualElements>
2243
</Application>
2344
</Applications>
45+
2446
<Capabilities>
2547
<Capability Name="internetClient" />
2648
</Capabilities>
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("Tests.UWP")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("Tests.UWP")]
13+
[assembly: AssemblyCopyright("Copyright © 2021")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Version information for an assembly consists of the following four values:
18+
//
19+
// Major Version
20+
// Minor Version
21+
// Build Number
22+
// Revision
23+
//
24+
// You can specify all the values or you can default the Build and Revision Numbers
25+
// by using the '*' as shown below:
26+
// [assembly: AssemblyVersion("1.0.*")]
27+
[assembly: AssemblyVersion("1.0.0.0")]
28+
[assembly: AssemblyFileVersion("1.0.0.0")]
29+
[assembly: ComVisible(false)]
+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
22
<Application>
33
<Assembly Name="*Application*" Dynamic="Required All" />
4-
54
<Assembly Name="nunit.framework" Dynamic="Required All" />
6-
<Assembly Name="nunit.runner.uwp" Dynamic="Required All" />
5+
<Assembly Name="nunit.xamarin" Dynamic="Required All" />
76
</Application>
87
</Directives>

‎Tests/Tests.UWP/Tests.UWP.csproj

+56-23
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
<PropertyGroup>
55
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
66
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
7-
<ProjectGuid>{159A55AF-9531-4107-8444-CA9C96107EF5}</ProjectGuid>
7+
<ProjectGuid>{7EFF9E5C-5E74-469B-8DB7-C25C9AF0444E}</ProjectGuid>
88
<OutputType>AppContainerExe</OutputType>
99
<AppDesignerFolder>Properties</AppDesignerFolder>
10-
<RootNamespace>Tests</RootNamespace>
10+
<RootNamespace>Tests.UWP</RootNamespace>
1111
<AssemblyName>Tests.UWP</AssemblyName>
1212
<DefaultLanguage>en-US</DefaultLanguage>
1313
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
@@ -16,15 +16,13 @@
1616
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
1717
<FileAlignment>512</FileAlignment>
1818
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
19-
<RealmWrappersPlatform>$(Platform)</RealmWrappersPlatform>
20-
<RealmWrappersPlatform Condition="'$(Platform)' == 'x86'">Win32</RealmWrappersPlatform>
2119
<WindowsXamlEnableOverview>true</WindowsXamlEnableOverview>
22-
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
20+
<AppxPackageSigningEnabled>false</AppxPackageSigningEnabled>
2321
</PropertyGroup>
2422
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
2523
<DebugSymbols>true</DebugSymbols>
2624
<OutputPath>bin\x86\Debug\</OutputPath>
27-
<DefineConstants>TRACE;DEBUG;$(DefineConstants)</DefineConstants>
25+
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
2826
<NoWarn>;2008</NoWarn>
2927
<DebugType>full</DebugType>
3028
<PlatformTarget>x86</PlatformTarget>
@@ -34,7 +32,7 @@
3432
</PropertyGroup>
3533
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
3634
<OutputPath>bin\x86\Release\</OutputPath>
37-
<DefineConstants>TRACE;$(DefineConstants)</DefineConstants>
35+
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
3836
<Optimize>true</Optimize>
3937
<NoWarn>;2008</NoWarn>
4038
<DebugType>pdbonly</DebugType>
@@ -47,7 +45,7 @@
4745
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
4846
<DebugSymbols>true</DebugSymbols>
4947
<OutputPath>bin\ARM\Debug\</OutputPath>
50-
<DefineConstants>TRACE;DEBUG;$(DefineConstants)</DefineConstants>
48+
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
5149
<NoWarn>;2008</NoWarn>
5250
<DebugType>full</DebugType>
5351
<PlatformTarget>ARM</PlatformTarget>
@@ -57,7 +55,7 @@
5755
</PropertyGroup>
5856
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
5957
<OutputPath>bin\ARM\Release\</OutputPath>
60-
<DefineConstants>TRACE;$(DefineConstants)</DefineConstants>
58+
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
6159
<Optimize>true</Optimize>
6260
<NoWarn>;2008</NoWarn>
6361
<DebugType>pdbonly</DebugType>
@@ -67,10 +65,34 @@
6765
<Prefer32Bit>true</Prefer32Bit>
6866
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
6967
</PropertyGroup>
68+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM64'">
69+
<DebugSymbols>true</DebugSymbols>
70+
<OutputPath>bin\ARM64\Debug\</OutputPath>
71+
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
72+
<NoWarn>;2008</NoWarn>
73+
<DebugType>full</DebugType>
74+
<PlatformTarget>ARM64</PlatformTarget>
75+
<UseVSHostingProcess>false</UseVSHostingProcess>
76+
<ErrorReport>prompt</ErrorReport>
77+
<Prefer32Bit>true</Prefer32Bit>
78+
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
79+
</PropertyGroup>
80+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM64'">
81+
<OutputPath>bin\ARM64\Release\</OutputPath>
82+
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
83+
<Optimize>true</Optimize>
84+
<NoWarn>;2008</NoWarn>
85+
<DebugType>pdbonly</DebugType>
86+
<PlatformTarget>ARM64</PlatformTarget>
87+
<UseVSHostingProcess>false</UseVSHostingProcess>
88+
<ErrorReport>prompt</ErrorReport>
89+
<Prefer32Bit>true</Prefer32Bit>
90+
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
91+
</PropertyGroup>
7092
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
7193
<DebugSymbols>true</DebugSymbols>
7294
<OutputPath>bin\x64\Debug\</OutputPath>
73-
<DefineConstants>TRACE;DEBUG;$(DefineConstants)</DefineConstants>
95+
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
7496
<NoWarn>;2008</NoWarn>
7597
<DebugType>full</DebugType>
7698
<PlatformTarget>x64</PlatformTarget>
@@ -80,7 +102,7 @@
80102
</PropertyGroup>
81103
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
82104
<OutputPath>bin\x64\Release\</OutputPath>
83-
<DefineConstants>TRACE;$(DefineConstants)</DefineConstants>
105+
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
84106
<Optimize>true</Optimize>
85107
<NoWarn>;2008</NoWarn>
86108
<DebugType>pdbonly</DebugType>
@@ -90,26 +112,32 @@
90112
<Prefer32Bit>true</Prefer32Bit>
91113
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
92114
</PropertyGroup>
115+
<PropertyGroup>
116+
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
117+
</PropertyGroup>
93118
<ItemGroup>
94119
<Compile Include="App.xaml.cs">
95120
<DependentUpon>App.xaml</DependentUpon>
96121
</Compile>
97122
<Compile Include="MainPage.xaml.cs">
98123
<DependentUpon>MainPage.xaml</DependentUpon>
99124
</Compile>
125+
<Compile Include="Properties\AssemblyInfo.cs" />
100126
</ItemGroup>
101127
<ItemGroup>
102128
<AppxManifest Include="Package.appxmanifest">
103129
<SubType>Designer</SubType>
104130
</AppxManifest>
105-
<None Include="Tests.UWP_TemporaryKey.pfx" />
106131
</ItemGroup>
107132
<ItemGroup>
108-
<Content Include="Assets\Logo.scale-100.png" />
109-
<Content Include="Assets\MediumTile.scale-100.png" />
110-
<Content Include="Assets\SmallTile.scale-100.png" />
111-
<Content Include="Assets\StoreLogo.scale-100.png" />
112133
<Content Include="Properties\Default.rd.xml" />
134+
<Content Include="Assets\LockScreenLogo.scale-200.png" />
135+
<Content Include="Assets\SplashScreen.scale-200.png" />
136+
<Content Include="Assets\Square150x150Logo.scale-200.png" />
137+
<Content Include="Assets\Square44x44Logo.scale-200.png" />
138+
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
139+
<Content Include="Assets\StoreLogo.png" />
140+
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
113141
</ItemGroup>
114142
<ItemGroup>
115143
<ApplicationDefinition Include="App.xaml">
@@ -122,22 +150,27 @@
122150
</Page>
123151
</ItemGroup>
124152
<ItemGroup>
125-
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.11" />
126-
<PackageReference Include="NUnit.Xamarin.Realm" Version="3.12.0"/>
127-
<PackageReference Include="PCLStorage" Version="1.0.2" />
128-
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1687" />
153+
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
154+
<Version>6.2.10</Version>
155+
</PackageReference>
156+
<PackageReference Include="NUnit.Xamarin.Realm">
157+
<Version>3.12.1</Version>
158+
</PackageReference>
129159
</ItemGroup>
130160
<ItemGroup>
131161
<ProjectReference Include="..\Realm.Tests\Realm.Tests.csproj">
132-
<Project>{78799fcd-be2e-4ece-a52e-662846615b58}</Project>
162+
<Project>{4808ed47-da25-4c95-a7a4-6410cf6cfef9}</Project>
133163
<Name>Realm.Tests</Name>
134164
</ProjectReference>
135165
</ItemGroup>
166+
<!--<ItemGroup Condition="'$(UseRealmNupkgsWithVersion)' != ''">
167+
<PackageReference Include="Realm" Version="$(UseRealmNupkgsWithVersion)"/>
168+
</ItemGroup>-->
136169
<ItemGroup Condition="'$(UseRealmNupkgsWithVersion)' == ''">
137-
<None Include="..\..\wrappers\build\WindowsStore\$(Configuration)-x64\realm-wrappers.dll" Condition="Exists('..\..\wrappers\build\WindowsStore\$(Configuration)-x64\realm-wrappers.dll')">
170+
<None Include="..\..\wrappers\build\WindowsStore\$(Configuration)-x64\realm-wrappers.dll" Condition="Exists('..\..\wrappers\build\WindowsStore\$(Configuration)-x64\realm-wrappers.dll') and '$(Platform)' == 'x64'">
138171
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
139172
</None>
140-
<None Include="..\..\wrappers\build\WindowsStore\$(Configuration)-Win32\realm-wrappers.dll" Condition="Exists('..\..\wrappers\build\WindowsStore\$(Configuration)-Win32\realm-wrappers.dll')">
173+
<None Include="..\..\wrappers\build\WindowsStore\$(Configuration)-Win32\realm-wrappers.dll" Condition="Exists('..\..\wrappers\build\WindowsStore\$(Configuration)-Win32\realm-wrappers.dll') and '$(Platform)' == 'x86'">
141174
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
142175
</None>
143176
<ProjectReference Include="..\..\Realm\Realm\Realm.csproj" PrivateAssets="None">
-2.45 KB
Binary file not shown.

‎wrappers/CMakeLists.txt

+1-7
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,7 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "^Windows")
5454
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
5555
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
5656

57-
if(WINDOWS_STORE)
58-
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} /nodefaultlib:vccorlibd /nodefaultlib:msvcrtd vccorlibd.lib msvcrtd.lib")
59-
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /nodefaultlib:vccorlib /nodefaultlib:msvcrt vccorlib.lib msvcrt.lib")
60-
else()
61-
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} /nodefaultlib:libucrtd.lib /defaultlib:ucrtd.lib")
62-
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /nodefaultlib:libucrt.lib /defaultlib:ucrt.lib")
63-
57+
if(NOT WINDOWS_STORE)
6458
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
6559
endif()
6660
endif()

0 commit comments

Comments
 (0)
Please sign in to comment.