From 6a9d05cf9a52f2bbfa2dc479833d9cfdc08dedea Mon Sep 17 00:00:00 2001 From: mingkuang Date: Wed, 16 Sep 2020 21:09:20 +0800 Subject: [PATCH] =?UTF-8?q?*=20=E6=96=B0=E5=A2=9EFea=EF=BC=8C=E4=B8=BAC++?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20contentFiles=20=E7=89=B9=E6=80=A7=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 6 +++ YY.NuGet.Import.Helper.nuspec | 37 +++++++++++++++++ YY.NuGet.Import.Helper.props | 2 +- YY.NuGet.Import.Helper.targets | 38 ++++++++++++++++++ readme.md | 73 ++++++++++++++++++++++++++++++++++ 5 files changed, 155 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 YY.NuGet.Import.Helper.nuspec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b171c83 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +################################################################################ +# 此 .gitignore 文件已由 Microsoft(R) Visual Studio 自动创建。 +################################################################################ + +/.vs +*.nupkg diff --git a/YY.NuGet.Import.Helper.nuspec b/YY.NuGet.Import.Helper.nuspec new file mode 100644 index 0000000..6e13e3f --- /dev/null +++ b/YY.NuGet.Import.Helper.nuspec @@ -0,0 +1,37 @@ + + + + YY.NuGet.Import.Helper + NuGet属性表导入助手 + $version$ + 用于增强NuGet属性表导入。 + YY + false + MIT + https://github.com/mingkuang-Chuyu/YY.NuGet.Import.Helper + 功能 —— 增强NuGet导入 + +该 Helper 新增了 4 组导入位点,分别是: + +$(VCTargetsPath)\Microsoft.Cpp.props 之前 +$(VCTargetsPath)\Microsoft.Cpp.props 之后 +$(VCTargetsPath)\Microsoft.Cpp.targets 之前 +$(VCTargetsPath)\Microsoft.Cpp.targets 之后 + +全面增强C++ Import,让你的NuGet包创造更多可能! + + + + * 新增Fea,为C++添加 contentFiles 特性支持。 + + Copyright © 2020 YY + YY Import Import.Helper native nativepackage + + + + + + + + + \ No newline at end of file diff --git a/YY.NuGet.Import.Helper.props b/YY.NuGet.Import.Helper.props index 02f8f1c..e00d353 100644 --- a/YY.NuGet.Import.Helper.props +++ b/YY.NuGet.Import.Helper.props @@ -21,7 +21,7 @@ $(VisualStudioVersion) - 1.0.0.2 + 1.0.0.3 $(MSBuildThisFileDirectory)Fallback\NuGetImportBeforeCppProps.props $(MSBuildThisFileDirectory)Fallback\NuGetImportAfterCppProps.props diff --git a/YY.NuGet.Import.Helper.targets b/YY.NuGet.Import.Helper.targets index 70ef27b..298ec41 100644 --- a/YY.NuGet.Import.Helper.targets +++ b/YY.NuGet.Import.Helper.targets @@ -9,4 +9,42 @@ + + + + + %(Text.FileName) + + + + + true + + + + + + + + %(Content.FileName) + + %(Content.NuGetPackageVersion) + + + + + true + $(ThisNuGetPackageVersion) + + + + + + + + + + \ No newline at end of file diff --git a/readme.md b/readme.md index 09cd98b..c27c587 100644 --- a/readme.md +++ b/readme.md @@ -139,6 +139,76 @@ > 请严格按上述内容使用,不要破坏 NuGetImportAfterCppTargets 链,以免影响到其他NuGet包。 +### 2.5. 为 C++ NuGetPackge 添加 contentFiles 支持。 + +以 Detours 为例,我们只需在Detours.Static.targets中添加如下内容: + +```xml + + + + $(MSBuildThisFileDirectory);$(IncludePath) + + + + + $(MSBuildThisFileName) + + ClCompile + + NotUsing + + false + + false + + $(IntDir)$(MSBuildThisFileName)\ + + + +``` + +Detours.Static.nuspec 内容如下: + +```xml + + + + Detours.Static + 4.0.1.19060 + Detours Source Package + Detours is a software package for monitoring and instrumenting API calls on Windows. + Microsoft + false + MIT + https://github.com/microsoft/Detours + Detours is a software package for monitoring and instrumenting API calls on Windows. Detours has been used by many ISVs and is also used by product teams at Microsoft. Detours is now available under a standard open source license (MIT). This simplifies licensing for programmers using Detours and allows the community to support Detours using open source tools and processes. + +Detours is compatible with the Windows NT family of operating systems: Windows NT, Windows XP, Windows Server 2003, Windows 7, Windows 8, and Windows 10. It cannot be used by Window Store apps because Detours requires APIs not available to those applications. This repo contains the source code for version 4.0.1 of Detours. + +For technical documentation on Detours, see the Detours Wiki. For directions on how to build and run samples, see the samples README.txt file. + Copyright (c) Microsoft Corporation. All rights reserved. + Microsoft Detours native nativepackage + + + + + + + + + + + + + + + + + +``` + + ## 3. 更新日志 ### v1.0.0.1 - 2020-01-02 首次发布 * 添加 $(VCTargetsPath)\Microsoft.Cpp.props 之前导入时机 @@ -148,3 +218,6 @@ ### v1.0.0.2 - 2020-01-14 * 解决Bug,Fallback 重复导入警告问题。 + +### v1.0.0.3 - 2020-09-16 +* 新增Fea,为C++添加 contentFiles 特性支持。