Skip to content

Commit add7eec

Browse files
jlaanstrakennykerr
authored andcommitted
Add a C# runtime component to the test solution. (#448)
1 parent e75e51b commit add7eec

File tree

9 files changed

+223
-2
lines changed

9 files changed

+223
-2
lines changed

nuget/Microsoft.Windows.CppWinRT.targets

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,9 @@ Copyright (C) Microsoft Corporation. All rights reserved.
278278
<!--Get dynamic library project references-->
279279
<_CppWinRTDynamicProjectReferences Remove="@(_CppWinRTDynamicProjectReferences)"/>
280280
<_CppWinRTDynamicProjectReferences Include="@(_ResolvedProjectReferencePaths)"
281-
Condition= "'%(_ResolvedProjectReferencePaths.ProjectType)'!='StaticLibrary' AND '%(_ResolvedProjectReferencePaths.WinMDFile)' == 'true'"/>
281+
Condition= "'%(_ResolvedProjectReferencePaths.ProjectType)'!='StaticLibrary' AND
282+
('%(_ResolvedProjectReferencePaths.WinMDFile)' == 'true' OR
283+
('%(_ResolvedProjectReferencePaths.WinMDFile)' == '' AND '%(_ResolvedProjectReferencePaths.Extension)' == '.winmd'))"/>
282284
</ItemGroup>
283285
<ItemGroup>
284286
<CppWinRTStaticProjectWinMDReferences Remove="@(CppWinRTStaticProjectWinMDReferences)" />

test/nuget/NuGetTest.sln

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestStaticLibrary5", "TestS
3535
EndProject
3636
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestStaticLibrary6", "TestStaticLibrary6\TestStaticLibrary6.vcxproj", "{DC435C3F-C38E-43D1-B702-DC03F530A3DD}"
3737
EndProject
38+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestRuntimeComponentCSharp", "TestRuntimeComponentCSharp\TestRuntimeComponentCSharp.csproj", "{C47F8562-A2B9-4BA3-87AC-B42D015E241D}"
39+
EndProject
3840
Global
3941
GlobalSection(SolutionConfigurationPlatforms) = preSolution
4042
Debug|ARM = Debug|ARM
@@ -219,6 +221,22 @@ Global
219221
{DC435C3F-C38E-43D1-B702-DC03F530A3DD}.Release|x64.Build.0 = Release|x64
220222
{DC435C3F-C38E-43D1-B702-DC03F530A3DD}.Release|x86.ActiveCfg = Release|Win32
221223
{DC435C3F-C38E-43D1-B702-DC03F530A3DD}.Release|x86.Build.0 = Release|Win32
224+
{C47F8562-A2B9-4BA3-87AC-B42D015E241D}.Debug|ARM.ActiveCfg = Debug|ARM
225+
{C47F8562-A2B9-4BA3-87AC-B42D015E241D}.Debug|ARM.Build.0 = Debug|ARM
226+
{C47F8562-A2B9-4BA3-87AC-B42D015E241D}.Debug|ARM64.ActiveCfg = Debug|ARM64
227+
{C47F8562-A2B9-4BA3-87AC-B42D015E241D}.Debug|ARM64.Build.0 = Debug|ARM64
228+
{C47F8562-A2B9-4BA3-87AC-B42D015E241D}.Debug|x64.ActiveCfg = Debug|x64
229+
{C47F8562-A2B9-4BA3-87AC-B42D015E241D}.Debug|x64.Build.0 = Debug|x64
230+
{C47F8562-A2B9-4BA3-87AC-B42D015E241D}.Debug|x86.ActiveCfg = Debug|x86
231+
{C47F8562-A2B9-4BA3-87AC-B42D015E241D}.Debug|x86.Build.0 = Debug|x86
232+
{C47F8562-A2B9-4BA3-87AC-B42D015E241D}.Release|ARM.ActiveCfg = Release|ARM
233+
{C47F8562-A2B9-4BA3-87AC-B42D015E241D}.Release|ARM.Build.0 = Release|ARM
234+
{C47F8562-A2B9-4BA3-87AC-B42D015E241D}.Release|ARM64.ActiveCfg = Release|ARM64
235+
{C47F8562-A2B9-4BA3-87AC-B42D015E241D}.Release|ARM64.Build.0 = Release|ARM64
236+
{C47F8562-A2B9-4BA3-87AC-B42D015E241D}.Release|x64.ActiveCfg = Release|x64
237+
{C47F8562-A2B9-4BA3-87AC-B42D015E241D}.Release|x64.Build.0 = Release|x64
238+
{C47F8562-A2B9-4BA3-87AC-B42D015E241D}.Release|x86.ActiveCfg = Release|x86
239+
{C47F8562-A2B9-4BA3-87AC-B42D015E241D}.Release|x86.Build.0 = Release|x86
222240
EndGlobalSection
223241
GlobalSection(SolutionProperties) = preSolution
224242
HideSolutionNode = FALSE

