【问题标题】:Does CRuise Control use nAnt or MSbuild?Cruise Control 使用 nAnt 还是 MSbuild?
【发布时间】:2013-06-04 22:09:53
【问题描述】:

我在理解 Cruise Control 时遇到问题。 我想创建一个构建自动化,以便在我的项目中执行构建。为此,我在 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 task

我到了这一行:

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

但我明白了:

BuildScript.xml(18,3):错误 MSB4036:“移动”任务没有 成立。检查以下内容: 1.) 项目中的任务名称 文件与任务类的名称相同。 2.) 任务类是 “public”并实现 Microsoft.Build.Framework.ITask 接口。 3.) 在项目文件或位于“C: \Windows\Microsoft.NET\Framework\v2.0.50727" 目录。

让我抓狂的是,在我们迁移到 Cruise Control 之前它就可以正常工作。

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

【问题讨论】:

  • 当您使用 时,CC 将使用 MSBuild。 BuildScript.xml 中有什么?如果你使用的是 VS,为什么不能只构建 sln 而不是使用 BuildScript.xml?

标签: msbuild cruisecontrol.net nant


【解决方案1】:

看起来你混合了 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 开始使用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-04-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多