can't use dynamicvalues for <files> within a <merge> task (Bug #99)


Added by Rami AbuGhazaleh over 2 years ago. Updated over 2 years ago.


Status:New Start date:04/05/2012
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:- Spent time: -
Target version:1.9
Affected version:1.6

Description

Hi.

Thank you for CCNet v1.6.7981.1.

I can't seem to use dynamicValues for <files> within a <merge> task.

For example,
<project name="project1" >
...
<publishers>
<merge>
<files>
<file>$[dynamicValue1]</file>
</files>
</merge>
...
</publishers>
<parameters>
<textParameter>
<name>dynamicValue1</name>
<display>dynamic value 1</display>
<required>true</required>
</textParameter>
</parameters>
</project>

Produces the following exception:
2012-04-05 12:42:30,386 [project1: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.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at ThoughtWorks.CruiseControl.Core.Tasks.DynamicValueUtility.PropertyValue.ChangePropertyValue(Object value)
at ThoughtWorks.CruiseControl.Core.Tasks.TaskBase.ApplyParameters(Dictionary`2 parameters, IEnumerable`1 parameterDefinitions)
at ThoughtWorks.CruiseControl.Core.Project.PublishResults(IIntegrationResult result, Dictionary`2 parameterValues)

Here are some links for reference:
http://www.mail-archive.com/ccnet-user@googlegroups.com/msg04248.html
http://stackoverflow.com/questions/4569614/cc-net-file-merge-task-and-dynamic-values


History

Updated by Olivier Sannier over 2 years ago

I believe this is a duplicate of Issue #48

Updated by Rami AbuGhazaleh over 2 years ago

I still see this issue happening in ccnet server 1.7.741.8065.

Updated by Rami AbuGhazaleh over 2 years ago

I also noticed this in the ccnet.log file when the ccnet service starts:
[CCNet Server:DEBUG] MergeFilesTask: Add '' to 'Merge' file list.

This seems to indicate that the project/publishers/merge/files/file elements are not evaluated at build time which would be required to use dynamic values.

It seems this is because the "files" reflector property (i.e. MergeFiles) has a custom serializer factory.

Updated by Ruben Willems over 2 years ago

remove the custom serialiser : all problems solved
but this is a breaking change, that's why moved to 1.9

  • Target version set to 1.9

Also available in: Atom PDF