我在ccnet.config中使用CruiseControl.NET和devenv来自动构建VS 2005 .NET解决方案。该解决方案包含对几个项目的引用,这些项目相互依赖,以及一个Library文件夹,其中包含第三方dll和其他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>
答案 0 :(得分:1)
如果您通过指向库文件夹的项目主干上的svn:externals属性在每个项目根目录中包含第三方库,请在sourcecontrol
配置块中使用以下开关:
<checkExternals>True</checkExternals>
这样,CC.NET也会在库文件夹中修改时触发编译。
您可能还需要:
<checkExternalsRecursive>True</checkExternalsRecursive>