test/nuget/TestApp/TestApp.vcxproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@
7878
<AdditionalOptions>%(AdditionalOptions) /bigobj</AdditionalOptions>
7979
<!--Temporarily disable cppwinrt heap enforcement to work around xaml compiler generated std::shared_ptr use -->
8080
<AdditionalOptions Condition="'$(CppWinRTHeapEnforcement)'==''">/DWINRT_NO_MAKE_DETECTION %(AdditionalOptions)</AdditionalOptions>
81-
<DisableSpecificWarnings></DisableSpecificWarnings>
81+
<DisableSpecificWarnings>
82+
</DisableSpecificWarnings>
8283
</ClCompile>
8384
</ItemDefinitionGroup>
8485
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
@@ -155,6 +156,9 @@
155156
<ProjectReference Include="..\TestRuntimeComponent2\TestRuntimeComponent2.vcxproj">
156157
<Project>{4bbb2de7-4596-4da6-a923-e65e838363b5}</Project>
157158
</ProjectReference>
159+
<ProjectReference Include="..\TestRuntimeComponentCSharp\TestRuntimeComponentCSharp.csproj">
160+
<Project>{c47f8562-a2b9-4ba3-87ac-b42d015e241d}</Project>
161+
</ProjectReference>
158162
<ProjectReference Include="..\TestRuntimeComponentCX\TestRuntimeComponentCX.vcxproj">
159163
<Project>{adc53200-b456-4386-9851-5bf69dfb8928}</Project>
160164
</ProjectReference>

test/nuget/TestRuntimeComponent3/TestRuntimeComponent3.vcxproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@
132132
</Text>
133133
</ItemGroup>
134134
<ItemGroup>
135+
<ProjectReference Include="..\TestRuntimeComponentCSharp\TestRuntimeComponentCSharp.csproj">
136+
<Project>{c47f8562-a2b9-4ba3-87ac-b42d015e241d}</Project>
137+
</ProjectReference>
135138
<ProjectReference Include="..\TestStaticLibrary3\TestStaticLibrary3.vcxproj">
136139
<Project>{1350e626-038b-4bdf-8e1d-c751ef33d90f}</Project>
137140
</ProjectReference>

test/nuget/TestRuntimeComponent3/TestRuntimeComponent3Class.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@
22
#include "TestRuntimeComponent3Class.h"
33
#include "TestRuntimeComponent3Class.g.cpp"
44

5+
using namespace winrt::TestRuntimeComponentCSharp;
6+
57
namespace winrt::TestRuntimeComponent3::implementation
68
{
79
void TestRuntimeComponent3Class::Test()
810
{
911
TestStaticLibrary3Class c{};
1012
c.Test();
13+
14+
TestRuntimeComponentCSharpClass csharp{};
15+
csharp.Test();
1116
}
1217
}

