1

MSbuild タスクを起動するトリガーの名前である CCNetRequestSource を使用したいと考えています。たとえば、「toto」トリガーが実行されたときに、MSBuild で「toto」ターゲットを起動したいとします。出来ますか?

ナイトリー ビルド用です。この時点で MSI ファイルとドキュメントを作成したいのですが、MSBuild で特定のターゲットを作成しましたが、特定のトリガーがスローされたときにのみ実行する方法が見つかりません。

4

2 に答える 2

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>
于 2009-04-21T12:02:01.127 に答える
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>

私は常に最初のビルドが必要なので、このソリューションを選択します:) 2番目のターゲットは、夜のみ昼食をとる砂の城プロジェクトです:)

于 2009-04-23T12:12:12.397 に答える