使用Gulp生成的文件进行VSTS构建 [英] VSTS Build with Gulp-Generated Files

查看:52
本文介绍了使用Gulp生成的文件进行VSTS构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前有一个VSTS构建,它采用Visual Studio解决方案,并使用以下构建参数对其进行构建(C#):

I currently have a VSTS build that takes in a Visual Studio solution and builds it (C#) with the following build parameters:

/p:DeployOnBuild = true/p:WebPublishMethod = Package/p:PackageAsSingleFile = true/p:SkipInvalidConfigurations = true/p:UseMerge = true/p:PrecompileBeforePublish = true/p:SingleAssemblyName = AppCode"

我还拥有各种Gulp任务,这些任务会吸收我的前端文件并对其进行处理(皮棉,缩小,捆扎等),作为此构建的一部分.问题在于,从解决方案构建步骤创建的zip不包含这些分发文件(或解决方案中未包含的任何文件.)

I also have various Gulp tasks that take in my front-end files and manipulate them (lint, minify, bundle, etc.) as part of this build. The problem is that the zip that is created from the solution build step doesn't include these distribution files (or any file that's not included in the solution.)

通常,检入分发文件不是一个好主意,您需要在生产版本中生成它们.谁能为我指出如何生成这些文件的正确方向(此步骤正在构建中)-并且-将其包含在解决方案构建中生成的zip文件中?

In general it's a bad idea to check in distribution files, you need to generate them as part of the production build. Can anyone point me in the right direction of how to get these files to generate (the build is working for this step) -AND- get them included as part of the zip file generated as part of the solution build?

推荐答案

要将Gulp生成的文件包括到Web应用程序包zip文件中,您可以将Web应用程序包文件放入另一个目录(例如 $(build.binariesdirectory)),然后在执行所有Gulp任务后,可以将Gulp生成的文件添加到 $(build.binariesdirectory)中.然后从 $(build.binariesdirectory)中压缩文件并发布工件.

To include Gulp-Generated Files into web application package zip file, you can get the web application package files into another directory (such as $(build.binariesdirectory)) and after execute all the Gulp tasks, you can add the Gulp-Generated Files into $(build.binariesdirectory). Then zip files from $(build.binariesdirectory) and publish the artifacts.

详细设置如下:

  1. 在VS Build任务中,将MSBuild参数更改为:

  1. In VS Build task, change MSBuild arrguments as:

/p:OutDir="$(build.binariesdirectory)\\"

  • 添加一个任务(PowerShell任务或复制文件"任务等)以将Gulp生成的文件复制到 $(build.binariesdirectory).

    添加存档文件任务以将文件从 $(build.binariesdirectory)压缩到 $(Build.ArtifactStagingDirectory),如下所示:

    Add an Archive Files task to zip files from $(build.binariesdirectory) to $(Build.ArtifactStagingDirectory) as below example:

    现在,压缩文件不仅包含Web应用程序的软件包文件,而且还包含Gulp生成的文件.

    Now the zip file not only contains the package files of the web application, but also contains the Gulp-Generated Files.

    这篇关于使用Gulp生成的文件进行VSTS构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