test/nuget/TestRuntimeComponent3/pch.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
#include <unknwn.h>
33
#include <winrt/Windows.Foundation.h>
44
#include <winrt/Windows.Foundation.Collections.h>
5+
6+
#include <winrt/TestRuntimeComponentCSharp.h>
Lines changed: 29 additions & 0 deletions
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("RuntimeComponentCSharp")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("RuntimeComponentCSharp")]
13+
[assembly: AssemblyCopyright("Copyright © 2019")]
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)]
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{C47F8562-A2B9-4BA3-87AC-B42D015E241D}</ProjectGuid>
8+
<OutputType>winmdobj</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>TestRuntimeComponentCSharp</RootNamespace>
11+
<AssemblyName>TestRuntimeComponentCSharp</AssemblyName>
12+
<DefaultLanguage>en-US</DefaultLanguage>
13+
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
14+
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.18362.0</TargetPlatformVersion>
15+
<TargetPlatformMinVersion>10.0.15063.0</TargetPlatformMinVersion>
16+
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
17+
<FileAlignment>512</FileAlignment>
18+
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
19+
<AllowCrossPlatformRetargeting>false</AllowCrossPlatformRetargeting>
20+
</PropertyGroup>
21+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
22+
<PlatformTarget>AnyCPU</PlatformTarget>
23+
<DebugSymbols>true</DebugSymbols>
24+
<DebugType>full</DebugType>
25+
<Optimize>false</Optimize>
26+
<OutputPath>bin\Debug\</OutputPath>
27+
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
28+
<ErrorReport>prompt</ErrorReport>
29+
<WarningLevel>4</WarningLevel>
30+
</PropertyGroup>
31+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
32+
<PlatformTarget>AnyCPU</PlatformTarget>
33+
<DebugType>pdbonly</DebugType>
34+
<Optimize>true</Optimize>
35+
<OutputPath>bin\Release\</OutputPath>
36+
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
37+
<ErrorReport>prompt</ErrorReport>
38+
<WarningLevel>4</WarningLevel>
39+
</PropertyGroup>
40+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
41+
<PlatformTarget>x86</PlatformTarget>
42+
<DebugSymbols>true</DebugSymbols>
43+
<OutputPath>bin\x86\Debug\</OutputPath>
44+
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
45+
<NoWarn>;2008</NoWarn>
46+
<DebugType>full</DebugType>
47+
<UseVSHostingProcess>false</UseVSHostingProcess>
48+
<ErrorReport>prompt</ErrorReport>
49+
</PropertyGroup>
50+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
51+
<PlatformTarget>x86</PlatformTarget>
52+
<OutputPath>bin\x86\Release\</OutputPath>
53+
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
54+
<Optimize>true</Optimize>
55+
<NoWarn>;2008</NoWarn>
56+
<DebugType>pdbonly</DebugType>
57+
<UseVSHostingProcess>false</UseVSHostingProcess>
58+
<ErrorReport>prompt</ErrorReport>
59+
</PropertyGroup>
60+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
61+
<PlatformTarget>ARM</PlatformTarget>
62+
<DebugSymbols>true</DebugSymbols>
63+
<OutputPath>bin\ARM\Debug\</OutputPath>
64+
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
65+
<NoWarn>;2008</NoWarn>
66+
<DebugType>full</DebugType>
67+
<UseVSHostingProcess>false</UseVSHostingProcess>
68+
<ErrorReport>prompt</ErrorReport>
69+
</PropertyGroup>
70+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
71+
<PlatformTarget>ARM</PlatformTarget>
72+
<OutputPath>bin\ARM\Release\</OutputPath>
73+
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
74+
<Optimize>true</Optimize>
75+
<NoWarn>;2008</NoWarn>
76+
<DebugType>pdbonly</DebugType>
77+
<UseVSHostingProcess>false</UseVSHostingProcess>
78+
<ErrorReport>prompt</ErrorReport>
79+
</PropertyGroup>
80+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM64'">
81+
<PlatformTarget>ARM64</PlatformTarget>
82+
<DebugSymbols>true</DebugSymbols>
83+
<OutputPath>bin\ARM64\Debug\</OutputPath>
84+
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
85+
<NoWarn>;2008</NoWarn>
86+
<DebugType>full</DebugType>
87+
<UseVSHostingProcess>false</UseVSHostingProcess>
88+
<ErrorReport>prompt</ErrorReport>
89+
</PropertyGroup>
90+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM64'">
91+
<PlatformTarget>ARM64</PlatformTarget>
92+
<OutputPath>bin\ARM64\Release\</OutputPath>
93+
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
94+
<Optimize>true</Optimize>
95+
<NoWarn>;2008</NoWarn>
96+
<DebugType>pdbonly</DebugType>
97+
<UseVSHostingProcess>false</UseVSHostingProcess>
98+
<ErrorReport>prompt</ErrorReport>
99+
</PropertyGroup>
100+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
101+
<PlatformTarget>x64</PlatformTarget>
102+
<DebugSymbols>true</DebugSymbols>
103+
<OutputPath>bin\x64\Debug\</OutputPath>
104+
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
105+
<NoWarn>;2008</NoWarn>
106+
<DebugType>full</DebugType>
107+
<UseVSHostingProcess>false</UseVSHostingProcess>
108+
<ErrorReport>prompt</ErrorReport>
109+
</PropertyGroup>
110+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
111+
<PlatformTarget>x64</PlatformTarget>
112+
<OutputPath>bin\x64\Release\</OutputPath>
113+
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
114+
<Optimize>true</Optimize>
115+
<NoWarn>;2008</NoWarn>
116+
<DebugType>pdbonly</DebugType>
117+
<UseVSHostingProcess>false</UseVSHostingProcess>
118+
<ErrorReport>prompt</ErrorReport>
119+
</PropertyGroup>
120+
<PropertyGroup>
121+
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
122+
</PropertyGroup>
123+
<ItemGroup>
124+
<Compile Include="TestRuntimeComponentCSharpClass.cs" />
125+
<Compile Include="Properties\AssemblyInfo.cs" />
126+
</ItemGroup>
127+
<ItemGroup>
128+
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
129+
<Version>5.4.7</Version>
130+
</PackageReference>
131+
</ItemGroup>
132+
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
133+
<VisualStudioVersion>14.0</VisualStudioVersion>
134+
</PropertyGroup>
135+
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
136+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
137+
Other similar extension points exist, see Microsoft.Common.targets.
138+
<Target Name="BeforeBuild">
139+
</Target>
140+
<Target Name="AfterBuild">
141+
</Target>
142+
-->
143+
</Project>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace TestRuntimeComponentCSharp
8+
{
9+
public sealed class TestRuntimeComponentCSharpClass
10+
{
11+
public void Test()
12+
{
13+
}
14+
}
15+
}

0 commit comments

Comments
 (0)