我在 ccnet.config 中使用 CruiseControl.NET 和 devenv 来自动构建 VS 2005 .NET 解决方案。该解决方案包含对几个相互依赖的项目的引用,以及一个库文件夹,其中包含第三方 dll 和从我创建的项目编译的其他 dll。
我遇到的问题是尝试设置我的 ccnet.config 文件,以便在开始 devenv 任务之前从 SVN 获取 .NET sln 文件和 Library 文件夹中每个项目的最新更新。
由于我似乎在网上找不到任何东西,有人可以帮助或指出我正确的方向吗?
下面是我的 ccent.config 文件,我正在使用 PreProcessor 来避免重复,因为我将把它重用于具有类似结构的其他解决方案文件:
<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
<cb:define MainTrunk="svn://mySvnUrl"/>
<cb:define WorkingDir="C:\Svn\"/>
<cb:define SvnExec="C:\Program Files\CollabNet Subversion Client\svn.exe"/>
<cb:define ArtifactsDir="\Artifacts"/>
<cb:define name="MyProjectName">
<project name="$(ProjectName)"
description="$(ProjectName) build">
<triggers>
<!-- check the source control every X time for changes,
and run the tasks if changes are found -->
<intervalTrigger
name="continuous"
seconds="500"
buildCondition="IfModificationExists"
initialSeconds="5"/>
</triggers>
<sourcecontrol type="svn">
<trunkUrl>$(MainTrunk)/$(ProjectName)/trunk</trunkUrl>
<workingDirectory>$(WorkingDir)$(ProjectName)</workingDirectory>
<executable>$(SvnExec)</executable>
</sourcecontrol>
<tasks>
<devenv>
<solutionfile>$(WorkingDir)$(ProjectName)\$(ProjectName).sln</solutionfile>
<configuration>Debug</configuration>
<executable>C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.com</executable>
<!--<buildTimeoutSeconds>10</buildTimeoutSeconds>-->
</devenv>
</tasks>
<publishers>
<xmllogger />
<artifactcleanup cleanUpMethod="KeepLastXBuilds"
cleanUpValue="50" />
</publishers>
</project>
</cb:define>
<cb:scope ProjectName="ProjectA">
<cb:MyProjectName/>
</cb:scope>
</cruisecontrol>
更新:在提出问题后,我开始认为解决这个问题的方法可能是检查依赖项目的修改,如果有变化,然后触发 VS 解决方案文件的构建 - ProjectA。所以我已经相应地更新了我的 ccnet.config(见下文)。然后,我也将它应用于我的 VS sln 中的依赖项目。
如果有人可以看看并让我知道我是否朝着正确的方向前进,我仍然会很感激。
<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
<!-- This is your CruiseControl.NET Server Configuration file. Add your projects below! -->
<cb:define MainTrunk="svn://SvnUrl"/>
<cb:define WorkingDir="C:\Svn\"/>
<cb:define SvnExec="C:\Program Files\CollabNet Subversion Client\svn.exe"/>
<cb:define ArtifactsDir="\Artifacts"/>
<cb:define name="MyProjectName">
<project name="$(ProjectName)"
description="$(ProjectName) build">
<triggers>
<projectTrigger project="Libraries">
<triggerStatus>Success</triggerStatus>
<innerTrigger type="intervalTrigger"
seconds="120"
buildCondition="ForceBuild" />
</projectTrigger>
</triggers>
<sourcecontrol type="svn">
<trunkUrl>$(MainTrunk)/$(ProjectName)/trunk</trunkUrl>
<workingDirectory>$(WorkingDir)$(ProjectName)</workingDirectory>
<executable>$(SvnExec)</executable>
</sourcecontrol>
<tasks>
<devenv>
<solutionfile>$(WorkingDir)$(ProjectName)\$(ProjectName).sln</solutionfile>
<configuration>Debug</configuration>
<executable>C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.com</executable>
<!--<buildTimeoutSeconds>10</buildTimeoutSeconds>-->
</devenv>
</tasks>
<publishers>
<xmllogger />
<artifactcleanup cleanUpMethod="KeepLastXBuilds"
cleanUpValue="50" />
</publishers>
</project>
</cb:define>
<cb:scope ProjectName="ProjectA">
<cb:MyProjectName/>
</cb:scope>
<project name="Libraries">
<triggers>
<intervalTrigger name="continuous" seconds="60" buildCondition="IfModificationExists" initialSeconds="5"/>
</triggers>
<sourcecontrol type="svn">
<trunkUrl>svn://SvnUrl/Libraries</trunkUrl>
<workingDirectory>C:\Svn\Libraries</workingDirectory>
<executable>C:\Program Files\CollabNet Subversion Client\svn.exe</executable>
</sourcecontrol>
</project>
</cruisecontrol>