久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

      <small id='x0fNw'></small><noframes id='x0fNw'>

      <i id='x0fNw'><tr id='x0fNw'><dt id='x0fNw'><q id='x0fNw'><span id='x0fNw'><b id='x0fNw'><form id='x0fNw'><ins id='x0fNw'></ins><ul id='x0fNw'></ul><sub id='x0fNw'></sub></form><legend id='x0fNw'></legend><bdo id='x0fNw'><pre id='x0fNw'><center id='x0fNw'></center></pre></bdo></b><th id='x0fNw'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='x0fNw'><tfoot id='x0fNw'></tfoot><dl id='x0fNw'><fieldset id='x0fNw'></fieldset></dl></div>
      <legend id='x0fNw'><style id='x0fNw'><dir id='x0fNw'><q id='x0fNw'></q></dir></style></legend>
      <tfoot id='x0fNw'></tfoot>
      • <bdo id='x0fNw'></bdo><ul id='x0fNw'></ul>

      MSBuild:用于 VS2010 中本機(jī) C++ 項目的 Custom.After.Mi

      MSBuild: Custom.After.Microsoft.Common.targets for native C++ projects in VS2010(MSBuild:用于 VS2010 中本機(jī) C++ 項目的 Custom.After.Microsoft.Common.targets)
    1. <legend id='COC0m'><style id='COC0m'><dir id='COC0m'><q id='COC0m'></q></dir></style></legend>

              <tbody id='COC0m'></tbody>

            1. <small id='COC0m'></small><noframes id='COC0m'>

                <bdo id='COC0m'></bdo><ul id='COC0m'></ul>
                <i id='COC0m'><tr id='COC0m'><dt id='COC0m'><q id='COC0m'><span id='COC0m'><b id='COC0m'><form id='COC0m'><ins id='COC0m'></ins><ul id='COC0m'></ul><sub id='COC0m'></sub></form><legend id='COC0m'></legend><bdo id='COC0m'><pre id='COC0m'><center id='COC0m'></center></pre></bdo></b><th id='COC0m'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='COC0m'><tfoot id='COC0m'></tfoot><dl id='COC0m'><fieldset id='COC0m'></fieldset></dl></div>
              • <tfoot id='COC0m'></tfoot>
              • 本文介紹了MSBuild:用于 VS2010 中本機(jī) C++ 項目的 Custom.After.Microsoft.Common.targets的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

                限時送ChatGPT賬號..

                我已經(jīng)閱讀了關(guān)于Custom.Before.Microsoft.Common.targets"和Custom.After.Microsoft.Common.targets"的使用,以便在每個項目構(gòu)建之前/之后執(zhí)行自定義目標(biāo),我會喜歡使用這種技術(shù)來在我們的 TeamCity 構(gòu)建服務(wù)器上構(gòu)建時更改版本信息.

                I've read about the use of "Custom.Before.Microsoft.Common.targets" and "Custom.After.Microsoft.Common.targets" in order to execute a custom target before/after every project build and I would like to use this technique in order to change version info while building on our TeamCity build server.

                問題是,雖然它適用于 C# 項目,但它似乎不適用于本機(jī) C++ 項目.

                The problem is that although it works for C# projects, it doesn't seem to work for native C++ projects.

                在 Microsoft.Cpp.targets 文件中進(jìn)行一些挖掘后,我發(fā)現(xiàn)對于本機(jī) C++ 項目,這似乎是通過設(shè)置 $(ForceImportBeforeCppTargets) 和 $(ForceImportAfterCppTargets) 來實(shí)現(xiàn)的.

                After some digging around in the Microsoft.Cpp.targets file I found out that for native C++ projects this seems to be implemented through setting $(ForceImportBeforeCppTargets) and $(ForceImportAfterCppTargets).

                不過,我似乎無法在網(wǎng)絡(luò)上找到有關(guān)本機(jī) C++ 應(yīng)用程序的這項技術(shù)的一條信息,所以我在問我是否在尋找正確的方向.

                I can't seem to find a single piece of information on the web about this technique for native C++ apps though, so I'm asking if I'm looking in the right direction or not.

                感謝任何幫助.

                推薦答案

                對于 VC++ 項目來說有點(diǎn)不同.您可以在項目開始或結(jié)束時定義要導(dǎo)入的文件.要使用此方法,您需要為屬性 ForceImportBeforeCppTargetsForceImportAfterCppTargets 定義值.例如,如果您希望在項目的開頭包含一個文件,您可以在命令行中傳遞該值.例如,我剛剛創(chuàng)建了一個名為 CppTets??01 的虛擬 VC++ 項目.然后我創(chuàng)建了下面的兩個示例文件.

                For VC++ projects it is a bit different. You define a file to be imported either at the beginning or at the end of the project. To use this approach you need to define values for the properties ForceImportBeforeCppTargets or ForceImportAfterCppTargets. For example if you want a file to be included at the beginning of the project you can pass in the value at the command line. For example I just created a dummy VC++ project named CppTets01. Then I created the two sample files below.

                Before.proj

                <?xml version="1.0" encoding="utf-8"?>
                <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
                
                
                  <Target Name="CustomTargetInBefore" AfterTargets="Build">
                    <Message Text="From CustomTargetInBefore" Importance="high"/>
                  </Target>
                
                </Project>
                

                After.proj

                <?xml version="1.0" encoding="utf-8"?>
                <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
                
                  <Target Name="CustomTargetInAfter" AfterTargets="Build">
                    <Message Text="From CustomTargetInAfter" Importance="high"/>
                  </Target>
                
                </Project>
                

                然后我執(zhí)行了以下命令:

                Then I executed the following command:

                msbuild CppTest01.vcxproj 
                    /p:ForceImportBeforeCppTargets="C:Temp\_NETThrowAwayCppTest01CppTest01Before.proj";
                    ForceImportAfterCppTargets="C:Temp\_NETThrowAwayCppTest01CppTest01After.proj"
                

                結(jié)果是C:Temp_NETThrowAwayCppTest01CppTest01>msbuild CppTest01.vcxproj/p:ForceImportBeforeCppTargets="C:Temp_NETThrowAwayCppTest01CppTest01Before.proj";ForceImportAfterCppTargets="C:Temp_NETThrowAwayCppTest01CppTest01After.proj"

                The result was C:Temp_NETThrowAwayCppTest01CppTest01>msbuild CppTest01.vcxproj /p:ForceImportBeforeCppTargets="C:Temp_NETThrowAwayCppTest01C ppTest01Before.proj";ForceImportAfterCppTargets="C:Temp_NETThrowAwayCppTest01CppTest01After.proj"

                Microsoft (R) Build Engine Version 4.0.30319.1
                [Microsoft .NET Framework, Version 4.0.30319.1]
                Copyright (C) Microsoft Corporation 2007. All rights reserved.
                
                Build started 10/18/2010 8:32:55 AM.
                Project "C:Temp\_NETThrowAwayCppTest01CppTest01CppTest01.vcxproj" on node 1 (default targets).
                InitializeBuildStatus:
                  Creating "DebugCppTest01.unsuccessfulbuild" because "AlwaysCreate" was specified.
                ClCompile:
                  All outputs are up-to-date.
                  All outputs are up-to-date.
                ManifestResourceCompile:
                  All outputs are up-to-date.
                Link:
                  All outputs are up-to-date.
                Manifest:
                  All outputs are up-to-date.
                FinalizeBuildStatus:
                  Deleting file "DebugCppTest01.unsuccessfulbuild".
                  Touching "DebugCppTest01.lastbuildstate".
                CustomTargetInBefore:
                  From CustomTargetInBefore
                CustomTargetInAfter:
                  From CustomTargetInAfter
                Done Building Project "C:Temp\_NETThrowAwayCppTest01CppTest01CppTest01.vcxproj" (default targets).
                
                
                Build succeeded.
                    0 Warning(s)
                    0 Error(s)
                
                Time Elapsed 00:00:00.21
                

                從輸出中可以看出,目標(biāo)已成功注入到構(gòu)建過程中.如果您想將其與 Custom.Before.Microsoft.Common.targetsCustom.Before.Microsoft.Common.targets 聯(lián)系起來,那么您應(yīng)該知道那里使用的技術(shù)有點(diǎn)不同.特別是如果您創(chuàng)建這些文件,它們會自動導(dǎo)入到每個 C#/VB.NET 項目中.在這種情況下,您必須設(shè)置此屬性.你真的有兩個選擇:

                As you can see from the output the targets were successfully injected into the build process. If you want to relate this back to Custom.Before.Microsoft.Common.targets and Custom.Before.Microsoft.Common.targets then you should know that the technique used there is a bit different. Specifically if you create those files they are automatically imported into every C#/VB.NET project. In this case you have to set this property. You really have two options here:

                1. 您可以將此屬性設(shè)置為環(huán)境變量
                2. 您可以使用另一種技術(shù),ImportBefore &VC++特有的ImportAfter

                對于#1,讓我解釋一下.在 MSBuild 中,當(dāng)您使用語法 $(PropName) 訪問屬性時,如果名稱為 PropName 的屬性不存在,MSBuild 將在環(huán)境變量中查找是否存在這樣的值,如果存在,則返回該值.因此,如果您有一個構(gòu)建服務(wù)器,您希望在其中為每個 VC++ 構(gòu)建包含一個文件,那么只需將這些屬性創(chuàng)建為環(huán)境變量.現(xiàn)在是另一種技術(shù).

                For #1 let me explain a bit. In MSBuild when you access a property with the syntax $(PropName) then if a property with the name PropName doesn't exist MSBuild will look up in the environment variables to see if such a value exists, if it does then that value is returned. So if you have a build server in which you want to include a file for each VC++ build, then just create those properties as environment variables. Now for the other technique.

                ImportBefore/ImportAfter在 VC++ 中引入了一個新概念.在 Microsoft.Cpp.Win32.targets 中,您可以看到 .targets 文件頂部的聲明.

                ImportBefore/ImportAfter In VC++ a new concept is introduced. In Microsoft.Cpp.Win32.targets you can see the declaration at the top of the .targets file.

                <Import Project="$(VCTargetsPath)PlatformsWin32ImportBefore*.targets" 
                Condition="Exists('$(VCTargetsPath)PlatformsWin32ImportBefore')" />
                

                然后有一個朝向底部

                <Import Project="$(VCTargetsPath)PlatformsWin32ImportAfter*.targets" 
                Condition="Exists('$(VCTargetsPath)PlatformsWin32ImportAfter')" />
                

                其他目標(biāo)平臺也存在類似的導(dǎo)入聲明.查看 %ProgramFiles32%MSBuildMicrosoft.Cppv4.0Platforms 中的文件以了解具體名稱.

                A similar import declaration exists for the other target platforms as well. Take a look at the files at %ProgramFiles32%MSBuildMicrosoft.Cppv4.0Platforms for the specific names.

                如果您想要導(dǎo)入文件,則使用此技術(shù)只需創(chuàng)建一個以 .targets 結(jié)尾的文件并將其放入適當(dāng)?shù)奈募A中.這樣做的好處是它將被導(dǎo)入到該平臺的每個 VC++ 構(gòu)建中,并且您可以創(chuàng)建許多不同的文件.缺點(diǎn)是您必須將它們放在那些特定的文件夾中.這是兩種技術(shù)之間的主要區(qū)別.使用第一種技術(shù),您可以通過屬性指定文件位置,它不會自動包含在每個構(gòu)建中,但對于第二種方法,您不能更改位置

                With this technique if you want a file to be imported then simply create a file that ends with .targets and place it into the appropriate folder. The advantage of this is that it will be imported into every VC++ build for that platform, and that you can create many different files. The drawback is that you have to place them in those specific folders. That's the main difference between both techniques. With this first technique you can specify the file location via property and its not automatically included for every build, but for the second approach it is but you cannot change the location

                這篇關(guān)于MSBuild:用于 VS2010 中本機(jī) C++ 項目的 Custom.After.Microsoft.Common.targets的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                相關(guān)文檔推薦

                Why do two functions have the same address?(為什么兩個函數(shù)的地址相同?)
                Why the initializer of std::function has to be CopyConstructible?(為什么 std::function 的初始化程序必須是可復(fù)制構(gòu)造的?)
                mixing templates with polymorphism(混合模板與多態(tài)性)
                When should I use the keyword quot;typenamequot; when using templates(我什么時候應(yīng)該使用關(guān)鍵字“typename?使用模板時)
                Dependent name resolution amp; namespace std / Standard Library(依賴名稱解析命名空間 std/標(biāo)準(zhǔn)庫)
                gcc can compile a variadic template while clang cannot(gcc 可以編譯可變參數(shù)模板,而 clang 不能)

                <tfoot id='PdRck'></tfoot>

                <small id='PdRck'></small><noframes id='PdRck'>

                <i id='PdRck'><tr id='PdRck'><dt id='PdRck'><q id='PdRck'><span id='PdRck'><b id='PdRck'><form id='PdRck'><ins id='PdRck'></ins><ul id='PdRck'></ul><sub id='PdRck'></sub></form><legend id='PdRck'></legend><bdo id='PdRck'><pre id='PdRck'><center id='PdRck'></center></pre></bdo></b><th id='PdRck'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='PdRck'><tfoot id='PdRck'></tfoot><dl id='PdRck'><fieldset id='PdRck'></fieldset></dl></div>

              • <legend id='PdRck'><style id='PdRck'><dir id='PdRck'><q id='PdRck'></q></dir></style></legend>

                    • <bdo id='PdRck'></bdo><ul id='PdRck'></ul>
                            <tbody id='PdRck'></tbody>

                          主站蜘蛛池模板: 久久精品一二三影院 | 亚洲精品高清视频在线观看 | 毛片.com| 国产精品久久久久久久久久妞妞 | 麻豆av网站| 亚洲欧美在线观看 | 国产成人综合一区二区三区 | 欧美福利 | 久久精品视频91 | 91在线观看免费 | 精品1区2区 | 成年人免费网站 | 亚洲精品一区二区三区 | 精品国产乱码久久久久久图片 | 中文字幕 在线观看 | 福利网址 | 色一情一乱一伦一区二区三区 | 久久99久久99精品免视看婷婷 | 午夜性视频 | 久久精品久久久久久 | 精品视频在线一区 | 欧美阿v | caoporn国产精品免费公开 | 日韩中文在线视频 | 免费成人高清在线视频 | 亚洲一区二区免费视频 | av免费在线观看网站 | 黄色免费在线观看 | 欧美综合网 | 少妇一级淫片免费放播放 | 亚洲劲爆av | 97超碰站 | 欧美精品一级 | 91成人精品视频 | 日韩免费一区二区 | 性高湖久久久久久久久3小时 | 亚洲黄色一级 | 午夜视频在线免费观看 | 99久久国产综合精品麻豆 | 午夜免费影视 | 国产精久久久久久久 |