首页 > 其他分享 >Macros for Build Commands and Properties

Macros for Build Commands and Properties

时间:2023-06-09 16:36:22浏览次数:57  
标签:Commands name extension defined project Macros Build file path


//z 2012-5-17 12:35:17 PM IS2120@CSDN
Pre:
IF NOT EXIST $(IntDir)..\..\lib mkdir $(IntDir)..\..\lib
Post:
copy $(IntDir)$(ProjectName).lib $(IntDir)..\..\lib
upx.exe $(OutDir)../xxx.dll

//z 2012-5-17 12:47:52 PM IS2120@CSDN
Add a call statement before all post-build commands that run .bat files. For example,call C:\MyFile.bat orcall C:\MyFile.bat call C:\MyFile2.bat.
Pre-build events do not run if the project is up to date and no build is triggered.


You can use a MSBuild task on your csproj, like that.

Edit your csproj file

<Target Name="AfterBuild">
    <Copy SourceFiles="$(OutputPath)yourfiles" DestinationFolder="$(YourVariable)" ContinueOnError="true" />
  </Target>



You can use these macros anywhere in a project's

Property Pages dialog box where strings are accepted. These macros are not case sensitive.


Macro

Description

$(RemoteMachine)

Set to the value of the Remote Machine property on the Debug property page. SeeChanging Project Settings for a C/C++ Debug Configuration for more information.

$(References)

A semicolon delimited list of references added to the project.

$(ConfigurationName)

The name of the current project configuration (for example, "Debug").

$(PlatformName)

The name of current project platform (for example, "Win32").

$(Inherit)

Specifies the order in which inherited properties appear in the command line composed by the project build system. By default, inherited properties appear at the end of the current property.1

$(NoInherit)

Causes any properties that would otherwise be inherited, to not be inherited. To also prevent evaluation at the sibling level, use$(StopEvaluating). The use of$(NoInherit) causes any occurrences of$(Inherit) to be ignored for the same property.1

$(StopEvaluating)

Immediately stops the evaluation of a macro in the evaluation chain. Any values that appear after$(StopEvaluating) will not appear in the evaluated value of the macro. If$(StopEvaluating) precedes$(Inherit), the inherited value at the current location in the evaluation chain will not be concatenated to the macro value.$(StopEvaluating) is a superset of the functionality of$(NoInherit).

$(ParentName)

Name of the item containing this project item. This will be the parent folder name, or project name.

$(RootNameSpace)

The namespace, if any, containing the application.

$(IntDir)

Path to the directory specified for intermediate files relative to the project directory. This resolves to the value for theIntermediate Directory property.

$(OutDir)

Path to the output file directory, relative to the project directory. This resolves to the value for theOutput Directory property.

$(DevEnvDir)

The installation directory of Visual Studio .NET (defined as drive + path); includes the trailing backslash '\'.

$(InputDir)

The directory of the input file (defined as drive + path); includes the trailing backslash '\'. If the project is the input, then this macro is equivalent to $(ProjectDir).

$(InputPath)

The absolute path name of the input file (defined as drive + path + base name + file extension). If the project is the input, then this macro is equivalent to $(ProjectPath).

$(InputName)

The base name of the input file. If the project is the input, then this macro is equivalent to $(ProjectName).

$(InputFileName)

The file name of the input file (defined as base name + file extension). If the project is the input, then this macro is equivalent to $(ProjectFileName).

$(InputExt)

The file extension of the input file. It includes the '.' before the file extension. If the project is the input, then this macro is equivalent to $(ProjectExt).

$(ProjectDir)

The directory of the project (defined as drive + path); includes the trailing backslash '\'.

$(ProjectPath)

The absolute path name of the project (defined as drive + path + base name + file extension).

$(ProjectName)

The base name of the project.

$(ProjectFileName)

The file name of the project (defined as base name + file extension).

$(ProjectExt)

The file extension of the project. It includes the '.' before the file extension.

$(SolutionDir)

The directory of the solution (defined as drive + path); includes the trailing backslash '\'.

$(SolutionPath)

The absolute path name of the solution (defined as drive + path + base name + file extension).

$(SolutionName)

The base name of the solution.

$(SolutionFileName)

The file name of the solution (defined as base name + file extension).

$(SolutionExt)

The file extension of the solution. It includes the '.' before the file extension.

$(TargetDir)

The directory of the primary output file for the build (defined as drive + path); includes the trailing backslash '\'.

$(TargetPath)

The absolute path name of the primary output file for the build (defined as drive + path + base name + file extension).

$(TargetName)

The base name of the primary output file for the build.

$(TargetFileName)

The file name of the primary output file for the build (defined as base name + file extension).

$(TargetExt)

The file extension of the primary output file for the build. It includes the '.' before the file extension.

$(VSInstallDir)

The directory into which you installed Visual Studio .NET.

$(VCInstallDir)

The directory into which you installed Visual C++ .NET.

$(FrameworkDir)

The directory into which the .NET Framework was installed.

$(FrameworkVersion)

The version of the .NET Framework used by Visual Studio. Combined with $(FrameworkDir), the full path to the version of the .NET Framework use by Visual Studio.

$(FrameworkSDKDir)

The directory into which you installed the .NET Framework SDK. The .NET Framework SDK could have been installed as part of Visual Studio .NET or separately.

