0

我正在尝试使用强制构建选项的一系列参数配置 ccnet.config 文件,但 Validator.exe 程序说:“无法加载数组项 'rangeParameter' - 无法从 System.String 类型转换为 ThoughtWorks.CruiseControl.Remote .Parameters.ParameterBase for object with value:"The type of build to perform.CleanBuildBuild"。我找不到方法,这让我很紧张.....

非常感谢和最好的问候!!!!

这是项目的部分:

<project name="$(PruebaApplicationProject1)" >
     <workingDirectory>$(DriveCheckOut)$(WorkingMainDir)</workingDirectory>
<artifactDirectory>$(DriveCheckOut)$(WorkingMainDir)$(PruebaApplicationProject1)  $(ArtifactDirectory)</artifactDirectory>
<category>Categoria 1</category>
<webURL>$(ServerName1)$(WorkingMainDir)$(PruebaApplicationProject1)$(ArtifactDirectory)$(ReportName)</webURL>
<labeller type="defaultlabeller">
      <initialBuildLabel>1</initialBuildLabel>
      <prefix>Project1-1-</prefix>
      <incrementOnFailure>true</incrementOnFailure>
      <labelFormat>00000</labelFormat>          
</labeller>
<modificationDelaySeconds>1800</modificationDelaySeconds>
<maxSourceControlRetries>5</maxSourceControlRetries>
<initialState>Stopped</initialState>
<startupMode>UseLastState</startupMode>
<triggers>
     <intervalTrigger name="continuous" seconds="600" buildCondition="ForceBuild"  initialSeconds="600" />
<parameterTrigger>
    <parameters>
        <namedValue name="Type" value="Build"/>
    </parameters >
</parameterTrigger>
</triggers>
     <tasks>
    <nant>
                   <executable>$(NAntDirectory)nant.exe</executable>
         <baseDirectory>$(WorkingMainDir)$(PruebaApplicationProject1)\</baseDirectory>             
         <buildFile>$(PruebaApplicationProject1)$(ExtentionBuildFile)</buildFile>
          <buildArgs>-listener:CCNetListener,CCNetListener</buildArgs>

          <buildTimeoutSeconds>1200</buildTimeoutSeconds>
          <dynamicValues>
            <directValue parameter="Type" property="targetList.target[0]" >
                    <default>Build</default>
            </directValue>
          </dynamicValues>
    </nant>
    </tasks>
    <publishers>
    <statistics />
    <xmllogger logDir="$(DriveCheckOut)$(WorkingMainDir)$(PruebaApplicationProject1)$(ArtifactDirectory)" />
         </publishers>
    <parameters>
    <rangeParameter name="Type">
        <description>The type of build to perform.</description>
            <allowedValues>
                <value>Clean</value>
                <value>Build</value>            
            </allowedValues>
            <default>Build</default>                
        </rangeParameter>
    </parameters>
 </project>
4

1 回答 1

1

rangeParameter重命名为selectParameter.

您还需要在<trigger />元素内定义<parameterTrigger />元素。

<project name="$(PruebaApplicationProject1)" >
     <workingDirectory>$(DriveCheckOut)$(WorkingMainDir)</workingDirectory>
<artifactDirectory>$(DriveCheckOut)$(WorkingMainDir)$(PruebaApplicationProject1)  $(ArtifactDirectory)</artifactDirectory>
<category>Categoria 1</category>
<webURL>$(ServerName1)$(WorkingMainDir)$(PruebaApplicationProject1)$(ArtifactDirectory)$(ReportName)</webURL>
<labeller type="defaultlabeller">
      <initialBuildLabel>1</initialBuildLabel>
      <prefix>Project1-1-</prefix>
      <incrementOnFailure>true</incrementOnFailure>
      <labelFormat>00000</labelFormat>          
</labeller>
<modificationDelaySeconds>1800</modificationDelaySeconds>
<maxSourceControlRetries>5</maxSourceControlRetries>
<initialState>Stopped</initialState>
<startupMode>UseLastState</startupMode>
<triggers>
     <intervalTrigger name="continuous" seconds="600" buildCondition="ForceBuild"  initialSeconds="600" />
<parameterTrigger>
    <parameters>
        <namedValue name="Type" value="Build"/>
    </parameters >
    <trigger type="intervalTrigger" seconds="600" />
</parameterTrigger>
</triggers>
     <tasks>
    <nant>
         <executable>$(NAntDirectory)nant.exe</executable>
         <baseDirectory>$(WorkingMainDir)$(PruebaApplicationProject1)\</baseDirectory>             
         <buildFile>$(PruebaApplicationProject1)$(ExtentionBuildFile)</buildFile>
          <buildArgs>-listener:CCNetListener,CCNetListener</buildArgs>

          <buildTimeoutSeconds>1200</buildTimeoutSeconds>
          <dynamicValues>
            <directValue parameter="Type" property="targetList.target[0]" >
                    <default>Build</default>
            </directValue>
          </dynamicValues>
    </nant>
    </tasks>
    <publishers>
    <statistics />
    <xmllogger logDir="$(DriveCheckOut)$(WorkingMainDir)$(PruebaApplicationProject1)$(ArtifactDirectory)" />
         </publishers>
    <parameters>
    <selectParameter name="Type">
        <description>The type of build to perform.</description>
            <allowedValues>
                <value>Clean</value>
                <value>Build</value>            
            </allowedValues>
            <default>Build</default>                
        </selectParameter>
    </parameters>
 </project>
于 2011-12-16T11:49:39.827 回答