can't use dynamicvalues for <files> within a <merge> task (Bug #99)
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 about 1 year ago
I believe this is a duplicate of Issue #48
Updated by Rami AbuGhazaleh 11 months ago
I still see this issue happening in ccnet server 1.7.741.8065.
Updated by Rami AbuGhazaleh 11 months 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 Rami AbuGhazaleh 11 months ago
Here is another reference:
http://jira.public.thoughtworks.org/browse/CCNET-2088
Updated by Ruben Willems 10 months 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