$(WebDeployPath)

The relative path from the web deployment root to where the project outputs belong. Returns the same value asRelativePath.

$(WebDeployRoot)

The absolute path to the location of <localhost>. For example, c:\inetpub\wwwroot.

$(SafeParentName)

The name of the immediate parent in valid name format. For example, a form is the parent of a .resx file.

$(SafeInputName)

The name of the file as a valid class name, minus file extension.

$(SafeRootNamespace)

The namespace name in which the project wizards will add code. This namespace name will only contain characters that would be permitted in a valid C++ identifier.

$(FxCopDir)

The path to the fxcop.cmd file. The fxcop.cmd file is not installed with all Visual C++ editions.


1. Use the Command Line Property Page for the property to see how properties are inherited. SeeSpecifying Project Settings with Property Pages for more information on property inheritance. SeeUsing $(Inherit) and $(NoInherit) for usage examples.



标签:Commands,name,extension,defined,project,Macros,Build,file,path
From: https://blog.51cto.com/u_16156420/6449061

相关文章

  • RuntimeError: Error building extension ‘fused‘&FAILED: fused_bias_act_kernel.c
    RuntimeError:Errorbuildingextension‘fused’&FAILED:fused_bias_act_kernel.cuda.o&ninja:buildstopped:subcommandfailed.问题如下:RuntimeError:Errorbuildingextension‘fused’:[1/3]/usr/local/cuda/bin/nvcc-DTORCH_EXTENSION_NAME=fused-DTORCH_......
  • 重置Jenkins的build序号
    摘自:https://www.jianshu.com/p/e342b52d45e1找到Jenkins的脚本命令行的输入位置,如下图 复制下边的脚本,改成自己的工程名称,点击执行。okitem=Jenkins.instance.getItemByFullName("your-job-name-here")//THISWILLREMOVEALLBUILDHISTORYitem.builds.each(){b......
  • 自定义系统级无窗口全局快捷键热键-Delphi7_Lite_Full_Edition_Setup_7.3.4.3_Build_2
      自定义系统级无窗口全局快捷键热键-Delphi7_Lite_Full_Edition_Setup_7.3.4.3_Build_20110801-2023年6月9日 programProject1_SetHotkeyBaiduSyncDisk;usesForms,Unit1_SetHotkeyBaiduSyncDiskin'Unit1_SetHotkeyBaiduSyncDisk.pas'{Form1};{$R*.res}b......
  • 使用HbuilderX3.8.3_把开发的小程序发布为Html5页面上传到_免费托管空间---uniapp_小
      找了很久,毕竟自己也是做测试,本来想买个服务器来着,由于了一下,还是给我找到了最终~自己做的小程序想部署,又不想买阿里云服务器,部署到阿贝云也不错,阿贝云会给开发者提供, 免费虚拟主机和免费的云服务器,最近我用了一段时间感觉还很不错也很稳定我测试用完全够用了,现......
  • 4) Builder Pattern
    类别: Creationalpattern问题: 构造函数入参超长易变方案: 示例:publicclassBuilderPatternDemo{publicstaticvoidmain(String[]args){Car.Builderbuilder=newCar.Builder("Benz");Carcar=builder.build();System.out.pri......
  • Ubuntu的build-essential有什么作用
    Ubuntu缺省情况下,并没有提供C/C++的编译环境,因此还需要手动安装。但是如果单独安装gcc以及g++比较麻烦,幸运的是,Ubuntu提供了一个build-essential软件包。查看该软件包的依赖关系:y@ubuntu:~$apt-cachedependsbuild-essentialbuild-essential|Depends:libc6-devDepends:<l......
  • 【2023华为云CodeArts Build 实战训练营】云端实战-玩转编译构建
    2023HDC华为开发者大会即将到来,一起跟小智提前体验华为云CodeArtsBuild请注册华为云账号并完成实名认证,实验过程中请使用Chrome浏览器完成相关操作。华为云账号注册步骤请参考:https://support.huaweicloud.com/usermanual-account/zh-cn_topic_0069252244.html实名认证操作步骤请......
  • Vue进阶(幺零八):npm run build 错误 (node:7852) UnhandledPromiseRejectionWarning: Cs
    (文章目录)一、前言在项目打包过程中,突然报如下错误:Vuenpmrunbuild错误(node:7852)UnhandledPromiseRejectionWarning:CssSyntaxError:xxxx.但是在执行npmrundev过程中,并未错误或告警信息。二、解决方案打开webpack.prod.conf.js,注释掉以下配置代码newOptimiz......
  • Step by Step about How to Build libjingle 0.4
    [b]1.DownloadandInstallVisualC++2010Express[/b][url]http://www.microsoft.com/express/Downloads/#2010-Visual-CPP[/url][b]2.DownloadandinstallbinarypackageforExpat[/b]http://sourceforge.net/projects/expat/files/expat_......
  • android: workaround for slow ‘building workspace’ problem in eclipse
    Whiledevelopingforandroidoneclipse3.6ihadtheproblemthateachtimeisavedafile,eclipseblockedmeseveralsecondswith‘buildingworkspace…’.Similartothese:stackoverflow–android-compilation-is-slow-using-eclipsestackoverflow–android-......