xml MSBuild用法

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了xml MSBuild用法相关的知识,希望对你有一定的参考价值。

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <!-- other visual studio project configs -->
  <Target Name="AfterBuild" Condition="'$(Configuration)'=='Release'">
    <ItemGroup>
      <ZipFiles Include="..\kits\$(ProjectName)" />
      <ScriptFiles Include="..\ui\**\*.*" />
    </ItemGroup>
    <RemoveDir Directories="@(ZipFiles)" />
    <Copy SourceFiles="@(ScriptFiles)" DestinationFiles="@(ScriptFiles->'..\kits\$(ProjectName)\%(RecursiveDir)%(Filename)%(Extension)')" />
    <Copy SourceFiles="$(TargetPath)" DestinationFolder="..\kits\$(ProjectName)\lib" />
    
    <!-- WorkingDirectory is the base of the zip file. All files will be made relative from the working directory. -->
    <!-- Flatten="True" means that all directories will be removed and the files will be placed at the root of the zip file. -->
    <!-- Flatten="False" package all files and preserve folder structure -->
    <Zip ZipFileName="..\kits\Port$(ProjectName)-Net.zip" WorkingDirectory="..\kits" Files="@(ZipFiles)" Flatten="False" Quiet="true" />
    <RemoveDir Directories="@(ZipFiles)" />
  </Target>
</Project>

以上是关于xml MSBuild用法的主要内容,如果未能解决你的问题,请参考以下文章

VS2015-项目的默认XML名称空间必须是MSBuild XML名称空间

VS2015-项目默认的XML命名空间必须是MSBuild XML命名空间

项目的默认 XML 命名空间必须是 MSBuild XML 命名空间

如何使用msbuild首先构建依赖项目

TeamCity - MSBuild 代码分析

使用 MsBuild 发布数据库项目