CC.NET文件合并任务和动态值

编程入门 行业动态 更新时间:2024-10-16 02:30:43
本文介绍了CC.NET文件合并任务和动态值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何在文件合并任务中使用CCNetLabel?从我发现我必须使用dynamicValues。我有这样的东西,它不工作任何帮助?

How can I use CCNetLabel in the file merge task? From what I have found I have to use dynamicValues. I have something like this and it is not working any help?

<publishers> <merge> <dynamicValues> <replacementValue property="files"> <format>D:\Testoutput\{0}\*.xml</format> <parameters> <namedValue name="$CCNetLabel" value="Default" /> </parameters> </replacementValue> </dynamicValues> </merge> <xmllogger /> <modificationHistory onlyLogWhenChangesFound="true" /> <statistics /> </publishers>

推荐答案

配置(有意使用更容易阅读的简写符号):

In your script you're trying to generate the following configuration (intentionally I'm using the shorthand notation which is easier to read):

<publishers> <merge> <files>D:\Testoutput\$[$CCNetLabel]\*.xml</files> </merge> <xmllogger /> <modificationHistory onlyLogWhenChangesFound="true" /> <statistics /> </publishers>

这不会工作,因为< files> 是一个数组,因此你需要像下面这样:

This won't work because <files> is an array, therefore you'd need something like:

<publishers> <merge> <files> <file>D:\Testoutput\$[$CCNetLabel]\*.xml</file> </files> </merge> <xmllogger /> <modificationHistory onlyLogWhenChangesFound="true" /> <statistics /> </publishers>

不幸的是,这不工作,因为< dynamicValues>

Unfortunately this doesn't work either because <dynamicValues> are supported only for the <merge> but not for the <files> tag. I don't think it's currently (version 1.6) possible to use integration properties here at all.

我会使用下面的解决方法来实现相同的结果: p>

I'd use the following workaround to achieve the same result:

<publishers> <exec> <executable>C:\Windows\system32\cmd.exe</executable> <buildArgs>/C copy D:\Testoutput\$[$CCNetLabel]\*.xml D:\Testoutput\FixedDir</buildArgs> </exec> <merge> <files> <file>D:\Testoutput\FixedDir\*.xml</file> </files> </merge> <xmllogger /> <modificationHistory onlyLogWhenChangesFound="true" /> <statistics /> <exec> <executable>C:\Windows\system32\cmd.exe</executable> <buildArgs>/C del D:\Testoutput\FixedDir\*.xml</buildArgs> </exec> </publishers>

更多推荐

CC.NET文件合并任务和动态值

本文发布于:2023-11-06 20:39:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1564618.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件合并   动态   CC   NET

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!