From 4ce87d72fcb21eea4cb62244eca53a3370bdff7c Mon Sep 17 00:00:00 2001 From: Johan Laanstra Date: Wed, 11 Dec 2019 13:46:07 -0800 Subject: [PATCH] Provide the correct path to the implementation dll. --- nuget/Microsoft.Windows.CppWinRT.targets | 2 +- test/nuget/NuGetTest.sln | 16 ++ test/nuget/TestApp/MainPage.cpp | 4 + test/nuget/TestApp/TestApp.vcxproj | 3 + test/nuget/TestApp/pch.h | 1 + .../PropertySheet.props | 16 ++ ...estRuntimeComponentNamespaceUnderscore.def | 3 + ...untimeComponentNamespaceUnderscore.vcxproj | 141 ++++++++++++++++++ ...mponentNamespaceUnderscore.vcxproj.filters | 33 ++++ ...ntimeComponentNamespaceUnderscoreClass.cpp | 10 ++ ...RuntimeComponentNamespaceUnderscoreClass.h | 20 +++ ...ntimeComponentNamespaceUnderscoreClass.idl | 10 ++ ...ponentNamespaceUnderscore_TemporaryKey.pfx | Bin 0 -> 2512 bytes .../packages.config | 4 + .../pch.cpp | 1 + .../pch.h | 4 + .../readme.txt | 23 +++ 17 files changed, 290 insertions(+), 1 deletion(-) create mode 100644 test/nuget/TestRuntimeComponentNamespaceUnderscore/PropertySheet.props create mode 100644 test/nuget/TestRuntimeComponentNamespaceUnderscore/TestRuntimeComponentNamespaceUnderscore.def create mode 100644 test/nuget/TestRuntimeComponentNamespaceUnderscore/TestRuntimeComponentNamespaceUnderscore.vcxproj create mode 100644 test/nuget/TestRuntimeComponentNamespaceUnderscore/TestRuntimeComponentNamespaceUnderscore.vcxproj.filters create mode 100644 test/nuget/TestRuntimeComponentNamespaceUnderscore/TestRuntimeComponentNamespaceUnderscoreClass.cpp create mode 100644 test/nuget/TestRuntimeComponentNamespaceUnderscore/TestRuntimeComponentNamespaceUnderscoreClass.h create mode 100644 test/nuget/TestRuntimeComponentNamespaceUnderscore/TestRuntimeComponentNamespaceUnderscoreClass.idl create mode 100644 test/nuget/TestRuntimeComponentNamespaceUnderscore/TestRuntimeComponentNamespaceUnderscore_TemporaryKey.pfx create mode 100644 test/nuget/TestRuntimeComponentNamespaceUnderscore/packages.config create mode 100644 test/nuget/TestRuntimeComponentNamespaceUnderscore/pch.cpp create mode 100644 test/nuget/TestRuntimeComponentNamespaceUnderscore/pch.h create mode 100644 test/nuget/TestRuntimeComponentNamespaceUnderscore/readme.txt diff --git a/nuget/Microsoft.Windows.CppWinRT.targets b/nuget/Microsoft.Windows.CppWinRT.targets index 1b08f47b7..b4e71f29d 100644 --- a/nuget/Microsoft.Windows.CppWinRT.targets +++ b/nuget/Microsoft.Windows.CppWinRT.targets @@ -194,7 +194,7 @@ Copyright (C) Microsoft Corporation. All rights reserved. $([System.IO.Path]::GetFileName('$(CppWinRTProjectWinMD)')) true - $(WinMDImplementationPath)$(RootNamespace)$(TargetExt) + $(WinMDImplementationPath)$(TargetName)$(TargetExt) winmd true $(MSBuildProjectName) diff --git a/test/nuget/NuGetTest.sln b/test/nuget/NuGetTest.sln index 8e6f6108e..c8d379576 100644 --- a/test/nuget/NuGetTest.sln +++ b/test/nuget/NuGetTest.sln @@ -37,6 +37,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestStaticLibrary6", "TestS EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestRuntimeComponentCSharp", "TestRuntimeComponentCSharp\TestRuntimeComponentCSharp.csproj", "{C47F8562-A2B9-4BA3-87AC-B42D015E241D}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestRuntimeComponentNamespaceUnderscore", "TestRuntimeComponentNamespaceUnderscore\TestRuntimeComponentNamespaceUnderscore.vcxproj", "{8717FA32-34A8-457D-B77B-AE005703EB55}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|ARM = Debug|ARM @@ -237,6 +239,20 @@ Global {C47F8562-A2B9-4BA3-87AC-B42D015E241D}.Release|x64.Build.0 = Release|x64 {C47F8562-A2B9-4BA3-87AC-B42D015E241D}.Release|x86.ActiveCfg = Release|x86 {C47F8562-A2B9-4BA3-87AC-B42D015E241D}.Release|x86.Build.0 = Release|x86 + {8717FA32-34A8-457D-B77B-AE005703EB55}.Debug|ARM.ActiveCfg = Debug|ARM + {8717FA32-34A8-457D-B77B-AE005703EB55}.Debug|ARM.Build.0 = Debug|ARM + {8717FA32-34A8-457D-B77B-AE005703EB55}.Debug|ARM64.ActiveCfg = Debug|Win32 + {8717FA32-34A8-457D-B77B-AE005703EB55}.Debug|x64.ActiveCfg = Debug|x64 + {8717FA32-34A8-457D-B77B-AE005703EB55}.Debug|x64.Build.0 = Debug|x64 + {8717FA32-34A8-457D-B77B-AE005703EB55}.Debug|x86.ActiveCfg = Debug|Win32 + {8717FA32-34A8-457D-B77B-AE005703EB55}.Debug|x86.Build.0 = Debug|Win32 + {8717FA32-34A8-457D-B77B-AE005703EB55}.Release|ARM.ActiveCfg = Release|ARM + {8717FA32-34A8-457D-B77B-AE005703EB55}.Release|ARM.Build.0 = Release|ARM + {8717FA32-34A8-457D-B77B-AE005703EB55}.Release|ARM64.ActiveCfg = Release|Win32 + {8717FA32-34A8-457D-B77B-AE005703EB55}.Release|x64.ActiveCfg = Release|x64 + {8717FA32-34A8-457D-B77B-AE005703EB55}.Release|x64.Build.0 = Release|x64 + {8717FA32-34A8-457D-B77B-AE005703EB55}.Release|x86.ActiveCfg = Release|Win32 + {8717FA32-34A8-457D-B77B-AE005703EB55}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/test/nuget/TestApp/MainPage.cpp b/test/nuget/TestApp/MainPage.cpp index a9a21b589..e9542ed46 100644 --- a/test/nuget/TestApp/MainPage.cpp +++ b/test/nuget/TestApp/MainPage.cpp @@ -10,6 +10,7 @@ using namespace winrt::TestRuntimeComponent2; using namespace winrt::TestRuntimeComponentCX; using namespace winrt::TestRuntimeComponentEmpty; using namespace winrt::TestRuntimeComponentEmpty::SubNamespace1; +using namespace winrt::TestRuntimeComponent_NamespaceUnderscore; namespace winrt::TestApp::implementation { @@ -26,6 +27,9 @@ namespace winrt::TestApp::implementation TestRuntimeComponentCXClass c3{}; c3.Test(); + TestRuntimeComponentNamespaceUnderscoreClass cUnderscore{}; + cUnderscore.Test(); + TestStaticLibrary1Class cStatic1{}; cStatic1.Test(); diff --git a/test/nuget/TestApp/TestApp.vcxproj b/test/nuget/TestApp/TestApp.vcxproj index 40950799e..1fd086156 100644 --- a/test/nuget/TestApp/TestApp.vcxproj +++ b/test/nuget/TestApp/TestApp.vcxproj @@ -165,6 +165,9 @@ {8456c55f-bf01-4798-b79b-7388681c398f} + + {8717fa32-34a8-457d-b77b-ae005703eb55} + {2158f418-ca97-4599-8103-efc133850baa} diff --git a/test/nuget/TestApp/pch.h b/test/nuget/TestApp/pch.h index b6e7cdb7b..64d2f7ef6 100644 --- a/test/nuget/TestApp/pch.h +++ b/test/nuget/TestApp/pch.h @@ -18,3 +18,4 @@ #include #include #include +#include diff --git a/test/nuget/TestRuntimeComponentNamespaceUnderscore/PropertySheet.props b/test/nuget/TestRuntimeComponentNamespaceUnderscore/PropertySheet.props new file mode 100644 index 000000000..e34141b01 --- /dev/null +++ b/test/nuget/TestRuntimeComponentNamespaceUnderscore/PropertySheet.props @@ -0,0 +1,16 @@ + + + + + + + + \ No newline at end of file diff --git a/test/nuget/TestRuntimeComponentNamespaceUnderscore/TestRuntimeComponentNamespaceUnderscore.def b/test/nuget/TestRuntimeComponentNamespaceUnderscore/TestRuntimeComponentNamespaceUnderscore.def new file mode 100644 index 000000000..24e7c1235 --- /dev/null +++ b/test/nuget/TestRuntimeComponentNamespaceUnderscore/TestRuntimeComponentNamespaceUnderscore.def @@ -0,0 +1,3 @@ +EXPORTS +DllCanUnloadNow = WINRT_CanUnloadNow PRIVATE +DllGetActivationFactory = WINRT_GetActivationFactory PRIVATE diff --git a/test/nuget/TestRuntimeComponentNamespaceUnderscore/TestRuntimeComponentNamespaceUnderscore.vcxproj b/test/nuget/TestRuntimeComponentNamespaceUnderscore/TestRuntimeComponentNamespaceUnderscore.vcxproj new file mode 100644 index 000000000..7b50578b2 --- /dev/null +++ b/test/nuget/TestRuntimeComponentNamespaceUnderscore/TestRuntimeComponentNamespaceUnderscore.vcxproj @@ -0,0 +1,141 @@ + + + + + true + true + true + true + {8717fa32-34a8-457d-b77b-ae005703eb55} + TestRuntimeComponentNamespaceUnderscore + TestRuntimeComponent_NamespaceUnderscore + en-US + 14.0 + true + Windows Store + 10.0 + 10.0.18362.0 + 10.0.17134.0 + + + + + Debug + ARM + + + Debug + Win32 + + + Debug + x64 + + + Release + ARM + + + Release + Win32 + + + Release + x64 + + + + DynamicLibrary + v140 + v141 + v142 + Unicode + false + + + true + true + + + false + true + false + + + + + + + + + + + + + + + + + Use + pch.h + $(IntDir)pch.pch + Level4 + %(AdditionalOptions) /bigobj + + /DWINRT_NO_MAKE_DETECTION %(AdditionalOptions) + + + _WINRT_DLL;WIN32_LEAN_AND_MEAN;WINRT_LEAN_AND_MEAN;%(PreprocessorDefinitions) + $(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories) + + + Console + false + TestRuntimeComponentNamespaceUnderscore.def + + + + + _DEBUG;%(PreprocessorDefinitions) + + + + + NDEBUG;%(PreprocessorDefinitions) + + + true + true + + + + + + TestRuntimeComponentNamespaceUnderscoreClass.idl + + + + + Create + + + TestRuntimeComponentNamespaceUnderscoreClass.idl + + + + + + + + + + + + + + false + + + + + \ No newline at end of file diff --git a/test/nuget/TestRuntimeComponentNamespaceUnderscore/TestRuntimeComponentNamespaceUnderscore.vcxproj.filters b/test/nuget/TestRuntimeComponentNamespaceUnderscore/TestRuntimeComponentNamespaceUnderscore.vcxproj.filters new file mode 100644 index 000000000..3fc5de717 --- /dev/null +++ b/test/nuget/TestRuntimeComponentNamespaceUnderscore/TestRuntimeComponentNamespaceUnderscore.vcxproj.filters @@ -0,0 +1,33 @@ + + + + + accd3aa8-1ba0-4223-9bbe-0c431709210b + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tga;tiff;tif;png;wav;mfcribbon-ms + + + {926ab91d-31b4-48c3-b9a4-e681349f27f0} + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/nuget/TestRuntimeComponentNamespaceUnderscore/TestRuntimeComponentNamespaceUnderscoreClass.cpp b/test/nuget/TestRuntimeComponentNamespaceUnderscore/TestRuntimeComponentNamespaceUnderscoreClass.cpp new file mode 100644 index 000000000..e3d62fe4b --- /dev/null +++ b/test/nuget/TestRuntimeComponentNamespaceUnderscore/TestRuntimeComponentNamespaceUnderscoreClass.cpp @@ -0,0 +1,10 @@ +#include "pch.h" +#include "TestRuntimeComponentNamespaceUnderscoreClass.h" +#include "TestRuntimeComponentNamespaceUnderscoreClass.g.cpp" + +namespace winrt::TestRuntimeComponent_NamespaceUnderscore::implementation +{ + void TestRuntimeComponentNamespaceUnderscoreClass::Test() + { + } +} diff --git a/test/nuget/TestRuntimeComponentNamespaceUnderscore/TestRuntimeComponentNamespaceUnderscoreClass.h b/test/nuget/TestRuntimeComponentNamespaceUnderscore/TestRuntimeComponentNamespaceUnderscoreClass.h new file mode 100644 index 000000000..4f38f6513 --- /dev/null +++ b/test/nuget/TestRuntimeComponentNamespaceUnderscore/TestRuntimeComponentNamespaceUnderscoreClass.h @@ -0,0 +1,20 @@ +#pragma once + +#include "TestRuntimeComponentNamespaceUnderscoreClass.g.h" + +namespace winrt::TestRuntimeComponent_NamespaceUnderscore::implementation +{ + struct TestRuntimeComponentNamespaceUnderscoreClass : TestRuntimeComponentNamespaceUnderscoreClassT + { + TestRuntimeComponentNamespaceUnderscoreClass() = default; + + void Test(); + }; +} + +namespace winrt::TestRuntimeComponent_NamespaceUnderscore::factory_implementation +{ + struct TestRuntimeComponentNamespaceUnderscoreClass : TestRuntimeComponentNamespaceUnderscoreClassT + { + }; +} diff --git a/test/nuget/TestRuntimeComponentNamespaceUnderscore/TestRuntimeComponentNamespaceUnderscoreClass.idl b/test/nuget/TestRuntimeComponentNamespaceUnderscore/TestRuntimeComponentNamespaceUnderscoreClass.idl new file mode 100644 index 000000000..2809a1c86 --- /dev/null +++ b/test/nuget/TestRuntimeComponentNamespaceUnderscore/TestRuntimeComponentNamespaceUnderscoreClass.idl @@ -0,0 +1,10 @@ +namespace TestRuntimeComponent_NamespaceUnderscore +{ + [default_interface] + runtimeclass TestRuntimeComponentNamespaceUnderscoreClass + { + TestRuntimeComponentNamespaceUnderscoreClass(); + + void Test(); + } +} diff --git a/test/nuget/TestRuntimeComponentNamespaceUnderscore/TestRuntimeComponentNamespaceUnderscore_TemporaryKey.pfx b/test/nuget/TestRuntimeComponentNamespaceUnderscore/TestRuntimeComponentNamespaceUnderscore_TemporaryKey.pfx new file mode 100644 index 0000000000000000000000000000000000000000..dac97059a8cb20c1fc0771a2086483fbbedd1071 GIT binary patch literal 2512 zcmZXUc{J2tAIHD5mwh;m~}V; zdZb}ay4vc}Bn%9O_d+SqAt{85jhIp9i_&6~+D0SLyk}COZdHy)t{rD9Qn3rc{5TE1dGAQF(cIV2UPOhA`{-elxhZExSu3rRt2m;n{M?NK&4YQi*K3Vzv*~GK& zNLrKi0&np$OyRq)UyH7$m>TVruKak*%czf6Fua|=P=}v0HOWV75eCM}b#wk`b5W5y z+mK7OIRXh6U2s1YecW5gn%<804O!o4lUm>7k^ESf(8x1b0Y?qB4?Y;&Y`&Vpq^>z9 z>*vc2J6?MJ}Bj(a)sFok zE?0_!&9pqKnPO)plGEXbcjOyOe0}RvvwfQ+E9VLHratj+Cv>n=E5k(Dd6DD+Hui&X z#)TIVx)o9y7&Drcb#jQ8;xz9IjkZAHpN0@u+*p=c;8E_xMZGi2_H)ggnT~`%7Xq66 z?|(d+K?51=Z@q&VKgI{3Fz?oyPNWf6Cq{^LjDyOXip#upT5iko_ncHaVW{XA@0C;N zC1c{`8$>v!@=4}-goWRU`?}e0ate5DGZ4{TZo%h`=K_9LuV8J+ z&eh>@-*wXCDAPFl?aLD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erVRVK-z9JG;Pc=x@6iS1%9~;TL zAGuY76iJeNuasLc((hM?;pu*-oyFX>R4P@4E=&(8iBYy>G&32#z#d6dTDyGO;3VQy z*R6-l0lM&P7i8GZccjUe^#`-(%6^hvP@QHa@g7M#FXHIHgu=QAv)6hiQ4X8_W0x6!obDt zac1c>GTn$@(FdDOg_~-ZUXXo+e?Do^e5~V$WPdh_m)14;AtCkYj&^%ikh?d#S5t() z4G`tQ>)uwwSDG&b*(Nph?y7P0tAyfXxW`m%H|-hoeHTW-I7hNpFmfB#QTY*s`c91m zE#cOzoDB}8yF5g$+!EUUgz3m@W1rX!5+L`#oeZlNDp%*03M83&mf?F8DlFgD1xN_? zy}NgmUY@XC;4G%Uxbqcb_`*xq57YG6{es%StH!uUuKJ7luISp48PK-_1V*nWxqHCE z2Bt9@UGS6^comd>FClbW(%9`)_IwjDp|S@2(J~*+d{XNxGyoBtd5yd^5qr0)E+aVK zO@|x1dtCFQLHUqX7bdsWp51qWyPuL6+0fMVwIIBTK#}Yz6DoV;*lss1<1ZP>kPqzs zQ&!KR)?}PUudDnVn-TIyuYjtebNa@upcDnw%lj1wkD^n(b>-&e<}#7fiO>}^YTBor zAvcDP&bqt97)FP`r5@@+hpEDLu78-9 zx~TV&Ui576D-c!_D~^T3*iIuLU=b*P*f=5P-b~1LR^FQy6KFv~7^W%_%0IGM-g&)2 VhbF|dx6 + + + \ No newline at end of file diff --git a/test/nuget/TestRuntimeComponentNamespaceUnderscore/pch.cpp b/test/nuget/TestRuntimeComponentNamespaceUnderscore/pch.cpp new file mode 100644 index 000000000..bcb5590be --- /dev/null +++ b/test/nuget/TestRuntimeComponentNamespaceUnderscore/pch.cpp @@ -0,0 +1 @@ +#include "pch.h" diff --git a/test/nuget/TestRuntimeComponentNamespaceUnderscore/pch.h b/test/nuget/TestRuntimeComponentNamespaceUnderscore/pch.h new file mode 100644 index 000000000..21199686d --- /dev/null +++ b/test/nuget/TestRuntimeComponentNamespaceUnderscore/pch.h @@ -0,0 +1,4 @@ +#pragma once +#include +#include +#include diff --git a/test/nuget/TestRuntimeComponentNamespaceUnderscore/readme.txt b/test/nuget/TestRuntimeComponentNamespaceUnderscore/readme.txt new file mode 100644 index 000000000..1ca7f1a7d --- /dev/null +++ b/test/nuget/TestRuntimeComponentNamespaceUnderscore/readme.txt @@ -0,0 +1,23 @@ +======================================================================== + C++/WinRT TestRuntimeComponentNamespaceUnderscore Project Overview +======================================================================== + +This project demonstrates how to get started authoring Windows Runtime +classes directly with standard C++, using the C++/WinRT SDK component +to generate implementation headers from interface (IDL) files. The +generated Windows Runtime component binary and WinMD files should then +be bundled with the Universal Windows Platform (UWP) app consuming them. + +Steps: +1. Create an interface (IDL) file to define your Windows Runtime class, + its default interface, and any other interfaces it implements. +2. Build the project once to generate module.g.cpp, module.h.cpp, and + implementation templates under the "Generated Files" folder, as + well as skeleton class definitions under "Generated Files\sources". +3. Use the skeleton class definitions for reference to implement your + Windows Runtime classes. + +======================================================================== +Learn more about C++/WinRT here: +http://aka.ms/cppwinrt/ +========================================================================