3

I am having an issue trying to merge the outputs of FxCop, StyleCop and a few other xml files into the build.

My configuration looks like this:

<publishers> 
    <merge>
     <files>
            <file>$(ArtifactsFolder)\$(ProjectName)\$(CCBuildVersion)\logs\*.xml</file>
     </files>
 </merge>
    <xmllogger logDir="$(ArtifactsFolder)\$(ProjectName)\$(CCBuildVersion)\logs"/>
</publishers>

The $(CCBuildVersion) comes from the ccnet.config file which looks like this:

<cb:define CCBuildVersion="$[$CCNetLabel]" />

A few things to tell you before you start answering:

  • The xml files DO exist and are in the same directory as the outputted build log from ccnet
  • The xml files seem to be valid, I cannot find anything wrong other than StyleCop has no Xml descriptor at the top, it just goes directly into the root node

The only thing I can think of is that because I am using a dynamic variable that it may not get the right directory when it parses the configuration, but that being said, everything outputs in the right place...

I have gone over EVERY line in the temp log, and have found the following:

2011-10-27 09:50:23,724 [ProjectName:ERROR] Publisher threw exception: System.InvalidCastException: Invalid cast from 'System.String' to 'ThoughtWorks.CruiseControl.Core.Tasks.MergeFileInfo'.
   at System.Convert.DefaultToType(IConvertible value, Type targetType, IFormatProvider provider)
   at System.String.System.IConvertible.ToType(Type type, IFormatProvider provider)
   at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
   at ThoughtWorks.CruiseControl.Core.Tasks.DynamicValueUtility.PropertyValue.ChangePropertyValue(Object value)
   at ThoughtWorks.CruiseControl.Core.Tasks.DynamicValueUtility.PropertyValue.ChangeProperty(Object value)
   at ThoughtWorks.CruiseControl.Core.Tasks.ReplacementDynamicValue.ApplyTo(Object value, Dictionary`2 parameters, IEnumerable`1 parameterDefinitions)
   at ThoughtWorks.CruiseControl.Core.Tasks.TaskBase.ApplyParameters(Dictionary`2 parameters, IEnumerable`1 parameterDefinitions)
   at ThoughtWorks.CruiseControl.Core.Project.PublishResults(IIntegrationResult result, Dictionary`2 parameterValues)

Tried googling it and not getting any relevant matches, anyone ever had this before?

Grofit
  • 17,693
  • 24
  • 96
  • 176

3 Answers3

1

Wild cards are supported.

See this for a work-around to a bug in ccnet: CC.NET File merge task and dynamic values

See this for the bug report: http://www.cruisecontrolnet.org/issues/99

Community
  • 1
  • 1
Rami A.
  • 10,302
  • 4
  • 44
  • 87
0

Does the "file" node allow wildcards? (I didn't think that feature existed, though I could be wrong.) You might try a merge with a single filename using the variables.

Edit: You are defining CCBuildVersion to be the same as CCNetLabel - have you tried just using CCNetLabel directly?

Pedro
  • 12,032
  • 4
  • 32
  • 45
  • Was doing that originally, but then saw about 5 examples which used wildcards, so tried that instead. – Grofit Oct 27 '11 at 08:44
  • Still doesn't do anything, out of curiosity the line where I define $[$CCNetLabel], I tried to default this to "default" i.e $[$CCNetLabel|default], as in the documentation this *should* work, but it doesn't and the server wont start saying something about invalid symbols. It is just I always get a folder called $[$CCNetLabel] in the artifacts root. – Grofit Oct 27 '11 at 08:55
  • The CCNetLabel is not populated until Runtime, so apparently you have to do it the way I have done, I would much rather use the original variable but it has problems with runtime setting of things :( – Grofit Nov 07 '11 at 16:25
0

Don't seem like you can put wildCard :

http://ccnet.sourceforge.net/CCNET/File%20Merge%20Task.html

GregM
  • 2,634
  • 3
  • 22
  • 37