创建一个仅将所有文件复制到另一个目录的构建过程模板 [英] Creating a build process template which does nothing but copy all files to another directory

查看:96
本文介绍了创建一个仅将所有文件复制到另一个目录的构建过程模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在TFS 2012 Express中创建一个Build Definition,它将简单地将项目源代码树中的所有文件复制到驱动器上的另一个文件夹中.只是为了强调-我不希望构建输出转到另一个目录-我希望源文件本身指向.原因是我将IIS指向一个特定的文件夹,并且我希望该版本将最新的asp和aspx文件复制到IIS托管文件夹中.

I would like to create a Build Definition inside TFS 2012 Express which will simply copy all files within my project source tree to another folder on my drive. Just to underline - I do not want the build output to go to another directory - I want the source files themselves to. The reason for this is I have IIS pointed at a specific folder, and I want the build to copy the latest asp and aspx files to the IIS hosted folder.

我不确定这样做的复杂性,但确实找到了:

I am not sure of the intricacies of doing this, I did find : http://toadcode.blogspot.co.uk/2008/06/copy-multiple-files-via-tfs-build.html articles like this but I simply need a more direct list of what I need to do from somebody who understands this area.

基本上-构建在排队时,我只想将我的项目源文件复制到另一个目录:).我认为可以通过编辑一些Build.xml文件来完成...但是在进行构建定义时,我似乎并没有被赋予执行我想做的事情的自由!

Basically - when the build is queued, all I want is to copy my project source files to another directory :). I think this can be done by editing some Build.xml file...but when making a build definition I dont seem to be given the freedom to do what I would like to!

我认为我要更改DefaultTemplate.11.1.xaml文件以更改构建过程,以便在构建过程完成后运行此/或批处理文件吗?

I think what I am looking for to alter my DefaultTemplate.11.1.xaml file to alter the build process which will let me run this / or a batch file after the build process completes?

我的TFS生成过程编辑屏幕如下所示:

My TFS build process edit screen looks like this:

推荐答案

使用此

Using this post as a guide on how to start editing TFS Build Templates (or the Wrox TFS 2012 book), you need to make the following changes:

  • 找到复制到放置文件夹"活动:

  • 在将文件拖放到放置位置"下(从Team Foundation Build Activities下的工具箱"中)拖动"CopyDirectory"活动:

  • 转到新活动的属性"窗口,并如下设置源"和目标":
    • 目的地:Path.Combine(BuildDetail.DropLocation, "MyOutputFolder")
    • 来源:Path.Combine(SourcesDirectory, "MyFileFolder")
    • Goto the Properties Window for the new Activity and set Source and Destination as follows:
      • Destination: Path.Combine(BuildDetail.DropLocation, "MyOutputFolder")
      • Source: Path.Combine(SourcesDirectory, "MyFileFolder")

      如果您没有将所有文件都放在一个文件夹中,则可能需要重复此操作.

      You may need to repeat this if you don't have all your files in one folder.

      这篇关于创建一个仅将所有文件复制到另一个目录的构建过程模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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