2009-04-17 8 views
1

Msbuildタスクを起動するトリガーの名前であるCCNetRequestSourceを使用します。例えば、 "toto"トリガーが鳴っている場合、私はMsBuildで "toto"ターゲットを起動します。出来ますか ? これは夜間のビルドのため、MSIファイルとドキュメントを作成したいのですが、MSBuildで特定のターゲットを作成しましたが、特定のトリガーがスローされた場合にのみ実行する方法は見つかりませんでした。Cruisecontrol.Netで起動するMSBuldTargetを選択

+0

が質問ヘッダに最終的に私が見つけた:) –

答えて

1

これに役立つmsbuild構文があります。以下のリンクを見てみましょう:

あなたはそれがに似た構文を使用してソリューションファイルに委譲します呼び出すためにCruiseControlのためのファサードのビルドファイルを追加してみてください次

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 
    <Choose> 
      <!-- If the toto CCNETRequestSource was submitted --> 
     <When Condition="'$(CCNetRequestSource)'=='toto'"> 
      <PropertyGroup> 
       <Target Name="toto"> 
        <MSBuild Projects="MyProject.sln" Properties="Configuration=Debug" Targets="toto" /> 
       </Target> 
      </PropertyGroup> 
     </When> 
      <Otherwise><!-- Place your standard build call here --></Otherwise> 
    </Choose> 
    </Target> 
</Project> 
+0

感謝をあなたのタイプミスを修正他の方法では自分でもあなたの答えはあまりにも良いはずです:) – LoKtO

+0

見つけたテクニックを共有できますか?私はあなたがこれをどのように解決したのか興味があります...これは解決すべき良い問題でした –

0

私はこのようにそれを作る:

  <Project DefaultTargets="Integration" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 
     <PropertyGroup> 

      <Configuration Condition="'$(CCNetBuildCondition)' == 'ForceBuild'">Release</Configuration> 
      <Configuration Condition="'$(CCNetBuildCondition)' != 'ForceBuild'">Debug</Configuration> 
     </PropertyGroup> 
     <Target Name="Integration" DependsOnTargets="ConstruireSolution;FaireDoc"> 
     </Target> 
     <Target Name="ConstruireSolution" > 
    <!-- with first build --> 
<MSBuild Projects="MyBuild.sln" Properties="Configuration=$(Configuration)" Targets="Clean;Rebuild" /> 
    </Target> 

    <Target Name="FaireDoc" Condition=" '$(CCNetRequestSource)' =='FaireDoc'"> 
    <!--Build to add when FaireDoc trigger is fired --> 
<MSBuild Projects="C:\CI\Plateforme\Documentation\Doc.shfbproj" Targets="Build" /> 
     </Target> 

私はいつも最初のビルドを必要とするので、私はこのソリューションを選択:)第二のターゲットは、夜間のみのランチに砂の城のプロジェクトです:)

関連する問題