【问题标题】:How to include a directory in a nuget package如何在 nuget 包中包含目录
【发布时间】:2013-07-29 14:27:56
【问题描述】:

我在项目中有一个构建后事件,它将项目中未包含的文件夹复制到项目中的共享目录。

xcopy /Y /E "$(TargetDir)\Views\Shared\CommonScripts" "$(ProjectDir)\Views\Shared\CommonScripts"

现在的问题是如果我在本地发布它可以正常工作。但是如果我尝试使用在构建时创建一个nuget包然后使用章鱼发布的teamcity来做到这一点。该文件夹不包括在内。我尝试将其添加到 nuspec 文件中,如下所示:-

<files>
<file src="$CommonScriptsSource$" target="$CommonScriptsDestination$" />
</files>

然后在 teamcity 构建参数中定义参数,但这也不起作用。另外请指导我如何使这个文件夹成为nuget包的一部分。或如何在 nuget 包中复制构建后事件。

【问题讨论】:

    标签: teamcity publishing nuget-package octopus-deploy post-build-event


    【解决方案1】:

    根据设计,NuGet 会排除一些目录(即以点开头的目录)。

    尝试使用nuget pack 命令在您的计算机上从命令行创建一个nuget 包,并使用NuGet Package Explorer 打开它:它包含空目录?

    如果是这样,您可以简单地修改 TeamCity 构建以使用该命令行打包您的项目(使用 Command Line build step)。

    【讨论】:

      【解决方案2】:

      如上所述,您可以执行以下操作.. How to add a folder to a nuspec file

      <files>
        <file src="bin\Release\**\*.*" target="content" /> 
      </files>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-07-12
        • 2020-04-09
        • 2020-03-14
        • 1970-01-01
        • 2013-01-04
        相关资源
        最近更新 更多