我正在尝试创建一个.Net核心项目,它是一个NETStandard.Library版本1.6.0。
我想尝试一个post构建命令,但是现在我注意到在我们的project.json文件中,有一个可以创建的"postcompile“脚本。
这是文档。https://docs.microsoft.com/en-us/dotnet/articles/core/tools/project-json
我已经创建了一个.cmd文件,我从json文件中调用该文件,如下所示:
"scripts": {
"postcompile": ["copyFiles.cmd"]}
在我的cmd文件中,我可以使用一个简单的copy命令,它可以工作:
xcopy /y "C:\Playground\test.txt" "C:\Playground\test\"我所纠结的是,现在我可以使用哪些变量来访问诸如构建输出目录之类的内容?我在任何地方都找不到这方面的参考资料。
提前谢谢。
发布于 2016-08-22 16:07:31
可用于在脚本中控制流的上下文变量的完整列表如下:
每个脚本块:
%project:Directory%
%project:Name%
%project:Version%编译特定:
%compile:TargetFramework%
%compile:FullTargetFramework%
%compile:Configuration%
%compile:OutputFile%
%compile:OutputDir%
%compile:ResponseFile%
%compile:RuntimeOutputDir% (only available if there is runtime output)
%compile:RuntimeIdentifier% (only availabe if there is runtime output)
%comiple:CompilerExitCode% (only available in the postcompile script block)发布特定内容:
%publish:ProjectPath%
%publish:Configuration%
%publish:OutputPath%
%publish:TargetFramework%
%publish:FullTargetFramework%
%publish:Runtime%参考文献:
https://github.com/aspnet/Home/wiki/Project.json-file#scripts
Post build event depending on configuration name in new ASP.NET 5 project
https://stackoverflow.com/questions/39071644
复制相似问题