【问题标题】:CCNet AsseblyInfo update is not working. is there an issue with my config?CCNet AsseblyInfo 更新不起作用。我的配置有问题吗?
【发布时间】:2013-04-25 10:48:09
【问题描述】:

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

可能我错过了一些东西。

注意:新构建服务器,这是我的第一个。我们有很多 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>

【问题讨论】:

标签: cruisecontrol.net ccnet-config


【解决方案1】:

如果我没看错的话:

CC.NET 不会标记您的 Assemblyinfo.cs 文件。你必须自己做。 CC.NET 上下文中的“版本”是构建的基数/序号。您的第一个构建将是“1”,然后是“2”,等等。

在此处查看我的 AssemblyInfo.cs“标记”示例: Use SVN Revision to label build in CCNET

我更喜欢用 SVN 版本来标记它。您可以使用 CC.NET 版本。

我对 CC.NET 的看法是“一个超级花哨的 msbuild 调用者”“带有一些构建后报告”。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-29
    • 2020-08-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多