0

我在理解巡航控制时遇到问题。我想创建一个构建自动化,以便在我的项目中执行构建。为此,我在 ccnet.config 文件中创建了以下条目

<project name="My Web Release " description="Web config">
  <workingDirectory>d:\GIT</workingDirectory>

  <triggers/>

  <sourcecontrol type="git">
    <repository>GIT REPO</repository>
    <branch>release-name</branch>
    <autoGetSource>true</autoGetSource>
    <fetchSubmodules>true</fetchSubmodules>
    <executable>C:\Program Files (x86)\Git\cmd\git.exe</executable>
    <tagOnSuccess>false</tagOnSuccess>
    <commitBuildModifications>false</commitBuildModifications>
    <commitUntrackedFiles>false</commitUntrackedFiles>
    <tagCommitMessage> Build {0}</tagCommitMessage>
    <tagNameFormat>Build-{0}</tagNameFormat>
    <committerName>Build</committerName>
    <committerEMail>build@build.com</committerEMail>
    <workingDirectory>$(workingDirectory)\Sources\WEB</workingDirectory>
    <timeout>600000</timeout>
  </sourcecontrol>

  <tasks>
    <msbuild>
      <executable>c:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe</executable>
      <buildFile>BuildScript.xml</buildFile>
      <targets>NewBuild</targets>
      <logger>C:\Program Files (x86)\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll</logger>
    </msbuild>
  </tasks>

  <publishers>
    <xmllogger />
    <artifactcleanup cleanUpMethod="KeepLastXBuilds" cleanUpValue="50" />
  </publishers>

</project>

而且我确实有一个 BuildScript.xml 文件。我的问题是: 这是 nAnt 还是 MSBUILD 脚本?

我之所以问是因为我正在尝试遵循文档,但我遇到了很多关于未知任务等的问题。

例如,这个:

<property name="configuration" value="CLOSED" />

会生成一个未知的“属性”任务。

我正在查看 MSBuild 文档以使用移动任务

我到了这条线:

<move file="originPath" tofile="TargetPath"/>

但我得到:

BuildScript.xml(18,3):错误 MSB4036:未找到“移动”任务。检查以下内容: 1.) 项目文件中的任务名称与任务类的名称相同。2.) 任务类是“公共的”并且实现了 Microsoft.Build.Framework.ITask 接口。3.) 在项目文件或位于“C:\Windows\Microsoft.NET\Framework\v2.0.50727”目录中的 *.tasks 文件中正确声明了任务。

让我抓狂的是,在我们迁移到巡航控制系统之前它就已经工作了。

这是否被解释为 nAnt 或 MSBuild?关于我为什么会收到这些错误的任何想法?

4

1 回答 1

3

看起来你混合了 nant 和 msbuild,如果是 msbuild 它看起来像

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" Tools="4.0">
<Target Name="Move">
<PropertyGroup>
   <configuration>CLOSED</configuration>
</PropertyGroup>

<Move SourceFiles="Somefilefile" DestinationFolder="c:\temp"/>
</Target>
</Project>

因此,套管是一个问题,您需要指定工具版本,因为 move 可从 4.0.0 开始使用。

于 2013-06-05T08:11:44.390 回答