0

以下是我正在使用的配置,即使我通过签入强制构建,程序集的版本号也不会更新。

可能我错过了一些东西。

注意:新构建服务器,这是我的第一个。我们有很多 Assemblyinfo.cs 文件,在不同的项目下。

我需要使用 msbuildtaks 来解决这个问题吗?如果是这样,你能举个例子吗?

<cruisecontrol xmlns:cb="urn:ccnet.config.builder" xmlns="http://thoughtworks.org/ccnet/1/8">
 <!-- preprocessor settings -->
 <cb:define ArtifactsDir="\Artifacts" />
 <cb:define ProductNameCompanySvnPath = "D:\CompanySvn\Trunk\Source\"/>
 <cb:define TortoiseSvnExe = "C:\Program Files\TortoiseSVN\bin\svn.exe"/>
 <cb:define SvnPathToBuild = "http://dummy.mummy.com/svn/Company/branches/Branch-meau/" />
 <cb:define NantExecutablePath = "C:\Program Files\NANT\bin\nant.exe"/>
 <cb:define BranchNameCI="_BR_Meau_CI"/>
 <cb:define BuildMode = "Release"/>
 <cb:define PlatformCpu = "X86"/>
 <cb:define MsBuildExecutable = "C:\Windows\Microsoft.NET\Framework64\v3.5\msbuild.exe" />
 <cb:define MajorVersionNumber = "4"/>
 <cb:define MinorVersionNumber = "1"/>

<cb:define name="svn_ci_ProductName">
    <executable>$(TortoiseSvnExe)</executable>
    <workingDirectory>$(ProductNameCompanySvnPath)ProductName.Company\</workingDirectory>
    <trunkUrl>$(SvnPathToBuild)ProductName.Company/</trunkUrl>
    <cleanUp>true</cleanUp>
    <autoGetSource>true</autoGetSource>
</cb:define>
<cb:define name="svn_ci_Database">
    <executable>$(TortoiseSvnExe)</executable>
    <workingDirectory>$(ProductNameCompanySvnPath)Database\</workingDirectory>
    <trunkUrl>$(SvnPathToBuild)Database/</trunkUrl>
    <cleanUp>true</cleanUp>
    <autoGetSource>true</autoGetSource>
</cb:define>
<cb:define name="svn_ci_ThirdParty">
    <executable>$(TortoiseSvnExe)</executable>
    <workingDirectory>$(ProductNameCompanySvnPath)ThirdParty\</workingDirectory>
    <trunkUrl>$(SvnPathToBuild)ThirdParty/</trunkUrl>
    <cleanUp>true</cleanUp>
    <autoGetSource>true</autoGetSource>
</cb:define>
<cb:define name="svn_ci_Release">
    <executable>$(TortoiseSvnExe)</executable>
    <workingDirectory>$(ProductNameCompanySvnPath)Release\</workingDirectory>
    <trunkUrl>$(SvnPathToBuild)Release/</trunkUrl>
    <cleanUp>true</cleanUp>
    <autoGetSource>true</autoGetSource>
</cb:define>
  <project name="Company_SVN_Build" description="Build Trunk after merge.">
    <workingDirectory>$(ProductNameCompanySvnPath)ProductName.Company\</workingDirectory>
    <!--<triggers>
     check the source control every X time for changes, and run the tasks if changes are found 
      <intervalTrigger name="continuous" seconds="30" buildCondition="IfModificationExists" initialSeconds="5"/>
    </triggers>-->
    <triggers>
        <intervalTrigger name="continuous" seconds="180" buildCondition="IfModificationExists" initialSeconds="30" />
    </triggers>
    <labeller type="assemblyVersionLabeller">
      <major>$(MajorVersionNumber)</major>
      <minor>$(MinorVersionNumber)</minor>
      <incrementOnFailure>true</incrementOnFailure>
    </labeller>
    <!-- get all the souce from the branch required to build the binaries. -->
    <sourcecontrol type="multi">
     <sourceControls>
      <svn>
         <cb:svn_ci_ProductName/>
      </svn>
      <svn>
         <cb:svn_ci_Database/>
      </svn>
      <svn>
         <cb:svn_ci_ThirdParty/>
      </svn>
      <svn>
         <cb:svn_ci_Release/>
      </svn>
     </sourceControls>
    </sourcecontrol>
    <tasks>
        <msbuild>
           <executable>$(MsBuildExecutable)</executable>
           <projectFile>$(ProductNameCompanySvnPath)ProductName.Company\ProductName.Company.sln</projectFile>
           <buildArgs>/p:Configuration=Release /p:Platform=$(PlatformCpu) /v:diag</buildArgs>
           <targets>clean</targets>
           <timeout>9000</timeout>
           <logger>C:\Program Files (x86)\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll</logger>
         </msbuild>
         <msbuild>
           <executable>$(MsBuildExecutable)</executable>
           <projectFile>$(ProductNameCompanySvnPath)ProductName.Company\ProductName.Company.sln</projectFile>
           <buildArgs>/p:Configuration=Release /p:Platform=$(PlatformCpu) /v:diag</buildArgs>
           <targets>Build</targets>
           <timeout>9000</timeout>
           <logger>C:\Program Files (x86)\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll</logger>
         </msbuild>
        <exec>
          <executable>Prepare_ProductName_Release.bat</executable>
          <baseDirectory>$(ProductNameCompanySvnPath)Release</baseDirectory>
          <buildArgs>all</buildArgs>
          <buildTimeoutSeconds>100</buildTimeoutSeconds>
        </exec>
    </tasks>
    <!-- all plublishers are listed below -->
    <publishers>
      <xmllogger />
      <artifactcleanup cleanUpMethod="KeepLastXBuilds" cleanUpValue="50" />
    </publishers>
  </project>
<!-- End Projects -->
</cruisecontrol>
4

1 回答 1

0

If I'm reading this correctly:

CC.NET is not going to tag your Assemblyinfo.cs files. You have to do that yourself. The "Version" in the CC.NET context is the Cardinal/Ordinal number of the build. Your first build will be "1", then "2", etc, etc.

See my AssemblyInfo.cs "tagging" example here: Use SVN Revision to label build in CCNET

I prefer to tag it with the SVN revision. You may use the CC.NET version.

The way I think of CC.NET is "a big super fancy msbuild caller" "with some post build reporting".

于 2013-05-01T18:40:58.267 回答